Check out the TDK+JBoss Howto on the Turbine Site.
 
http://jakarta.apache.org/turbine/howto/jboss-howto.html
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
Sent: Monday, June 25, 2001 6:40 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] JBoss + Catalina JNDI Probs


I checked out the list archives and noticed a bit of discussion earlier this month on problems getting Servlets within Catalina to connect to JBoss.  Has any of this been resolved? (I didn't see an answer anywhere).  I have tried the nonaming option as many have suggested, but to no avail.

I'm getting the "java.net.MalformedURLException: unknown protocol: jndi" error others have reported.

I've pasted the sample code I'm trying to execute below.


Thanks,
Jason


Here's the simple client code that my servlet tries to execute:
    // Sanity check....uses values copied from jndi.properties
    // just changed the hostname in the url to match the actual JBoss server name
    System.err.println("Using these values:");
    for (Enumeration e = EJB_ENV.keys(); e.hasMoreElements();) {
      String key = (String)e.nextElement();
      System.err.println(key + "=" + EJB_ENV.get(key));
    }

    if (ejbCtx == null) {
      try {
        ejbCtx = new InitialContext(EJB_ENV);
      } catch (Exception e) {
        log("Error getting EJB context!");
        e.printStackTrace();
        return null;
      }
    }

    try {
      //Retrieve a handle to the Home object
      System.err.println("About to lookup up: " +  userJNDIName);
      Object o = ejbCtx.lookup(userJNDIName);         // <----- Breaks here
      UserHome uh = (UserHome)PortableRemoteObject.narrow(o, UserHome.class);
      return uh.create();
    } catch (Exception e) {
      log("Error getting an User object!");
      e.printStackTrace();
      return null;
    }

Reply via email to