Link to home
Start Free TrialLog in
Avatar of alexanderpetrous
alexanderpetrous

asked on

jboss deployment problem--javax.naming.NameNotFoundException

The exception is :

javax.naming.NameNotFoundException: Mail not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
java:39)

****************************

The relevant part of my stand alone application:


ctx = new InitialContext();
      

            System.out.println("Loading mail properties ");
           

          Session mailSession = (Session)PortableRemoteObject.narrow(ctx.lookup("java:/Mail"), Session.class);


******************************

When i ran the jboss server 3.2.5, i get this information:


16:35:49,187 INFO  [MailService] Mail Service bound to java:/Mail




*********************

The relevant parts of my ejb-jar.xml file:


<message-driven>
<resource-ref>
        <res-ref-name>email/MyMail</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    </message-driven>

*************************************************

The relevant parts of my jboss.xml file:

<resource-managers>

    <resource-manager>
      <res-name>email/MyMail</res-name>
      <res-jndi-name>java:/Mail</res-jndi-name>
    </resource-manager>

*************************


The jndi.properties file:


java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost



and this file is in the class path of my client stand-alone application.

****************************


Hope i supplied all the information you may need!

Thanks in advance,
alexander.





           
ASKER CERTIFIED SOLUTION
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial