Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

getting ClassCastException while running weblogic.appc in the ANT build script

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to run a ANT build script on my application code and it gives ClassCastException in one of the classes in the weblogic.jar file. I have attached the stack trace in this forum. The problem here is that when i run the build script with EJB version 2.1 in my ejb-jar.xml it works perfectly fine and it creates the EAR file and gets deployed and even the application runs fine. But when i change the EJB version in my ejb-jar.xml to 3.0, i get a ClassCastException while running the build script.

The entry in my ejb-jar.xml is something like this :

<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd";
version="3.0">

<enterprise-beans>
<session>
<ejb-name>InfoSLSBEJB</ejb-name>
<home>test.info.InfoSLSBHome</home>
<remote>test.info.InfoSLSB</remote>
<ejb-class>test.info.InfoSLSBEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<entity>
<ejb-name>InfoEJB</ejb-name>
<local-home>test.info1.InfoLocalHome</local-home>
<local>test.info1.InfoLocal</local>
<ejb-class>test.info1.InfoEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<abstract-schema-name>InfoEJB</abstract-schema-name>
<cmp-field>
<field-name>end_date</field-name>
</cmp-field>
<cmp-field>
<field-name>cutoff_date</field-name>
</cmp-field>
<cmp-field>
<field-name>last_updated_by</field-name>
</cmp-field>
<cmp-field>
<field-name>conference_id</field-name>
</cmp-field>
<primkey-field>conference_id</primkey-field>
<query>
<query-method>
<method-name>findByConfKey</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(rm) FROM InfoEJB as rm WHERE rm.conf_key = ?1</ejb-ql>
</query>
</entity>
<entity>

<message-driven>
<ejb-name>EmailMDB</ejb-name>
<ejb-class>test.email.TMSEmailMDB</ejb-class>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>acknowledgeMode</activation-config-property-name>
<activation-config-property-value>auto-acknowledge</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>InfoSLSBEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

The entry in my weblogic-ejb-jar.xml is something like this :

<?xml version='1.0' encoding='UTF-8'?>
<weblogic-ejb-jar
xmlns="http://www.bea.com/ns/weblogic/90"; xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">;

<weblogic-enterprise-bean>
<ejb-name>EmailMDB</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>2000</max-beans-in-free-pool>
<initial-beans-in-free-pool>250</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>emailMDB.test.retrieverQ</destination-jndi-name>
</message-driven-descriptor>
<transaction-descriptor></transaction-descriptor>
<enable-call-by-reference>true</enable-call-by-reference>
<jndi-name>test.jms.MailMessageListener</jndi-name>
</weblogic-enterprise-bean>

<weblogic-enterprise-bean>
<ejb-name>InfoEJB</ejb-name>
<entity-descriptor>
<pool></pool>
<entity-cache>
<cache-between-transactions>false</cache-between-transactions>
</entity-cache>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
<entity-clustering></entity-clustering>
</entity-descriptor>
<transaction-descriptor></transaction-descriptor>
<enable-call-by-reference>true</enable-call-by-reference>
<local-jndi-name>InfoEJB</local-jndi-name>
</weblogic-enterprise-bean>

<weblogic-enterprise-bean>
<ejb-name>InfoSLSBEJB</ejb-name>
<stateless-session-descriptor>
<pool></pool>
<stateless-clustering>
<home-is-clusterable>true</home-is-clusterable>
<stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
<stateless-bean-load-algorithm>round-robin</stateless-bean-load-algorithm>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor></transaction-descriptor>
<enable-call-by-reference>true</enable-call-by-reference>
<jndi-name>InfoSLSBEJB</jndi-name>
</weblogic-enterprise-bean>

<idempotent-methods>
<method>
<ejb-name>InfoSLSBEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>CustInfoSLSBEJB</ejb-name>
<method-name>*</method-name>
</method>
</idempotent-methods>
<weblogic-compatibility>
<entity-always-uses-transaction>true</entity-always-uses-transaction>
</weblogic-compatibility>
</weblogic-ejb-jar>

The stacktrace is something like this :

[exec] java.lang.ClassCastException: weblogic.j2ee.descriptor.EntityBeanBeanImpl
[exec] at weblogic.ejb.container.deployer.CompositeMBeanDescriptor.getBusinessRemotes(CompositeMBeanDescriptor.java:515)
[exec] at weblogic.ejb.container.deployer.BeanInfoImpl.<init>(BeanInfoImpl.java:280)
[exec] at weblogic.ejb.container.deployer.ClientDrivenBeanInfoImpl.<init>(ClientDrivenBeanInfoImpl.java:134)
[exec] at weblogic.ejb.container.deployer.EntityBeanInfoImpl.<init>(EntityBeanInfoImpl.java:131)
[exec] at weblogic.ejb.container.deployer.BeanInfoImpl.createBeanInfoImpl(BeanInfoImpl.java:712)
[exec] at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDeploymentInfoImpl.java:534)
[exec] at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:235)
[exec] at weblogic.ejb.container.ejbc.EJBCompiler.getStandAloneDeploymentInfo(EJBCompiler.java:1417)
[exec] at weblogic.ejb.container.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:169)
[exec] at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:511)
[exec] at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:471)
[exec] at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:298)
[exec] at weblogic.application.compiler.EJBModule.compile(EJBModule.java:83)
[exec] at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.java:16)
[exec] at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:35)
[exec] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
[exec] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
[exec] at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
[exec] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
[exec] at weblogic.application.compiler.EJBCompiler.compile(EJBCompiler.java:25)
[exec] at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:118)
[exec] at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)
[exec] at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
[exec] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
[exec] at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
[exec] at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
[exec] at weblogic.application.compiler.Appc.runBody(Appc.java:177)
[exec] at weblogic.utils.compiler.Tool.run(Tool.java:158)
[exec] at weblogic.utils.compiler.Tool.run(Tool.java:115)
[exec] at weblogic.application.compiler.Appc.main(Appc.java:188)
[exec] at weblogic.appc.main(appc.java:14)
[exec] weblogic.j2ee.descriptor.EntityBeanBeanImpl

Please let me know if anybody has the solution for this issue

Thanks & Regards,
Ashar
[/size][/size][/size]
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic