-
1. Re: ClassCastException within an EAR deployment
jaikiran Feb 10, 2008 10:06 AM (in response to heizenberg) -
2. Re: ClassCastException within an EAR deployment
ejb3workshop Feb 11, 2008 9:42 AM (in response to heizenberg)Maybe have a look at the EJB3 specification Section EE 8.2. It describes the mechanism for packaging utility classes within EAR files.
-
3. Re: ClassCastException within an EAR deployment
heizenberg Feb 11, 2008 10:41 AM (in response to heizenberg)I doubt if it's EAR packaging. If I had a ClassNotFoundException, that would have been my first guess. I can see the classes... I just cannot seem to class it to the base interface. Perhaps one of the documents pointed out by JaiKiran holds a clue or two, but I haven't found them so far.
-
4. Re: ClassCastException within an EAR deployment
heizenberg Feb 11, 2008 10:43 AM (in response to heizenberg)I meant 'cast' and not 'class' in my last reply above.
-
5. Re: ClassCastException within an EAR deployment
jaikiran Feb 12, 2008 12:40 AM (in response to heizenberg)There's a jmx-console method mentioned at http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions. See if that's of any help.
-
6. Re: ClassCastException within an EAR deployment
heizenberg Feb 12, 2008 1:03 PM (in response to heizenberg)Thanks JaiKiran. I did check my class loaders in my JMX console. It showed no duplicates. I also tried playing with a jboss-app.xml file and tried to specify one classloader for the entire EAR. That didn't help either.
-
7. Re: ClassCastException within an EAR deployment
jaikiran Feb 13, 2008 7:15 AM (in response to heizenberg)Let's try another approach then. When you start JBoss through run.bat (or run.sh) pass the -verbose:class JVM parameter. Like this(for run.bat):
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=256m -verbose:class
Then start JBoss. This will print out to STDOUT the classes being loaded and also the jar files being used for loading these classes. I would recommend redirecting the STDOUT output to some file, as the logs will be too huge:run.bat > classes_out.log
Access your application to get the ClassCastException. The classes_out.log will contain the appropriate information about which jar is being used for loading the Changelist* classes (just do a text search in that log file for this class).
-
8. Re: ClassCastException within an EAR deployment
heizenberg Feb 19, 2008 6:07 PM (in response to heizenberg)I just saw what the problem is, even though I thought I already looked before.
The J2EE utility project I've deployed had the same libraries selected in both the tabs (J2EE Modules and Web Libraries) of the J2EE Module Dependencies settings (on Windows... this doesn't seem to happen on the Linux version of RHDS).
On looking at the deployment, it seems like every time I deploy the EAR, it copies the top level J2EE Utility project libraries into the root level of the EAR and ALSO into the lib folder of my WAR. It doesn't do this in Linux. In Windows, every time I unselect the utility projects in the Web Libraries tab, it comes back when I check the project options again. The only time this has worked, is when I went in and hit the 'Deselect All' button.
So the classloader issue has been straightened out for me, and I should report this as a RHDS bug.