My ear structure is
If you are starting with EJB3 then i would recommend you to use the latest AS5 version (i.e. 5.1.0) because it has better spec compliant support for EJB3.
Injection of EJB3 in servlets isn't supported in 4.2.x for reasons mentioned in our Sticky here http://www.jboss.org/index.html?module=bb&op=viewtopic&t=107353
I've put shared libraries directly under the ear but they are not visible to my war. How can i fix that?
Place those common jars in the EAR/lib folder.
Thanks for your reply. I tried using the same annotation in JBoss 5.1 but it gives the same error. I've now used pitchfork to support annotations in my servlets and web modules.
One more quick question about shared libraries here. I've put my shared libs directly under ear. And the libs specific to war in WEB-INF/lib
Manifest.mf in mywar.war is
Class-Path: myjar.jar mywarlib.war
My war is able to access files in myjar.jar but it gives a NoClassDefFound for all classes n mywarlib.war
Can you please tell me how i can specify relative paths in manifest?
btw i already tried changing manifest to
Class-Path: myjar.jar WEB-INF/lib/mywarlib.war
the JAR files in WEB-INF\lib are automatically added to the classpath, no need to add those to META-INF\Manifest.mf.
As you are using EJB3, you don't need any deployment descriptors besides web.xml, if you use annotations. You might try to remove them all, just to check that no error in one of them breaks your app.
You might post the relevant parts of your servlet code, which don't work. And what is the error message?