You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Marco Semiao <ma...@gmail.com> on 2015/02/19 17:25:33 UTC

[Tomcat 8] [Listener Web] [RequestDispatcher]

Hello,

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


Thank you.

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Marco Semiao <ma...@gmail.com>.
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 <chris@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 <
> chris@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
>
>

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by 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 <chris@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


Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Marco Semiao <ma...@gmail.com>.
Hello Christopher,

Thank you for your answer and sorry for putting the wrong mailing list ;)

2015-02-19 20:22 GMT+01:00 Christopher Schultz <chris@christopherschultz.net
>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> 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
> >
> >
> > Thank you.
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU5jfqAAoJEBzwKT+lPKRYgYcP/3nIEDDxUvgsFn7nkyyGPmbP
> NEPbJc+a95V71X/8UHyYTbwB/rp5NOKaDU8KwJMzolZi03A8tRID9JX4irqRJhAR
> 7MpqCoAuW469zyxzUVlqRQK0rv9MB6PORZRZZ320yfFokWSapjoe7RC4sB/wTCXr
> J5BxSV7l0hJOwuHSi9lq417EdCxVxm9y/kCdasMBG0t8eB11oQQER8y78tuuUdJQ
> EaTiK8gxYyDeJstuep+tayLswmLHF6FFJxbzLoFxawPpSBpvjtZUGkNGtV1Wpu+C
> i1D/V3oHm/rAgLeHZlpH7Zcq43jr7w0ev2t5PxisO9Kz/SgB2jEZfw8t7DqYmD64
> 2oWhVxB1xOnB86+6QkhWDtQ0gdc3gsUUilbMdUNE1Me7oTkTJQkq09h7nARmdiIT
> 04w7mXJ55cC3YrKA0yncVYW0qRWBCfx5omNHhCU3OAaGXgrmLX4/ZoiKUK5zdK2s
> IdZmXUbrlIN186YDXWd/lkzoF/SmLtvBSEOuAGHTXLCepP0Y7u3RdX473wqm9zh+
> pmA4tHg1HJQuwkIonC7dwJ7fROsU4V0Zvy5wQ5pu1Gm+zOxNsQ88WnZlzCbY0cct
> e1PIgAkiFD6FiVtetvYfHPP3KMzNURN40OEkaBGY46NDUj9tPCe0tuZ8Yn8VEwXA
> pULqLLdBRINZF0NLa/Qh
> =rlyu
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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
> 
> 
> Thank you.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU5jfqAAoJEBzwKT+lPKRYgYcP/3nIEDDxUvgsFn7nkyyGPmbP
NEPbJc+a95V71X/8UHyYTbwB/rp5NOKaDU8KwJMzolZi03A8tRID9JX4irqRJhAR
7MpqCoAuW469zyxzUVlqRQK0rv9MB6PORZRZZ320yfFokWSapjoe7RC4sB/wTCXr
J5BxSV7l0hJOwuHSi9lq417EdCxVxm9y/kCdasMBG0t8eB11oQQER8y78tuuUdJQ
EaTiK8gxYyDeJstuep+tayLswmLHF6FFJxbzLoFxawPpSBpvjtZUGkNGtV1Wpu+C
i1D/V3oHm/rAgLeHZlpH7Zcq43jr7w0ev2t5PxisO9Kz/SgB2jEZfw8t7DqYmD64
2oWhVxB1xOnB86+6QkhWDtQ0gdc3gsUUilbMdUNE1Me7oTkTJQkq09h7nARmdiIT
04w7mXJ55cC3YrKA0yncVYW0qRWBCfx5omNHhCU3OAaGXgrmLX4/ZoiKUK5zdK2s
IdZmXUbrlIN186YDXWd/lkzoF/SmLtvBSEOuAGHTXLCepP0Y7u3RdX473wqm9zh+
pmA4tHg1HJQuwkIonC7dwJ7fROsU4V0Zvy5wQ5pu1Gm+zOxNsQ88WnZlzCbY0cct
e1PIgAkiFD6FiVtetvYfHPP3KMzNURN40OEkaBGY46NDUj9tPCe0tuZ8Yn8VEwXA
pULqLLdBRINZF0NLa/Qh
=rlyu
-----END PGP SIGNATURE-----

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


Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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
> 
> 
> Thank you.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU5jfqAAoJEBzwKT+lPKRYgYcP/3nIEDDxUvgsFn7nkyyGPmbP
NEPbJc+a95V71X/8UHyYTbwB/rp5NOKaDU8KwJMzolZi03A8tRID9JX4irqRJhAR
7MpqCoAuW469zyxzUVlqRQK0rv9MB6PORZRZZ320yfFokWSapjoe7RC4sB/wTCXr
J5BxSV7l0hJOwuHSi9lq417EdCxVxm9y/kCdasMBG0t8eB11oQQER8y78tuuUdJQ
EaTiK8gxYyDeJstuep+tayLswmLHF6FFJxbzLoFxawPpSBpvjtZUGkNGtV1Wpu+C
i1D/V3oHm/rAgLeHZlpH7Zcq43jr7w0ev2t5PxisO9Kz/SgB2jEZfw8t7DqYmD64
2oWhVxB1xOnB86+6QkhWDtQ0gdc3gsUUilbMdUNE1Me7oTkTJQkq09h7nARmdiIT
04w7mXJ55cC3YrKA0yncVYW0qRWBCfx5omNHhCU3OAaGXgrmLX4/ZoiKUK5zdK2s
IdZmXUbrlIN186YDXWd/lkzoF/SmLtvBSEOuAGHTXLCepP0Y7u3RdX473wqm9zh+
pmA4tHg1HJQuwkIonC7dwJ7fROsU4V0Zvy5wQ5pu1Gm+zOxNsQ88WnZlzCbY0cct
e1PIgAkiFD6FiVtetvYfHPP3KMzNURN40OEkaBGY46NDUj9tPCe0tuZ8Yn8VEwXA
pULqLLdBRINZF0NLa/Qh
=rlyu
-----END PGP SIGNATURE-----

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


Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Marco Semiao <ma...@gmail.com>.
2015-02-20 13:53 GMT+01:00 Marco Semiao <ma...@gmail.com>:

