Java session facade not being found via InitialContext lookups
Posted
by Hugh Buchanan
on Stack Overflow
See other posts from Stack Overflow
or by Hugh Buchanan
Published on 2010-06-15T22:05:24Z
Indexed on
2010/06/16
20:12 UTC
Read the original article
Hit count: 256
I have a project that is Java EE 5 running on Glassfish. The IDE is Netbeans 6.7.1.
We periodically have a very annoying problem with new session facades not being located via InitialContext:
javax.naming.NameNotFoundException: No object bound to name java:comp/env/GlobalConfigEntityFacadeLocal
In my class (within the same EJB container), I can use the other session facades just fine.
This sort of problem happens periodically, and a mixture of clean&build and deleting the build-impl.xml files from nbproject sometimes resolve this.
We are not using ejb-jar.xml (stopped using that over a year ago, it is now an empty
The code that is calling this is very straight forward:
GlobalConfigEntityFacadeLocal globalConfigEntityFacade = null;
try {
InitialContext ic = new InitialContext();
globalConfigEntityFacade = (GlobalConfigEntityFacadeLocal) ic.lookup("java:comp/env/GlobalConfigEntityFacadeLocal");
...
} catch ( ... ) {}
Any advice would be appreciated!!!!
Cheers
© Stack Overflow or respective owner