Does it work if you put the jar with the base classes in the lib directory of the JBoss instance? e.g. server/default/lib of the distribution if you are running the default instance. This works for me since we actually use some framework components across multiple web applications.
Use the manifest classpath to reference the required jars: If you put a line
Class-Path: [space-separated list of jar files]
in the META-INF/MANIFEST.MF file of you jar file the classes of the listed jar's are added to the classpath.
Sorry for this duplicate post, but the forum interface signaled an error in posting my first message...
I did solve this in the following, quite simple way:
First put all your base classes and generally all shared classes in a separate jar (say libs.jsr). This jar should be included in your ear file, perhaps under the directory /library to keep things tidy.
Then add this line to the META-INF/MANIFEST.MF file of the ejb jar file:
I've already tried to use the Class-path property in the manifest file and it doesn't work for my case.
I try to explain better my problem: imagine you have an ejb and its implementing class is called ClassA, so in ejb-jar.xml there's a line as the following
imagine also that ClassA extends ClassFather. The problem I experienced is that during deploy the EJB verifier tells me the ClassA is not found IF the ClassFather is not in the same jar.
So the base classes I use are not merely helper classes (like logger ones or something like that).
It seems to me that the deployer needs all the classes in the hierarchy to succeefully deploy the ejb, so until now the only thing to circumvent the problem is to copy in every ejb jars those base classes.
OK. Again I ask - does it work if you put the parent class in the lib directory for the JBoss instance? This is what we do and we extend the parent in the actual EJB implementation (the child). This works for us. At least we can work backwards from there to where you want to be. It may be a classloader issue but we won't know until someone does some empirical work first.
Sorry, I missed the point :-) I will try to put the base jar in server/default/lib and see what happens.
My last post was written only to clarify better the problem. Sorry again
I've deployed my ear after having placed the base jars in server/default/lib also. The problem remains the same:
2003-05-26 21:04:31,430 WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
Bean : MyBean
Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
Info : Class not found: com.some.package.ClassA
actually the ClassA is present in the ejb jar. The parent class, instead, is not in the same ejb jar, but in a utility jar placed in the ear and in server/default/lib also.
After the warning the deployer complains about other classes missing (present in the base jar as well) and drop the ear undeployed.
The jboss version is 3.2.1
Thanks in advance for help
OK. Just wondering if this is a classloader scope problem. Our beans are shared across multiple applications so they actually float outside of EARs. And they work. So perhaps you could try placing them (your EJBs) outside the EAR and straight in the deploy directory. That might give a better idea of whether it is related to anything strange with loading within an EAR. If it still doesn't work, then we know it isn't related to this and we must look elsewhere.
unfortunately it doesn't work, even if the ejb jars are deployed as is and not wrapped in a ear. Actually I made my first attemps not using ear :-)
At this point I prefer to put the base classes in the ejb-jar, rather than to investigate further, as the time go fast