You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Glow Nair <za...@yahoo.com> on 2002/07/21 18:56:35 UTC

Tomcat SendMail Example : NamingException: Cannot create resource

--------------------------------------------------
NamingException : Cannot create resource instance
--------------------------------------------------
While trying to run the SendMail example that
came bundled with Tomcat4, I get the error
NamingException : Cannot create resource instance

I've read and re-read the Tomcat How-To's. And
went through the JNDI tutorials as well.. (at leat
tried to.. till the installation of the LDAP 
server :) )

Am I missing something in CLASSPATH? or is my
Tomcat installation corrupted in some way ? Can
someone help me with this or give me a hint or URL?

Thanks.. I've attached details below. ANY HELP
WOULD BE GREATLY APPRECIATED.

Glow
zanchu_glow@yahoo.com

-------------------------
1. I use IBM's JDK IBMJava2-SDK-1.3-13.0.i386.rpm

2. I downloaded mail.jar and copied it to
   /var/tomcat4/common/lib.

3. I could successfully compile SendMailServelet using
   /opt/IBMJava2-13/bin/javac -verbose 
    -classpath .:/var/tomcat4/common/lib/mail.jar:
      /var/tomcat4/common/lib/servlet.jar
       SendMailServlet.java

4. I fixed the typo in sendmail.jsp ie changed 
   <form ... action="../../SendMailServlet">" TO
   <form ... action="../../servlet/SendMailServlet">

5. I have qmail running on localhost. I verified
   that to be working by sending mail using
   a standalone example that does NOT use
   Tomcat's JNDI implementation.. it worked
   fine by using simple classses.

6. I installed tomcat using the following RPMs
   rpm -ivh regexp-1.2-1.noarch.rpm
   rpm -ivh servletapi4-4.0.3-1.noarch.rpm 
   rpm -ivh xerces-j-1.4.4-2.noarch.rpm 
   rpm -ivh tomcat4-4.0.3-1.noarch.rpm
   rpm -ivh tomcat4-webapps-4.0.3-1.noarch.rpm

7. I connected tomcat to Apache using
   rpm -ivh mod_webapp-1.0-1.i386.rpm
-------------------------

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat SendMail Example : NamingException: Cannot create resource

Posted by Glow Nair <za...@yahoo.com>.
Phil:

Thanks for responding. I got it working. In short,
the simplest advice I can give anyone struggling
with this is to simply use tomcat_4.0.4 instead
of 4.0.3  Found that out after a process of painful
elimination; by changing IBM to Sun and so on..

Everything worked magically after that.. I guess
JNDI support must be better.. :)

Thanks.. 

--- Phil Steitz <ph...@steitz.com> wrote:
> 
> 
> Glow Nair wrote:
> 
> >--------------------------------------------------
> >NamingException : Cannot create resource instance
> >--------------------------------------------------
> >While trying to run the SendMail example that
> >came bundled with Tomcat4, I get the error
> >NamingException : Cannot create resource instance
> >
> >I've read and re-read the Tomcat How-To's. And
> >went through the JNDI tutorials as well.. (at leat
> >tried to.. till the installation of the LDAP 
> >server :) )
> >
> >Am I missing something in CLASSPATH? or is my
> >Tomcat installation corrupted in some way ? Can
> >someone help me with this or give me a hint or URL?
> >
> >Thanks.. I've attached details below. ANY HELP
> >WOULD BE GREATLY APPRECIATED.
> >
> >Glow
> >zanchu_glow@yahoo.com
> >
> >-------------------------
> >1. I use IBM's JDK IBMJava2-SDK-1.3-13.0.i386.rpm
> >
> >2. I downloaded mail.jar and copied it to
> >/var/tomcat4/common/lib.
> >
> Did you also copy activation.jar to common/lib?  
> 
> >
> >
> >3. I could successfully compile SendMailServelet
> using
> >   /opt/IBMJava2-13/bin/javac -verbose 
> >    -classpath .:/var/tomcat4/common/lib/mail.jar:
> >      /var/tomcat4/common/lib/servlet.jar
> >       SendMailServlet.java
> >
> >4. I fixed the typo in sendmail.jsp ie changed 
> >   <form ... action="../../SendMailServlet">" TO
> >   <form ...
> action="../../servlet/SendMailServlet">
> >
> >5. I have qmail running on localhost. I verified
> >   that to be working by sending mail using
> >   a standalone example that does NOT use
> >   Tomcat's JNDI implementation.. it worked
> >   fine by using simple classses.
> >
> >6. I installed tomcat using the following RPMs
> >   rpm -ivh regexp-1.2-1.noarch.rpm
> >   rpm -ivh servletapi4-4.0.3-1.noarch.rpm 
> >   rpm -ivh xerces-j-1.4.4-2.noarch.rpm 
> >   rpm -ivh tomcat4-4.0.3-1.noarch.rpm
> >   rpm -ivh tomcat4-webapps-4.0.3-1.noarch.rpm
> >
> >7. I connected tomcat to Apache using
> >   rpm -ivh mod_webapp-1.0-1.i386.rpm


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat SendMail Example : NamingException: Cannot create resource

Posted by Phil Steitz <ph...@steitz.com>.

Glow Nair wrote:

>--------------------------------------------------
>NamingException : Cannot create resource instance
>--------------------------------------------------
>While trying to run the SendMail example that
>came bundled with Tomcat4, I get the error
>NamingException : Cannot create resource instance
>
>I've read and re-read the Tomcat How-To's. And
>went through the JNDI tutorials as well.. (at leat
>tried to.. till the installation of the LDAP 
>server :) )
>
>Am I missing something in CLASSPATH? or is my
>Tomcat installation corrupted in some way ? Can
>someone help me with this or give me a hint or URL?
>
>Thanks.. I've attached details below. ANY HELP
>WOULD BE GREATLY APPRECIATED.
>
>Glow
>zanchu_glow@yahoo.com
>
>-------------------------
>1. I use IBM's JDK IBMJava2-SDK-1.3-13.0.i386.rpm
>
>2. I downloaded mail.jar and copied it to
>/var/tomcat4/common/lib.
>
Did you also copy activation.jar to common/lib?  

>
>
>3. I could successfully compile SendMailServelet using
>   /opt/IBMJava2-13/bin/javac -verbose 
>    -classpath .:/var/tomcat4/common/lib/mail.jar:
>      /var/tomcat4/common/lib/servlet.jar
>       SendMailServlet.java
>
>4. I fixed the typo in sendmail.jsp ie changed 
>   <form ... action="../../SendMailServlet">" TO
>   <form ... action="../../servlet/SendMailServlet">
>
>5. I have qmail running on localhost. I verified
>   that to be working by sending mail using
>   a standalone example that does NOT use
>   Tomcat's JNDI implementation.. it worked
>   fine by using simple classses.
>
>6. I installed tomcat using the following RPMs
>   rpm -ivh regexp-1.2-1.noarch.rpm
>   rpm -ivh servletapi4-4.0.3-1.noarch.rpm 
>   rpm -ivh xerces-j-1.4.4-2.noarch.rpm 
>   rpm -ivh tomcat4-4.0.3-1.noarch.rpm
>   rpm -ivh tomcat4-webapps-4.0.3-1.noarch.rpm
>
>7. I connected tomcat to Apache using
>   rpm -ivh mod_webapp-1.0-1.i386.rpm
>-------------------------
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>