Hi,
I have a web archive and service archive running with Jboss-4.0.2. My
requirement is to import some classes from war into sar.
I can get the compilation by defining classpath to use classes from
different src. But somehow when I run jboss, I get class not found
exception.
I tried specifying war in jboss-service.xml of sar under classpath->
archives. Since war contains classes like WEB-INF/classes/<package>, it
not able to find package.
Please let me know if there is any way to share classes among different
archives.
Thanks,
Kapil
Jeff.C - 06 Mar 2006 07:16 GMT
I met similar problems several years ago.
When I deployed an .ear file which includes a war file, some
ejbs(jars.) and some utility jar files. The utility jar files cant be
shared by war and ejbs. The problem took me several days.
But your question is another case, I think you need to know the
relationship between classloaders of sar and war.
David Linsin - 06 Mar 2006 22:46 GMT
This is indeed a classloader problem, since classes in War files are
loaded with a seperate ClassLoader.
I suggest to move the common classes to a seperate jar file. For
further information
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases
David
kapilbajaj@gmail.com - 08 Mar 2006 07:30 GMT
Thanks for the solutions. common classes in a seperate jar solved
problem
kapilbajaj@gmail.com - 08 Mar 2006 07:31 GMT
Thanks for the solutions. common classes in a seperate jar solved
problem
-Kapil
David Linsin - 08 Mar 2006 23:05 GMT
Raymond DeCampo - 12 Mar 2006 15:51 GMT
> Hi,
>
[quoted text clipped - 10 lines]
> Please let me know if there is any way to share classes among different
> archives.
I understand that you have solved the problem, but as an FYI, you should
know that the default configuration for JBoss is not fully J2EE
compliant. Consult the readem_j2ee.html file in your JBoss home
directory for instructions on how to change the configuration to make it
J2EE compliant.
HTH,
Ray

Signature
This signature intentionally left blank.