Mantis - Resin
Viewing Issue Advanced Details
1440 major always 11-05-06 20:03 11-30-06 12:19
spoty  
ferg  
normal  
closed 3.1.0  
fixed  
none    
none 3.1.0  
0001440: Persistent bean with 99 attributes creates "code too large" compiler error on __ResinExt class
Create a persistent bean over table with 99 columns using property accessors. The generated class is too large and creates a "code too large" compiler error.

Notes
(0001577)
gzhu   
11-07-06 18:57   
the same is true for EJB2 CMP, see following errors when resin started up:

[18:49:44.825] Compiling _ejb/TransportationQuote/TransportationQuoteCMP__Amber.java
[18:49:44.825] Compiling _ejb/TransportationQuote/TransportationQuoteCMP__EJB.java
[18:49:44.825] Compiling _ejb/User/UserCMP__Amber.java
[18:49:44.825] Compiling _ejb/User/UserCMP__EJB.java
[18:49:48.058] com.caucho.config.ConfigException: com.caucho.java.JavaCompileException: /usr/resin-3.1.s061026/webapp/WEB-INF/work/ejb/_ejb/Equipment/EquipmentCMP__Amber.java:8835: code too large
[18:49:48.058] public void __caucho_afterCommit()
[18:49:48.058] ^
[18:49:48.058] Note: * uses or overrides a deprecated API.
[18:49:48.058] Note: Recompile with -Xlint:deprecation for details.
[18:49:48.058] Note: Some input files use unchecked or unsafe operations.
[18:49:48.058] Note: Recompile with -Xlint:unchecked for details.
[18:49:48.058] 1 error
[18:49:48.058] at com.caucho.ejb.cfg.EjbConfig.configure(EjbConfig.java:409)
[18:49:48.058] at com.caucho.ejb.EjbServerManager.build(EjbServerManager.java:552)
[18:49:48.058] at com.caucho.ejb.EjbServerManager.init(EjbServerManager.java:540)
[18:49:48.058] at com.caucho.ejb.EJBServer.manualInit(EJBServer.java:724)
[18:49:48.058] at com.caucho.ejb.EJBServer.init(EJBServer.java:653)
[18:49:48.058] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:49:48.058] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[18:49:48.058] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[18:49:48.058] at java.lang.reflect.Method.invoke(Method.java:585)
(0001602)
gzhu   
11-27-06 00:39   
Causes:

1. Java compiler limits max size of 64k byte code per method, read footnote 4 at the bottom of http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html [^]
2. the size of __caucho_afterCommit() increases as the number of fields in an entity increases.


My Fix (in com.caucho.amber.gen.EntityComponent.java):

I re-arranged the generation of __caucho_afterCommit(), the modified file is http://backhoe.ironplanet.com/download/resin/fix1440/EntityComponent.java [^]

I downloaded 3.1.s061026 some time ago, so my work is based on that version.

(0001618)
ferg   
11-30-06 12:19   
jpa/0g0l