[Installation, Configuration & DEPLOYMENT] - ClassCastException while while class transfering from ear to
by zebathon
Hello,
I'm getting ClassCastException while while class (AccountManagerBean) loading from my ear to a war. I'm pretty sure that I don't have two versions of my class floating around (which I know can cause such an exception). Any help at all would be appreciated.
Here is the code from the servlet in the war.
Object object = EJB3Finder.lookup(AccountManager.class, AccountManagerBean.JNDI_LOCAL_BINDING);
|
| AccountManagerBean accountManager = (AccountManagerBean) object;
I'm not doing any scoped class loading. This is a default jboss4.2.1 install with no changes to the class loading mechanism. The requesting code is in a servlet class in a war. The war is in the ear. WindowsXP.
I've confirmed by the ucl log that my class (AccountManagerBean) is being found and loaded by the ear loader, and followed immediately by the ClassCaste as shown below.
anonymous wrote :
| [453359,RepositoryClassLoader,http-127.0.0.1-80-1] loadClass org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45} name=com.garmin.mb.account.manager.AccountManagerBean, loadClassDepth=0
| [453359,RepositoryClassLoader,http-127.0.0.1-80-1] Loaded class from cache, com.garmin.mb.account.manager.AccountManagerBean@8a58a5<CodeSource: (file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/activity-1.0-SNAPSHOT.jar <no signer certificates>)>
| [453359,RepositoryClassLoader,http-127.0.0.1-80-1] loadClass org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45} name=com.garmin.mb.account.manager.AccountManagerBean class=class com.garmin.mb.account.manager.AccountManagerBean cl=org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45}
| [453375,RepositoryClassLoader,http-127.0.0.1-80-1] loadClass org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45} name=java.lang.jaxws.ClassCastExceptionBean, loadClassDepth=0
Here are my class loading configs in tomcat
<attribute name="Java2ClassLoadingCompliance">false</attribute>
| <attribute name="UseJBossWebLoader">false</attribute>
| <attribute name="FilteredPackages">javax.servlet</attribute>
Here is the report for a class search via UnifiedRepository mbean in the jmx console, which proves there is only one instance correct?
anonymous wrote : com.garmin.mb.account.manager.AccountManagerBean Information
| Repository cache version:
| com.garmin.mb.account.manager.AccountManagerBean(8a58a5).ClassLoader=org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45}
| ..org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45}
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/activity-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/analyzer-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/dao-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/identifier-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/measurement-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/upload-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/kml-xjc-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/commons-logging-1.0.4.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/commons-lang-2.1.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/ehcache-1.2.4RC.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/stax-api-1.0.1.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/gpx-xjc-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/axm-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/persistence-api-1.0.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/stax-1.2.0.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/axm-xjc-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/tcx-xjc-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/sql-1.0-SNAPSHOT.jar
| ....file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/wannabecool-1.0-SNAPSHOT-exp.war/
| ..org.jboss.system.server.NoAnnotationURLClassLoader@5d173
| ..sun.misc.Launcher$AppClassLoader@92e78c
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/lib/tools.jar
| ....file:/C:/dev/jboss-4.2.1.GA/bin/run.jar
| ..sun.misc.Launcher$ExtClassLoader@9fbe93
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/jre/lib/ext/dnsns.jar
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/jre/lib/ext/localedata.jar
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/jre/lib/ext/localedata.pack
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/jre/lib/ext/sunjce_provider.jar
| ....file:/C:/Program%20Files/Java/jdk1.5.0_11/jre/lib/ext/sunpkcs11.jar
| ++++CodeSource: (file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/activity-1.0-SNAPSHOT.jar )
| Implemented Interfaces:
| ++interface com.garmin.mb.account.manager.AccountManager(16e2e5)
| ++++ClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45}
| ++++CodeSource: (file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear-contents/activity-1.0-SNAPSHOT.jar )
|
| ### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3@a70122{ url=file:/C:/dev/jboss-4.2.1.GA/server/default/tmp/deploy/tmp31419motionbased-1.0-SNAPSHOT.ear ,addedOrder=45}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067662#4067662
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067662
18Â years, 9Â months
[Beginners Corner] - implement a store and forward mechanism in jboss (from one d
by geeky2
hello everyone,
i am just starting to use jboss in the workplace. until now - i have only done "academic" projects.
subject: implment a store and forward mechanism with jboss
environment: jboss 4.2.1 on linux suse 10.1 with mysql
we have a legacy socket listener that accepts connections, reads a stream and then uses straight-up JDBC to push records in to a "local" mysql database. i will refer to this instance of the database and jboss app server as JBOSS-A
how would i implement a process in jboss to periodically, "wake up" - on another remote server (i'll call this instance JBOSS-B), and fetch records from JBOSS-B?
note 1: some "translation needs to be done" on the records before they are forwarded to JBOSS-B.
note 2: we would prefer to not do this process outside of the database.
can someone point me to dox, examples or make suggestions?
thx for any help or suggestions.
mark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067659#4067659
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067659
18Â years, 9Â months