tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geirola Marco <m.geir...@set-network.com>
Subject JNDI Resources Problem
Date Wed, 18 Jun 2003 08:32:43 GMT
I'm trying to add a new custom resource factories in jakarta, I followed 
the documentation instructions, I wrote a class that extend 
ObjectFactory and I modified server.xml
and web.xml but dosen't work.
I use tomact 4.1.18.

I use a jsp to try the resource Can someone help me? Follow the jsp 
source, web.xml file, context os server.xml and the exception.

--------------------------------
JSP Code:
--------------------------------

<%@ page language="java" %>

<html>
<body>
<%
   javax.naming.Context ctx = new javax.naming.InitialContext();
   javax.naming.Context envCtx = (javax.naming.Context) 
ctx.lookup("java:comp/env");
   net.sf.hibernate.SessionFactory factory = 
(net.sf.hibernate.SessionFactory) 
envCtx.lookup("hibernate/JNDIHibernateFactory");
%>
</body>
</html>

-----------------------------
web.xml
-----------------------------

<web-app>

   <resource-env-ref>
       <description>Object factory for Hibernate SessionFactory 
instances.</description>
       
<resource-env-ref-name>hibernate/JNDIHibernateFactory</resource-env-ref-name>


       
<resource-env-ref-type>net.sf.hibernate.SessionFactory</resource-env-ref-type>


   </resource-env-ref>

</web-app>

--------------------------
server.xml
--------------------------

   <Context className="org.apache.catalina.core.StandardContext" 
cachingAllowed="true" 
charsetMapperClass="org.apache.catalina.util.CharsetMapper" 
cookies="true" crossContext="false" debug="2" 
docBase="C:\Programmi\Apache Group\Tomcat4.1\webapps\persistance-0.1" 
mapperClass="org.apache.catalina.core.StandardContextMapper" 
path="/persistance-0.1" privileged="false" reloadable="false" 
swallowOutput="false" useNaming="true" 
wrapperClass="org.apache.catalina.core.StandardWrapper">
         <Logger className="org.apache.catalina.logger.FileLogger" 
debug="0" directory="logs" prefix="localhost_log_persistance." 
suffix=".txt" timestamp="true" verbosity="5"/>
       <Resource name="hibernate/JNDIHibernateFactory" auth="Container" 
type="net.sf.hibernate.SessionFactory"/>
       <ResourceParams name="hibernate/JNDIHibernateFactory">
           <parameter>
                <name>factory</name>
               
<value>com.set.edi.persistance.hibernate.JNDIHibernateFactory</value>
           </parameter>
           <parameter>
               <name>Hibernate.Property</name>
               <value>hibernate.cfg.xml</value>
           </parameter>
       </ResourceParams>
       </Context>


org.apache.jasper.JasperException
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248) 

   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   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:260) 

   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:170) 

   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.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.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:432)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)


   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 

   at java.lang.Thread.run(Unknown Source)


root cause

javax.servlet.ServletException
   at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) 

   at org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) 

   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   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:260) 

   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:170) 

   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.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.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:432)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)


   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 

   at java.lang.Thread.run(Unknown Source)





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message