I intend to develop and deploy a simple web application using
- EJB 3
- JSP and servlet
- JBoss 7
- JPA
I have coded the application and created a standard ear with following structure
app.ear
|_ lib (with all required jars such as the commons logging)
|_ META-INF
|_ application.xml
|_ jboss-app.xml
|_ app_ejb.jar (contains a stateless EJB, an entity, persistence.xml etc...)
|_ app_web.war (jsps, servlet, web.xml etc..)
jboss-app.xml :- (library is the app name)
<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>library:app=ejb3</loader-repository>
</jboss-app>
application.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
<display-name>library</display-name>
<module>
<ejb>ejb_library.jar</ejb>
</module>
<module>
<web>
<web-uri>web_library.war</web-uri>
<context-root>web_library</context-root>
</web>
</module>
</application>
Now when I deploy this ear with the admin console of JBoss 7, the web module seems to have been deployed, even the pages are hit. However, the further part of the application where I try to inject the EJB in the servlet (as a instance varialbe using @EJB), fails.
There seems to be some problem in the way I am deploying the application.
I tried to find a tutorial where I could deploy the app in JBoss but with all that I am stuck till this.
Could anyone guide me with this? I am using JBoss for the first time and am not completely aware of JBoss specific configurations.