It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes comp not bound exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "comp not bound exception" Watch "comp not bound exception" New topic

comp not bound exception

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
context.listBindings("java.comp") throws the following exception

when i invoked listXML() method in service JNDIView in jmx-console, it displayed the following, which proved the presence of java:comp.

then how listBindings threw that exception?

have a great day,
krishna prasad
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I think you wanted "java:comp", not "java.comp".

An IDE is no substitute for an Intelligent Developer.
krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
i mistyped it. i meant to say "java:comp" only. i configured my jboss in eclipse. i start my jboss from eclipse. then why is it not bound.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

The java:comp/env namespace is per component. What this means is, this namespace and the objects bound in this namespace are accessible only to the component to which this java:comp/env namespace belongs to.

at javax.naming.InitialContext.listBindings(
at com.test.EntityTest.main(

Going by this exception stacktrace, you are trying to lookup the java:comp namespace from a standalone java client, which does not have java:comp namespace of its own

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: comp not bound exception
jQuery in Action, 3rd edition