tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raimee Stevens <raimee_stev...@yahoo.com>
Subject ROOT context fails to use mail/Session Resource param. defaults to localhost
Date Thu, 10 Jul 2003 12:42:21 GMT

I am not able to use the JNDI mail Factory from the ROOT context. It works when

run from the examples context and other non-ROOT contexts as well. For some reason,

the ROOT context fails to correctly load the SMTP host variable defined by the JNDI

resource in the server.xml(below). It does however register in the Context log (below) with
the correct value.

> Exception Log 

ENCOUNTERED EXCEPTION: javax.mail.SendFailedException: Sending failed; nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested
exception is: java.net.ConnectException: Connection refused: connect 

javax.mail.SendFailedException: Sending failed;
  nested exception is: 
 javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
  nested exception is: 
 java.net.ConnectException: Connection refused: connect
 at javax.mail.Transport.send0(Transport.java:219)
 at javax.mail.Transport.send(Transport.java:81)
 at SendMailServlet.doPost(SendMailServlet.java:75)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:376)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:221)
 at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
 at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
 at java.lang.Thread.run(Thread.java:536)

> web.xml

<web-app>

<display-name>ROOT Context</display-name>

<!-- Define servlets and Mappings -->

<servlet>

<servlet-name>SendMailServlet</servlet-name>

<servlet-class>SendMailServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>SendMailServlet</servlet-name>

<url-pattern>/SendMailServlet</url-pattern>

</servlet-mapping>

<resource-ref>

<res-ref-name>mail/Session</res-ref-name>

<res-type>javax.mail.Session</res-type>

<res-auth>Container</res-auth>

</resource-ref>


</web-app>

>server.xml

<!-- ROOT Context --> 

<Context debug="99" docBase="/ROOT" path="" reloadable="true" source="com.ibm.etools.webtools.server:ROOT">

<Logger className="org.apache.catalina.logger.FileLogger" prefix="Context_ROOT_" suffix=".log"
timestamp="true"/>

<Resource auth="Container" name="mail/Session" type="javax.mail.Session"/>

<ResourceParams name="mail/Session">

<parameter>

<name>mail.smtp.host</name>

<value><smtphostname></value>

</parameter>

</ResourceParams>

</Context>

>Context FileLogger output shows that JNDI naming context was correctly initialized with
correct host name: (<smtphostname>)

2003-07-09 14:37:41 NamingContextListener[/Standalone/myhostname]: Creating JNDI naming context
2003-07-09 14:37:41 NamingContextListener[/Standalone/myhostname]:   Resource parameters for
mail/Session = ResourceParams[name=mail/Session, parameters={mail.smtp.host=<smtphostname>}]
2003-07-09 14:37:41 NamingContextListener[/Standalone/myhostname]:   Adding resource ref mail/Session
2003-07-09 14:37:41 NamingContextListener[/Standalone/myhostname]:   ResourceRef[className=javax.mail.Session,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=mail.smtp.host,content=<smtphostname>}]
2003-07-09 14:37:41 NamingContextListener[/Standalone/myhostname]:   Resource parameters for
UserTransaction = null


I didn't see a similar item in the bugs database. Has this problem been addressed? 






-----------------------------
 Yours Truly,
 Raimee

---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message