Hi, I have a problem locating the local home of an entity bean (let's call it FooEntity). The appserver is JBoss. I might add that my knowledge of the J2EE architecture is very limited. The beans seem to deploy without errors on the app server.
Here's the code:
private static Object getFooEntityLocalHome() throws NamingException {
String lookupURL = "java:comp/env/ejb/foo/Foo
Entity";
Context context = new InitialContext();
return context.lookup(lookupURL);
}
Here's from web.xml:
<ejb-ref>
<ejb-ref-name>ejb/foo/FooE
ntity</ejb
-ref-name>
<ejb-ref-type>Entity</ejb-
ref-type>
<home>foo.FooEntityHome</h
ome>
<remote>foo.FooEntity</rem
ote>
</ejb-ref>
And here's the server side error:
19:32:52,110 INFO [STDOUT] lookupURL:java:comp/env/ej
b/foo/FooE
ntity
19:32:52,111 INFO [STDOUT] context.getNameInNamespace
():
19:32:52,111 ERROR [STDERR] javax.naming.NameNotFoundE
xception: ejb not bound
19:32:52,113 ERROR [STDERR] at org.jnp.server.NamingServe
r.getBindi
ng(NamingS
erver.java
:495)
19:32:52,113 ERROR [STDERR] at org.jnp.server.NamingServe
r.getBindi
ng(NamingS
erver.java
:503)
19:32:52,113 ERROR [STDERR] at org.jnp.server.NamingServe
r.getObjec
t(NamingSe
rver.java:
509)
19:32:52,113 ERROR [STDERR] at org.jnp.server.NamingServe
r.lookup(N
amingServe
r.java:253
)
19:32:52,113 ERROR [STDERR] at org.jnp.server.NamingServe
r.lookup(N
amingServe
r.java:256
)
19:32:52,113 ERROR [STDERR] at org.jnp.interfaces.NamingC
ontext.loo
kup(Naming
Context.ja
va:528)
19:32:52,114 ERROR [STDERR] at org.jnp.interfaces.NamingC
ontext.loo
kup(Naming
Context.ja
va:642)
19:32:52,114 ERROR [STDERR] at org.jnp.interfaces.NamingC
ontext.loo
kup(Naming
Context.ja
va:507)
19:32:52,114 ERROR [STDERR] at javax.naming.InitialContex
t.lookup(I
nitialCont
ext.java:3
47)
Regards,
Marko
Start Free Trial