JNDI Lookup

aemik

Bekanntes Mitglied
Hallo,

will aus eibnem einfachen Javaprogramm einen JNDI Lookup machen, aber es klappt einfach nicht.

Java:
Context ctx = (Context) new InitialContext().lookup("java:comp/env");

Aktuell hab ich einen Glassfish am laufen.
Was muss ich noch konfigurieren?
 
was klappt an dem Lookup nicht? gibt es eine Fehlermeldung? wenn ja welche?

So wie es da steht, würde ich einfach mal tippen, dass da ein null zurück kommt, weil er unter "java:comp/env" einfach nichts findet. Ist aber nur ein Schuß ins Blaue
 
Java:
Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:comp/env' in SerialContext  [Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation ]
 

Zurück
Oben