ok this is new step since Tomcat 8

because the diff with Tomcat 7, it's this map
"contextObjectToContextVersionMap".

But in the web Listener, the method "requestInitialized" propose one
instance of ServletContext and this found getRequestDispatcher.

This method has not been used for any Tomcat 8 because getRequestDispatcher
always return an exception ...

If this is not a bug , it may be more preferable
put a wrapper and returns to the call of getRequestDispatcher an
UnsupportedOperationException , for example ...

thank you again for your help

2015-02-19 21:40 GMT+01:00 Christopher Schultz <ch...@christopherschultz.net
>:

> Marco,
>
> On 2/19/15 3:38 PM, Marco Semiao wrote:
> > Thank you for your answer and sorry for putting the wrong mailing list ;)
>
> Actually, after re-reading your post I think you were right to post to
> dev@. Please see below.
>
> > 2015-02-19 20:22 GMT+01:00 Christopher Schultz <
> ch...@christopherschultz.net
> >> :
> >
> > Marco,
> >
> > This is probably a question better asked on the user mailing list. I'm
> > cross-posting to both lists, and I'll give more feedback on the user
> list.
> >
> > -chris
> >
> > On 2/19/15 11:25 AM, Marco Semiao wrote:
> >>>> I use on my application a web listener ( ServletContextListener )
> >>>> that allows you to compile jsp at startup .
> >>>>
> >>>> It does not work on Tomcat 8 in call :
> >>>> servletContext.getRequestDispatcher ( path);
> >>>>
> >>>> Here is the stack :
> >>>>
> >>>> org.apache.catalina.core.ApplicationContext.log Error during
> >>>> mapping java.lang.NullPointerException at
> >>>> org.apache.catalina.mapper.Mapper.internalMapWrapper(Mapper.java:842)
> >>>>
> >>>>
> > at org.apache.catalina.mapper.Mapper.map(Mapper.java:712)
> >>>> at
> >>>>
> >
> org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:503)
> >>>>
> >>>>
> > at
> >>>>
> >
> org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:221)
> >>>>
> >>>>
> > at
> >>>>
> >
> fr.ms.tomcat.servlet.listener.JspCompileRunnable.run(JspCompileRunnable.java:25)
> >>>>
> >>>>
> > This is occurs when the map contextObjectToContextVersionMap is still
> null.
> >>>>
> >>>> It is enriched at the end of the boot StandardServer so after
> >>>> initializing listeners .
> >>>>
> >>>> Thread [main] (Suspended (breakpoint at line 265 in Mapper)) owns:
> >>>> MapperListener  (id=456) owns: StandardService  (id=457) owns:
> >>>> Object  (id=458) owns: StandardServer  (id=459)
> >>>> Mapper.addContextVersion(String, Host, String, String, Context,
> >>>> String[], WebResourceRoot, Collection<WrapperMappingInfo>) line:
> >>>> 265 MapperListener.registerContext(Context) line: 380
> >>>> MapperListener.registerHost(Host) line: 302
> >>>> MapperListener.startInternal() line: 110
> >>>> MapperListener(LifecycleBase).start() line: 150
> >>>> StandardService.startInternal() line: 450
> >>>> StandardService(LifecycleBase).start() line: 150
> >>>> StandardServer.startInternal() line: 769
> >>>> StandardServer(LifecycleBase).start() line: 150 Catalina.start()
> >>>> line: 625 NativeMethodAccessorImpl.invoke0(Method, Object,
> >>>> Object[]) line: not available [native method]
> >>>> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
> >>>> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
> >>>> Method.invoke(Object, Object...) line: 606 Bootstrap.start() line:
> >>>> 351 Bootstrap.main(String[]) line: 485
> >>>>
> >>>>
> >>>>
> >>>> it works fine with tomcat 5, 6 and 7.
> >>>>
> >>>>
> >>>> Environnement : apache- tomcat- 8.0.15 or apache -tomcat- 8.0.18
> >>>> Windows 8.1 Java 7 update 75
>
> It certainly seems like this should work, but I can understand why the
> Mapper doesn't actually map the context until it's completely started
> up: otherwise, requests could come in before the application was ready.
>
> -chris
>
>

Reply via email to