You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Zaphod <Ra...@BVG.DE> on 2007/01/22 18:24:40 UTC

Tomcat 6.0.8 & JSF 1.2 RI

I try to use the JSF 1.2_03 RI with Tomcat 6.0.8.

I get a NullPointerException:
Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
	at org.apache.jsp.VDVRequest_jsp._jspInit(VDVRequest_jsp.java:25)
	at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:80)
	at
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:157)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
	at java.lang.Thread.run(Unknown Source)


in VDVRequest_jsp.java:
  public void _jspInit() {
    _005fjspx_005ftagPool_005ff_005fview =
org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _005fjspx_005ftagPool_005fh_005foutputText_005fvalue_005fnobody =
org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
[here is line no. 25:]
    _el_expressionfactory =
JspFactory.getDefaultFactory().getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor)
getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

I suppose JspFactory.getDefaultFactory() is null.
But why?
I suppose it is a configuration problem or a tomcat bug.

I have the jsf-api, jsf-impl and jstl JARs in my lib folder and I switched
verfication off.

Is there any workaround to initialize the JspFactory?


-- 
View this message in context: http://www.nabble.com/Tomcat-6.0.8---JSF-1.2-RI-tf3059080.html#a8505670
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.8 & JSF 1.2 RI

Posted by Jason Rasmussen <Ja...@datatrak.net>.
I found that with Tomcat 6.0.8, I didn't need to initialize the
JspRuntimeContext, however my ELResolver is never actually hit.  I placed
print outs in the constructor and all the overridden methods of my
ELResolver to determine if they were ever called.  Only the constructor is
ever called.

The following code is in the listener.  It runs, because I see the
constructor print out.

  public void contextInitialized(ServletContextEvent servletContextEvent) {
    ServletContext servletContext = servletContextEvent.getServletContext();
    JspFactory jspFactory = JspFactory.getDefaultFactory();
    JspApplicationContext jspApplicationContext =
jspFactory.getJspApplicationContext(servletContext);
    jspApplicationContext.addELResolver(new DCELResolver());
  }

When the pages are rendered, the getValue method and others are never
called.  I was certain to make sure no resolvers are in faces-confg.xml.  Is
there anything else that may cause the resolver stack to get recreated as
the default, and thus losing my resolver?


srowen wrote:
> 
> I am seeing the same problem, via a different route. Check this out -- it
> solves this specific problem for me:
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=39804
> 
> I made a simple listener which calls
> Class.forName("org.apache.jasper.compiler.JspRuntimeContext"); first
> 
> Sean
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-6.0.8---JSF-1.2-RI-tf3059080.html#a8699791
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.8 & JSF 1.2 RI

Posted by srowen <sr...@gmail.com>.
I am seeing the same problem, via a different route. Check this out -- it
solves this specific problem for me:

http://issues.apache.org/bugzilla/show_bug.cgi?id=39804

I made a simple listener which calls
Class.forName("org.apache.jasper.compiler.JspRuntimeContext"); first

Sean
-- 
View this message in context: http://www.nabble.com/Tomcat-6.0.8---JSF-1.2-RI-tf3059080.html#a8529370
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.8 & JSF 1.2 RI

Posted by Tim Funk <fu...@joedog.org>.
Check your server.xml - this should be in it - if not - then you will 
(sometimes) get the error as described below:

<Listener className="org.apache.catalina.core.JasperListener" />

-Tim

Zaphod wrote:
> I try to use the JSF 1.2_03 RI with Tomcat 6.0.8.
> 
> I get a NullPointerException:
> Servlet.service() for servlet jsp threw exception
> java.lang.NullPointerException
> 	at org.apache.jsp.VDVRequest_jsp._jspInit(VDVRequest_jsp.java:25)
> 	at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:80)
> 	at
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:157)

<SNIP>

