Solved

jboss deployment problem--javax.naming.NameNotFoundException

Posted on 2004-09-11
3
2,299 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macrodef Questions 2 121
Error when deploying war file on GlassFish 4 server 2 554
Install Tomcat via PowerShell 3 1,267
Lamba in java 8 9 239
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…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now