Solved

jboss deployment problem--javax.naming.NameNotFoundException

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL 2000 User Log in Security for user SA 4 236
SSL vs TLS ? 9 70
report generation frameworks 1 58
ESXi 6.x and Host Profiles 5 73
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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…

706 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

20 Experts available now in Live!

Get 1:1 Help Now