> 
> in VDVRequest_jsp.java:
>   public void _jspInit() {
>     _005fjspx_005ftagPool_005ff_005fview =
> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
>     _005fjspx_005ftagPool_005fh_005foutputText_005fvalue_005fnobody =
> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
> [here is line no. 25:]
>     _el_expressionfactory =
> JspFactory.getDefaultFactory().getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
>     _jsp_annotationprocessor = (org.apache.AnnotationProcessor)
> getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
>   }
> 
> I suppose JspFactory.getDefaultFactory() is null.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.8 & JSF 1.2 RI

Posted by Zaphod <Ra...@BVG.DE>.
I found the reason a few days ago:
I overlooked that I had the jsp lib in 2 different locations, so they were
loaded in different classloaders.

Thanks to all replies.



martind1111 wrote:
> 
> I am able to use JSF 1.2_03 RI inside Tomcat 6.0.8. Ensure you have
> the JSTL 1.2 also loaded.
> 
> Martin
> 
> On 1/22/07, Zaphod <Ra...@bvg.de> wrote:
>>
>> I try to use the JSF 1.2_03 RI with Tomcat 6.0.8.
>>
>> I get a NullPointerException:
>> Servlet.service() for servlet jsp threw exception
>> java.lang.NullPointerException
>>         at org.apache.jsp.VDVRequest_jsp._jspInit(VDVRequest_jsp.java:25)
>>         at
>> org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:80)
>>         at
>> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:157)
>>         at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
>>         at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>>         at
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>         at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>         at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
>>         at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>>         at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>         at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>         at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>         at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
>>         at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>>         at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
>>         at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
>>         at java.lang.Thread.run(Unknown Source)
>>
>>
>> in VDVRequest_jsp.java:
>>   public void _jspInit() {
>>     _005fjspx_005ftagPool_005ff_005fview =
>> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
>>     _005fjspx_005ftagPool_005fh_005foutputText_005fvalue_005fnobody =
>> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
>> [here is line no. 25:]
>>     _el_expressionfactory =
>> JspFactory.getDefaultFactory().getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
>>     _jsp_annotationprocessor = (org.apache.AnnotationProcessor)
>> getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
>>   }
>>
>> I suppose JspFactory.getDefaultFactory() is null.
>> But why?
>> I suppose it is a configuration problem or a tomcat bug.
>>
>> I have the jsf-api, jsf-impl and jstl JARs in my lib folder and I
>> switched
>> verfication off.
>>
>> Is there any workaround to initialize the JspFactory?
>>
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-6.0.8---JSF-1.2-RI-tf3059080.html#a8691266
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6.0.8 & JSF 1.2 RI

Posted by Martin Dubuc <ma...@gmail.com>.
I am able to use JSF 1.2_03 RI inside Tomcat 6.0.8. Ensure you have
the JSTL 1.2 also loaded.

Martin

On 1/22/07, Zaphod <Ra...@bvg.de> wrote:
>
> I try to use the JSF 1.2_03 RI with Tomcat 6.0.8.
>
> I get a NullPointerException:
> Servlet.service() for servlet jsp threw exception
> java.lang.NullPointerException
>         at org.apache.jsp.VDVRequest_jsp._jspInit(VDVRequest_jsp.java:25)
>         at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:80)
>         at
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:157)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
>         at java.lang.Thread.run(Unknown Source)
>
>
> in VDVRequest_jsp.java:
>   public void _jspInit() {
>     _005fjspx_005ftagPool_005ff_005fview =
> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
>     _005fjspx_005ftagPool_005fh_005foutputText_005fvalue_005fnobody =
> org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
> [here is line no. 25:]
>     _el_expressionfactory =
> JspFactory.getDefaultFactory().getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
>     _jsp_annotationprocessor = (org.apache.AnnotationProcessor)
> getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
>   }
>
> I suppose JspFactory.getDefaultFactory() is null.
> But why?
> I suppose it is a configuration problem or a tomcat bug.
>
> I have the jsf-api, jsf-impl and jstl JARs in my lib folder and I switched
> verfication off.
>
> Is there any workaround to initialize the JspFactory?
>
>
> --
> View this message in context: http://www.nabble.com/Tomcat-6.0.8---JSF-1.2-RI-tf3059080.html#a8505670
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org