Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jboss deployment problem--javax.naming.NameNotFoundException

Posted on 2004-09-11
3
Medium Priority
?
2,348 Views
Last Modified: 2009-06-12
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.





           
0
Comment
Question by:alexanderpetrous
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 2000 total points
ID: 12041004
Hi,

look at this information..

<Context ...>
...
<Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
<parameter><name>mail.smtp.user</name>
<value>userid</value>
</parameter>
<parameter><name>mail.from</name>
<value>userid@mail.host</value>
</parameter>


</ResourceParams>
...
</Context>

Note that I couldn't find anything about the pasword, but some posts I've seen talk about most smtp providers don't require a password, just a username and a mail from. Apparently they check the IP address as well. The password is only needed for pop access and receiving mail.

May I ask which SMTP Provider you're trying to send mail through? With my ISP account, I can program java and send mail through their smtp provider with no problem as long as I'm dialed in from home and it can see that my ip address is part of their network. However, from work, it doesn't matter if I supply my username and password. They reject it. That could also be an issue.

i hope it may help you

R.K
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question