Mantis - Resin
Viewing Issue Advanced Details
1429 minor always 10-30-06 11:14 11-30-06 14:48
ferg  
ferg  
normal  
closed 3.0.21  
no change required  
none    
none  
0001429: amber: generating duplicate fields
(rep by Bryan May)

We've been using Resin 2.1.x for ages now and I thought I would try to bite the bullet and upgrade to Resin 3. Things have been moving swimmingly until I ran into the big stack trace below.

The only configuration file that I have changed so far is web.xml to use the <database> element and the <ejb-server> element.

I have made no modifications to the EJB deployment descriptor.

It seems that Amber is creating two member variables with the same name. Has anybody run into this before?

Thanks in advance,

       Bryan

[14:41:36.764] Initializing ejb-server : java:comp/env/batproblems_cmp
[14:41:37.188] Compiling _ejb/BaT_ArchitectureEJB/ArchitectureBean__Amber.java
[14:41:37.188 ] Compiling _ejb/BaT_ArchitectureEJB/ArchitectureBean__EJB.java
[14:41:37.188] Compiling _ejb/BaT_AttributeEJB/AttributeBean__Amber.java
[14:41:37.188] Compiling _ejb/BaT_AttributeEJB/AttributeBean__EJB.java
[14:41: 37.188] Compiling _ejb/BaT_ClusterEJB/ClusterBean__Amber.java
[14:41:37.188] Compiling _ejb/BaT_ClusterEJB/ClusterBean__EJB.java
[14:41:37.188] Compiling _ejb/BaT_ClusterFoundOnEJB/ClusterFoundOnBean__Amber.java
[14:41:37.188] Compiling _ejb/BaT_ClusterFoundOnEJB/ClusterFoundOnBean__EJB.java
[14:41:37.188] Compiling _ejb/BaT_ErrorEJB/BaTErrorBean__Amber.java
[14:41:37.188] Compiling _ejb/BaT_ErrorEJB/BaTErrorBean__EJB.java
[14:41:37.188] Compiling _ejb/BaT_ErrorSessionEJB/BaTErrorSessionBean__EJB.java
[14:41:37.188] Compiling _ejb/BaT_StageEJB/StageBean__Amber.java
[14:41:37.188] Compiling _ejb/BaT_StageEJB/StageBean__EJB.java
[14:41: 37.902] com.caucho.config.ConfigException: com.caucho.java.JavaCompileException: /export/local/resin/webapps/main/WEB-INF/work/ejb/_ejb/BaT_ClusterFoundOnEJB/ClusterFoundOnBean__Amber.java:58: __amber_found_in_id is already defined in _ejb.BaT_ClusterFoundOnEJB.ClusterFoundOnBean__Amber
[14:41:37.902] public int __amber_found_in_id;
[14:41:37.902] ^
[14:41:37.902] 1 error
[14:41:37.902] at com.caucho.ejb.cfg.EjbConfig.configure(EjbConfig.java:411)
[14:41:37.902] at com.caucho.ejb.EjbServerManager.build (EjbServerManager.java:552)
[14:41:37.902] at com.caucho.ejb.EjbServerManager.init(EjbServerManager.java:540)
[14:41:37.902] at com.caucho.ejb.EJBServer.manualInit(EJBServer.java:669)
[14:41:37.902] at com.caucho.ejb.EJBServer.init (EJBServer.java:598)
[14:41:37.902] at sun.reflect.GeneratedMethodAccessor136.invoke(Unknown Source)
[14:41:37.902] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[14:41: 37.902] at java.lang.reflect.Method.invoke(Method.java:324)
[14:41:37.902] at com.caucho.config.BeanTypeStrategy.init(BeanTypeStrategy.java:318)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureImpl(NodeBuilder.java :259)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureChildImpl(NodeBuilder.java:303)
[14:41:37.902] at com.caucho.config.EnvironmentAttributeStrategy.configure(EnvironmentAttributeStrategy.java:56)
[14:41: 37.902] at com.caucho.config.NodeBuilder.configureAttributeImpl(NodeBuilder.java:381)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureBeanImpl(NodeBuilder.java:341)
[14:41:37.902] at com.caucho.config.TypeStrategy.configureBean (TypeStrategy.java:103)
[14:41:37.902] at com.caucho.config.BeanTypeStrategy.configureBean(BeanTypeStrategy.java:228)
[14:41:37.902] at com.caucho.config.EnvironmentTypeStrategy.configureBean(EnvironmentTypeStrategy.java :70)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureBean(NodeBuilder.java:197)
[14:41:37.902] at com.caucho.config.Config.configureBean(Config.java:291)
[14:41:37.902] at com.caucho.config.Config.configureBean (Config.java:262)
[14:41:37.902] at com.caucho.config.core.ResinImport.init(ResinImport.java:142)
[14:41:37.902] at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
[14:41:37.902] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
[14:41:37.902] at java.lang.reflect.Method.invoke(Method.java:324)
[14:41:37.902] at com.caucho.config.BeanTypeStrategy.init(BeanTypeStrategy.java:318)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureImpl(NodeBuilder.java:259)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureChildImpl(NodeBuilder.java:303)
[14:41:37.902] at com.caucho.config.EnvironmentAttributeStrategy.configure (EnvironmentAttributeStrategy.java:56)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureAttributeImpl(NodeBuilder.java:381)
[14:41:37.902] at com.caucho.config.TypeStrategy.configureAttribute(TypeStrategy.java :112)
[14:41:37.902] at com.caucho.config.EnvironmentTypeStrategy.configureAttribute(EnvironmentTypeStrategy.java:89)
[14:41:37.902] at com.caucho.config.NodeBuilder.configureAttribute(NodeBuilder.java:230)
[14:41: 37.902] at com.caucho.config.NodeBuilderChildProgram.configureImpl(NodeBuilderChildProgram.java:54)
[14:41:37.902] at com.caucho.config.BuilderProgramContainer.configureImpl(BuilderProgramContainer.java:62)
[14:41: 37.902] at com.caucho.config.BuilderProgram.configure(BuilderProgram.java:60)
[14:41:37.902] at com.caucho.server.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:377)
[14:41: 37.902 ] at com.caucho.server.deploy.EnvironmentDeployController.configureInstance(EnvironmentDeployController.java:61)
[14:41:37.902] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:619)
[14:41: 37.902] at com.caucho.server.deploy.DeployController.restartImpl(DeployController.java:584)
[14:41:37.902] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.alarm(StartAutoRedeployAutoStrategy.java:176)
[14:41: 37.902] at com.caucho.server.deploy.DeployController.handleAlarm(DeployController.java:742)
[14:41:37.902] at com.caucho.util.Alarm.handleAlarm(Alarm.java:339)
[14:41:37.902] at com.caucho.util.Alarm.run(Alarm.java :309)
[14:41:37.902] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
[14:41:37.902] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[14:41:37.902] at java.lang.Thread.run(Thread.java:534)
[14:41:37.902] Caused by: com.caucho.java.JavaCompileException: /export/local/resin/webapps/main/WEB-INF/work/ejb/_ejb/BaT_ClusterFoundOnEJB/ClusterFoundOnBean__Amber.java:58: __amber_found_in_id is already defined in _ejb.BaT_ClusterFoundOnEJB.ClusterFoundOnBean__Amber
[14:41:37.902] public int __amber_found_in_id;
[14:41:37.902] ^
[14:41:37.902] 1 error
[14:41:37.902] at com.caucho.java.InternalCompiler.executeInt(InternalCompiler.java)
[14:41:37.902] at com.caucho.java.InternalCompiler.compileInt(InternalCompiler.java:81)
[14:41:37.902] at com.caucho.java.AbstractJavaCompiler.run(AbstractJavaCompiler.java:101)
[14:41:37.902] ... 1 more
[14:41:37.903] com.caucho.config.LineConfigException : WEB-INF/web.xml:404: com.caucho.java.JavaCompileException: /export/local/resin/webapps/main/WEB-INF/work/ejb/_ejb/BaT_ClusterFoundOnEJB/ClusterFoundOnBean__Amber.java:58: __amber_found_in_id is already defined in _ejb.BaT_ClusterFoundOnEJB.ClusterFoundOnBean__Amber
[14:41:37.903] public int __amber_found_in_id;
[14:41:37.903] ^
[14:41:37.903] 1 error

Notes
(0001571)
ferg   
11-01-06 14:19   
I believe that I found the cause.

My deployment descriptor had these two fields that pointed to the same column.

  <entity>
    <ejb-name>Foo_BarEJB</ejb-name>
    <local-home>test.BarHome </local-home>
    <local>test.Bar</local>
    <ejb-class>test.BarBean</ejb-class>

    <prim-key-class>int</prim-key-class>
    <primkey-field>foundInId</primkey-field>

    <persistence-type>Container</persistence-type>
    <reentrant>False</reentrant>

    <abstract-schema-name>Bar</abstract-schema-name>
    <sql-table>BAR</sql-table>

    <cmp-field><field-name>clusterFoundOnId</field-name><sql-column>found_in_id</sql-column></cmp-field>
    ...
</entity>

Commenting out the second definition, and replacing it with an implementation in the BarBean class has allowed the class to compile.

Rob sent me down the path that led to this.
(0001622)
ferg   
11-30-06 14:48   
Duplicate fields by the user.