Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Jboss share classes between war and sar

Thread view: 
kapilbajaj@gmail.com - 06 Mar 2006 04:43 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.