I have a strange problem that I hope somebody can help me with. I have developed two generic classes with static methods. Each class is in its own jar. The classes are:
1. A LogUtil class which basically abstracts Log4j
2. An ErrorTranslation class that translates SQL Exceptions. Basically it creates a New Exception class we have created that extends Exception. This Error Translator calls the LogUtil Method to log the error and various debugging info.
In order to get this to work we had to place both jars in the lib/ext directory of JBoss and bootsrap them to the Logging Service in jboss.conf.
This worked fine until we introduced a stateful session bean ( Bean A ) calling a stateful session bean ( Bean B ). Bean A is accessed via the client. To deploy it we just place the jar file in the deploy directory and it deploys fine. To Deploy the second Bean ( Bean B ) we create a interface file containing the home and remote interfaces. We place this in a non-JBoss directory and create a JBOSS_CLASSPATH entry to it. We place the jar containg the bean -- also containing the home and remote interfaces in the deploy directory.
When it deploys we get a CLassDefNotFoundError on our new ExceptionClass. This class is in the lib/ext directory and thus I don't understand why JBoss can't find it. If I remove the JBoss_ClassPath Entry to Bean B, I am able to deploy Bean B, but Bean A is unable to find Bean B. Does anybody know what I am doing wrong?
I think you need to put the interfaces for B in the jar for A, so A can find them using its own classloader.
Putting the B interfaces on the JBOSS_CLASSPATH I think makes the stuff (lib/ext) invisible to B interfaces, wrong classloader.
You could just move to jboss 3 where these problems are gone;-) all the jars can see each other.