-
1. Re: How can I set classloader in JBOSS
jaikiran Jun 7, 2011 4:57 AM (in response to paresh2011)paresh modi wrote:
I have set BaseClassLoader explicitly but it doesn't work. Is there any way I can set BaseClassLoader for all.
You shouldn't. Please post the entire exception stacktrace (without setting any classloader in your code). Also please read these wiki articles:
-
2. Re: How can I set classloader in JBOSS
paresh2011 Jun 7, 2011 10:27 AM (in response to jaikiran)Hi,
Thanks for the reply. Please find attached .txt file contains full stack trace of ClassCastException, please note that here IFCLINE class extends IFCCURVE so it should be cast to upper level and for few object it's successful as well, you can see this in log file as well in which I have logged class loader for both the class for each turn. I have not set any class loader explicitly. Below is my deployment artifacts.
- tms-ear-1.0.ear
- TMS-1.0.war
- jsp
- META-INF
- MANIFEST.MF
- WEB-INF
- Classes
- com
- applicationContext.xml
- lib
- jtds-1.2.2.jar
- server-config.wsdd
- web.xml
- Classes
- META-INF
- MANIFEST.MF
- application.xml
- TMS-1.0.war
All the classes are in TMS-1.0.war\WEB-INF\classes\com location only.
Waiting for your expert advice.
Thanks
Paresh.
-
ClassLoader_Exception.txt.zip 824 bytes
- tms-ear-1.0.ear
-
3. Re: How can I set classloader in JBOSS
alesj Jun 7, 2011 10:39 AM (in response to paresh2011)My guess is you're bundling something that you shouldn't; e.g. some Java(EE) classes -- check jtds jar?
.war CL - as child-first lookup - tries to load them, where something else loads those classes from boot classpath.
-
4. Re: How can I set classloader in JBOSS
paresh2011 Jun 8, 2011 10:57 AM (in response to alesj)Hi,
Thanks for the reply. I have resolved mentioned issue but still have question and want some advice as well. As I have explained earlier below are my deployment artifacts of EAR.
= > tms-ear-1.0.ear
== > TMS-1.0.war
=== > jsp
=== > META-INF
==== > MANIFEST.MF
=== > WEB-INF
==== > Classes
===== > com
==== > lib
===== > jtds-1.2.2.jar
= > META-INF
== > MANIFEST.MF
== > application.xml
= > solr-1.war
= > tms-solr-1.0.jar
Here I have removed all the classes from TMS-1.0.war/tms-ear-1.0.ear/WEB-INF/classes/, create a jar file tms-com.jar and placed it to TMS-1.0.war/ location and that’s how my issue gets resolved.Previously the issue was occurred due to some classes are loaded from the server/TMS/lib location from myappscommon.jar file and others are loaded from the TMS-1.0.war/tms-ear-1.0.ear/WEB-INF/classes location.
I have resolved this issue but the deployment structure has been changed as I have explained, So I want your suggestion to manage this artifact properly in a standard way.
Thanks
Paresh -
5. Re: How can I set classloader in JBOSS
alesj Jun 8, 2011 11:22 AM (in response to paresh2011)TMS-1.0.war/tms-com.jar? --> this does nothing, it's not a classpath entry
-
6. Re: How can I set classloader in JBOSS
paresh2011 Jun 9, 2011 12:45 AM (in response to alesj)Hi,
Sorry I forgot to mention class path entry here, actually I have added class path entry in tms-ear-1.0.ear/META-INF/MANIFEST.MF file for tms-com.jar.
I want to know that is it ok if I place all the classes in .jar file at tms-ear-1.0.ear location ? Or any other suggestion you can provide... will be helpful a lot.
Thanks
Paresh