Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jboss deployment problem--javax.naming.NameNotFoundException

Posted on 2004-09-11
3
Medium Priority
?
2,354 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
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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

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 …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

972 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