Hi,
I have a problem locating the home interface of an stateless session bean. The application server is JBoss. The beans seem to
deploy without errors on the app server. I have been fighting with problem for 2 days now.
Following is the code i am using
try {
Context context = new InitialContext();
Object ref = context.lookup("ejb/Lego")
;
home = (LegoHome)PortableRemoteOb
ject.narro
w(ref,Lego
Home.class
);
} catch (NamingException e) {
e.printStackTrace();
}
I have also tried using
Object ref = context.lookup("java:comp/
env/ejb/Le
go");
to lookup the EJB.
The Output from server on deployment is:
[EjbModule] Deploying Lego
[StatelessSessionInstanceP
ool] Started jboss.j2ee:jndiName=ejb/Le
go,plugin=
pool,servi
ce=EJB
[StatelessSessionContainer
] Started jboss.j2ee:jndiName=ejb/Le
go,service
=EJB
[EjbModule] Started jboss.j2ee:module=LegoEJB.
jar,servic
e=EjbModul
e
Contents of my jndi.properties file:
[EjbModule] Deploying Lego
[StatelessSessionInstanceP
ool] Started jboss.j2ee:jndiName=ejb/Le
go,plugin=
pool,servi
ce=EJB
[StatelessSessionContainer
] Started jboss.j2ee:jndiName=ejb/Le
go,service
=EJB
[EjbModule] Started jboss.j2ee:module=LegoEJB.
jar,servic
e=EjbModul
e
Contents of application.xml are:
<application>
<display-name>My Test Application</display-name>
<module>
<ejb>LegoEJB.jar</ejb>
</module>
<module id="WarModule_1">
<web>
<web-uri>LegoWeb.war</web-
uri>
<context-root>/test</conte
xt-root>
</web>
</module>
<module id="EjbModule_1">
<ejb>LegoEJB.jar</ejb>
</module>
</application>
When I try to access it from Servlet I get Following Error on JBOSS Console:
javax.naming.NameNotFoundE
xception: ejb not bound
at org.jnp.server.NamingServe
r.getBindi
ng(NamingS
erver.java
:495)
at org.jnp.server.NamingServe
r.getBindi
ng(NamingS
erver.java
:503)
It Seems I am messing up with some configuration problem somewhere. Please Help Urgent
Please Let me know what all do i have to configure to get this running.
Start Free Trial