views:

54

answers:

2

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

A: 

This sort of problem happens periodically, and a mixture of clean&build and deleting the build-impl.xml files from nbproject sometimes resolve this.

I suspect a deployment problem and unless you can provide a deterministic way to reproduce it, I'm afraid it will remain a random problem.

Pascal Thivent
A: 

Well, it turned out to be web.xml. It's been so long since the last facade was created that we totally forgot that web.xml had to be updated.

Hugh Buchanan