Salve a tutti,
praticamente, dalla mia webapp nella pagina.jsp devo recuperare il path di un file utilizzando JNDI:

i parametri di configurazione sono i seguenti:

web-inf/web.xml
codice:
  	
<resource-ref> 		
<description>path SSO</description> 		
<res-ref-name>url/SSOpath</res-ref-name>
<res-type>java.net.URL</res-type> 		
<res-auth>Container</res-auth> 	
</resource-ref>
web-inf/context.xml
codice:
<Resource name="url/SSOpath" auth="Container" 	 type="java.net.URL" 	 url="file.txt" />
index.jsp
codice:
InitialContext context = new InitialContext();  		URL url=(URL)context.lookup("java:comp/env/url/SSOpath");
quando lancio la pagina, mi dà il seguente errore:
  • description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: javax.servlet.ServletException: javax.naming.NamingException: Cannot create resource instance org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:541) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:417) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jsp.grc_jsp._jspService(grc_jsp.java:63 8) org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) FT.filters.EncodingFilter.doFilter(Unknown Source) root cause javax.servlet.ServletException: javax.naming.NamingException: Cannot create resource instance org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:850) org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:779) org.apache.jsp.index_jsp._jspService(index_jsp.jav a:772) org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jsp.grc_jsp._jspService(grc_jsp.java:63 8) org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) FT.filters.EncodingFilter.doFilter(Unknown Source) root cause javax.naming.NamingException: Cannot create resource instance org.apache.naming.factory.ResourceFactory.getObjec tInstance(ResourceFactory.java:143) javax.naming.spi.NamingManager.getObjectInstance(U nknown Source) org.apache.naming.NamingContext.lookup(NamingConte xt.java:793) org.apache.naming.NamingContext.lookup(NamingConte xt.java:140) org.apache.naming.NamingContext.lookup(NamingConte xt.java:781) org.apache.naming.NamingContext.lookup(NamingConte xt.java:140) org.apache.naming.NamingContext.lookup(NamingConte xt.java:781) org.apache.naming.NamingContext.lookup(NamingConte xt.java:140) org.apache.naming.NamingContext.lookup(NamingConte xt.java:781) org.apache.naming.NamingContext.lookup(NamingConte xt.java:153) org.apache.naming.SelectorContext.lookup(SelectorC ontext.java:137) javax.naming.InitialContext.lookup(Unknown Source) org.apache.jsp.index_jsp._jspService(index_jsp.jav a:204) org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jsp.grc_jsp._jspService(grc_jsp.java:63 8) org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet .java:803) FT.filters.EncodingFilter.doFilter(Unknown Source) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs. Apache Tomcat/6.0.14


Qualcuno ha idea di quale possa essere il problema?

grazie in anticipo