11 Replies Latest reply: Apr 27, 2012 10:41 AM by Joseph Fouts RSS

Help Understanding AS-7 Classloading

Joseph Fouts Novice

I have read the doc on AS7 classloading and I am still a bit confused on how to setup an external jar file to use with AS-7.

I am hoping that someone can shed some light:)

 

In my example I am trying to get XStream to work with my SLSB (Stateless Session Bean) running on AS-7.

 

The SLSB has calls to the XStream api that require the xstream.jar file.

 

My question is how do I setup JBoss- AS-7 to find the xstrean.jar file?

 

In my simple example I have a java client call the SLSB.

The SLSB has calls to the Xstream API.

 

I have done a couple of things but I still must be missing something.

 

I keep getting the following error:

 

          Caused by: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/XStreamException

 

 

In the modules/ folder I added the following:

 

   com\thoughtworks\xstream\main

 

Copied the xstream.jar file to the \main folder.

 

Created the module.xml file:

 

<?xml version="1.0" encoding="UTF-8"?>

  <module xmlns="urn:jboss:module:1.1" name="com.thoughtworks.xstream">

  <resources>

    <resource-root path="xstream-1.4.1.jar"/>

  </resources>

</module>

 

Here is where I get confused. 

 

Should something go into the standalone.xml file?

Do I need a domain.xml file?  I yes then where does it go?

Do I need a jboss-deployment-structure.xml file?

 

*One note is that this is not a web application.  It is a stand alone java client calling a SLSB.

 

Any help is greatly appreciated. 

 

Thanks.