0 Replies Latest reply on Oct 13, 2008 11:51 AM by Emanuele Blanco

    How to perform a JNDI lookup?

    Emanuele Blanco Newbie

      Hi,


      I'm really new into Seam (in effect I'm studying it because it's used in the web application I've to modify), and I experienced some issues when handling JNDI.


      I exposed a connection factory via a datasource that binds to a JNDI name (an Apache Jackrabbit Repository, using the resource adapter and JCA). I've got a Seam application that needs to retrieve that factory via JNDI.


      If I try the standard way - I mean:


      obj = new InitialContext().lookup(jndiName)



      I don't receive any exceptions but obj is null. Then I can't get anything to work properly :)


      I read there are some other ways to inject that JNDI object in my component (it has an application scope and it's annotated with @Startup, this is why I guess the inizialization begins when you deploy the app), but I really haven't figured how to do it. Tried with @In(jndiName) before the Object declaration (at class scope), but it didn't work.


      Thank you for helping.