>
>
> 2015-02-20 13:45 GMT+01:00 Marco Semiao <ma...@gmail.com>:
>
>> Hello, I just use this app :
>>
>> http://pukkaone.github.io/2010/12/22/jsp-precompile-application-start.html
>>
>> it's works with tomcat 5,6,7 but not tomcat 8.
>>
>> Because before, it's possibel to invoque RequestDispatcher into Listener
>>
>> Now, call RequestDispatcher throw NPE because the Map is empty.
>>
>> 2015-02-20 13:35 GMT+01:00 Konstantin Kolinko <kn...@gmail.com>:
>>
>>> 2015-02-19 19:25 GMT+03:00 Marco Semiao <ma...@gmail.com>:
>>> > Hello,
>>> >
>>> > 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
>>> >
>>>
>>> 1. Mailing list rules:
>>> http://tomcat.apache.org/lists.html#tomcat-users
>>> -> 6. Do not top-post.
>>>
>>> 2. What event is your listener listening for?
>>>
>>> If I am understanding you correctly, you are trying to perform a
>>> request dispatch on a web application that has not started yet. This
>>> is not going to work. The application that has not completed its
>>> startup cannot serve requests.
>>>
>>> The NPE is ugly, an IllegalStateException would be better.
>>> From the API specification [1] it looks that the
>>> ServletContext.getRequestDispatcher() should return null in this
>>> situation, but I think that will be as confusing as the current NPE.
>>>
>>> If you want the NPE to be changed, it would better to prepare some
>>> source code that demonstrates the issue and open an issue in Bugzilla,
>>>  but at this point I think it is a cosmetic issue and fixing it
>>> wouldn't solve your problem.
>>>
>>> [1]
>>> http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRequestDispatcher%28java.lang.String%29
>>>
>>>
>>> Best regards,
>>> Konstantin Kolinko
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>>
>>
>
> Sorry really sorry for top post :(
>
>
> http://pukkaone.github.io/2010/12/22/jsp-precompile-application-start.html
>
> it's works with tomcat 5,6,7 but not tomcat 8.
>
> Because before, it's possibel to invoque RequestDispatcher into Listener
>
> Now, call RequestDispatcher throw NPE because the Map is empty.
>


Before the requestDispatcher is ready into Listener why this limitation
into Tomcat 8 ?

it wanted ?

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Marco Semiao <ma...@gmail.com>.
2015-02-20 13:45 GMT+01:00 Marco Semiao <ma...@gmail.com>:

> Hello, I just use this app :
>
> http://pukkaone.github.io/2010/12/22/jsp-precompile-application-start.html
>
> it's works with tomcat 5,6,7 but not tomcat 8.
>
> Because before, it's possibel to invoque RequestDispatcher into Listener
>
> Now, call RequestDispatcher throw NPE because the Map is empty.
>
> 2015-02-20 13:35 GMT+01:00 Konstantin Kolinko <kn...@gmail.com>:
>
>> 2015-02-19 19:25 GMT+03:00 Marco Semiao <ma...@gmail.com>:
>> > Hello,
>> >
>> > 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
>> >
>>
>> 1. Mailing list rules:
>> http://tomcat.apache.org/lists.html#tomcat-users
>> -> 6. Do not top-post.
>>
>> 2. What event is your listener listening for?
>>
>> If I am understanding you correctly, you are trying to perform a
>> request dispatch on a web application that has not started yet. This
>> is not going to work. The application that has not completed its
>> startup cannot serve requests.
>>
>> The NPE is ugly, an IllegalStateException would be better.
>> From the API specification [1] it looks that the
>> ServletContext.getRequestDispatcher() should return null in this
>> situation, but I think that will be as confusing as the current NPE.
>>
>> If you want the NPE to be changed, it would better to prepare some
>> source code that demonstrates the issue and open an issue in Bugzilla,
>>  but at this point I think it is a cosmetic issue and fixing it
>> wouldn't solve your problem.
>>
>> [1]
>> http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRequestDispatcher%28java.lang.String%29
>>
>>
>> Best regards,
>> Konstantin Kolinko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>

Sorry really sorry for top post :(


http://pukkaone.github.io/2010/12/22/jsp-precompile-application-start.html

it's works with tomcat 5,6,7 but not tomcat 8.

Because before, it's possibel to invoque RequestDispatcher into Listener

Now, call RequestDispatcher throw NPE because the Map is empty.

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Marco Semiao <ma...@gmail.com>.
Hello, I just use this app :

http://pukkaone.github.io/2010/12/22/jsp-precompile-application-start.html

it's works with tomcat 5,6,7 but not tomcat 8.

Because before, it's possibel to invoque RequestDispatcher into Listener

Now, call RequestDispatcher throw NPE because the Map is empty.

2015-02-20 13:35 GMT+01:00 Konstantin Kolinko <kn...@gmail.com>:

> 2015-02-19 19:25 GMT+03:00 Marco Semiao <ma...@gmail.com>:
> > Hello,
> >
> > 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
> >
>
> 1. Mailing list rules:
> http://tomcat.apache.org/lists.html#tomcat-users
> -> 6. Do not top-post.
>
> 2. What event is your listener listening for?
>
> If I am understanding you correctly, you are trying to perform a
> request dispatch on a web application that has not started yet. This
> is not going to work. The application that has not completed its
> startup cannot serve requests.
>
> The NPE is ugly, an IllegalStateException would be better.
> From the API specification [1] it looks that the
> ServletContext.getRequestDispatcher() should return null in this
> situation, but I think that will be as confusing as the current NPE.
>
> If you want the NPE to be changed, it would better to prepare some
> source code that demonstrates the issue and open an issue in Bugzilla,
>  but at this point I think it is a cosmetic issue and fixing it
> wouldn't solve your problem.
>
> [1]
> http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRequestDispatcher%28java.lang.String%29
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: [Tomcat 8] [Listener Web] [RequestDispatcher]

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-02-19 19:25 GMT+03:00 Marco Semiao <ma...@gmail.com>:
> Hello,
>
> 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
>

1. Mailing list rules:
http://tomcat.apache.org/lists.html#tomcat-users
-> 6. Do not top-post.

2. What event is your listener listening for?

If I am understanding you correctly, you are trying to perform a
request dispatch on a web application that has not started yet. This
is not going to work. The application that has not completed its
startup cannot serve requests.

The NPE is ugly, an IllegalStateException would be better.
>From the API specification [1] it looks that the
ServletContext.getRequestDispatcher() should return null in this
situation, but I think that will be as confusing as the current NPE.

If you want the NPE to be changed, it would better to prepare some
source code that demonstrates the issue and open an issue in Bugzilla,
 but at this point I think it is a cosmetic issue and fixing it
wouldn't solve your problem.

[1] http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRequestDispatcher%28java.lang.String%29


Best regards,
Konstantin Kolinko

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