You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thusitha Thilina Dayaratne <th...@wso2.com> on 2015/03/16 10:26:57 UTC

java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Hi All,

I'm in the process of migrating embedded tomcat application from Tomcat 7
to Tomcat 8.
When I'm trying to start the embedded instance I'm getting a
NullPointerException
Here is the stacktrace

>
> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>  Servlet.service() for servlet bridgeservlet threw exception
> java.lang.NullPointerException
> at
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> at
> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
> at
> org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
> at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:570)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:155)
> at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
> at
> org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:30)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.forward(ContextPathServletAdaptor.java:362)
> at
> org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
> at
> org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
> at
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
> at
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
> at org.wso2.carbon.ui.action.ActionHelper.render(ActionHelper.java:52)
> at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:101)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
> at
> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
> at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
> at
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Thread.java:745)


I can't figure out the reason to get this NullPointerException.
Can someone help me out?

Thanks
Best Regards
Thusitha
-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
Hi,

I manually set the TldCache in my context and get rid of the
NullPointerException. But now I'm getting following exception

org.apache.jasper.JasperException: The absolute uri:
> http://tiles.apache.org/tags-tiles cannot be resolved in either web.xml
> or the jar files deployed with this application
> at
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
> at
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:277)
> at
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:75)
> at
> org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:240)
> at
> org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:124)
> at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:411)
> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> at
> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
> at
> org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
> at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:570)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at org.wso2.carbon.ui.JspServlet.service(JspServlet.java:175)
> at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:80)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:64)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
> at
> org.eclipse.equinox.http.servlet.internal.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:30)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor$RequestDispatcherAdaptor.forward(ContextPathServletAdaptor.java:362)
> at
> org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:198)
> at
> org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
> at
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
> at
> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
> at org.wso2.carbon.ui.action.ActionHelper.render(ActionHelper.java:52)
> at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:101)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
> at
> org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:64)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
> at
> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
> at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
> at
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Thread.java:745)


I'm having a custom JarScanner as well. Is this relate to the JarScanner?
Can someone help me out?

Thanks
regards
/Thusitha

On Tue, Mar 17, 2015 at 7:11 PM, Thusitha Thilina Dayaratne <
thusithad@wso2.com> wrote:

> 2015-03-17 15:16 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
> >:
> >
> > Hi
> > >
> > > Hi Violeta
> > >
> > > Hi,
> > >
> > > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
> thusithad@wso2.com
> > >:
> > > >
> > > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > > >>> java.lang.NullPointerException
> > > > >>> at
> > > > >>>
> > > > >
> > > >
> > >
> >
>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > > >>> at
> > > > >
> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > > >>> at
> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > > >>> at
> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > > >
> > > > > <snip/>
> > > > >
> > > > >>>> I can't figure out the reason to get this NullPointerException.
> > > > >>>> Can someone help me out?
> > > > >
> > > > >>> If we knew which version of Tomcat 8 you were using, someone
> could
> > > look
> > > > >>> at the relevant source code to try to figure out what was going
> on.
> > > > > I'm using tomcat version *8.0.20*
> > > >
> > > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > > >
> > > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > > >>     }
> > > > Thanks for the quick response
> > > >
> > > > >> Obviously either getOptions() or getTldCache() is returning null.
> > > >
> > > > I debug the code as you suggest and found that getTldCache() is null.
> > > > In the code As I understand there are 2 point which set the
> *tldCache*
> > > >  variable
> > > > one is the setTldCache() method and other is
> > > > public static TldCache getInstance(ServletContext servletContext) {
> > > >
> > > >     if (servletContext == null) {
> > > >         throw new IllegalArgumentException(Localizer.getMessage(
> > > >
> > > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > > >     }
> > > >     return (TldCache)
> > > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > > }
> > >
> > >
> > >
> > > >>If you can attach a debugger try to see whether the code below is
> > invoked:
> > >
> > > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > > >>ServletContext) {
> > > >>.....
> > > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > > >>                new TldCache(context,
> > scanner.getUriTldResourcePathMap(),
> > > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > > >>
> > > >>}
> > > I have checked that as well. But that method didn't get hot when I'm
> > > debugging the source.
> > > what could be the reason?
> >
> > >You wrote that you are running an embedded Tomcat. Is that true?
> > >In Tomcat 8, Jasper initialization is implemented as a standard
> > >ServletContainderInitializer (check Servlet specification).
> > >So you should ensure
> > >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> > >during web app startup
> >
> > Could someone tell me how can I make sure that this method get call
> during
> > the web app startup?
>
> >You didn't tell us whether you are embedding Tomcat or not.
> Thanks for response and I'm Sorry for missing the info in previous mail.
> Yes I'm embedding tomcat version 8.0.20
>
> >If you are embedding it which jar files from Tomcat distribution you are
> >using etc.
> I'm using following tomcat jars
>
>    - tomcat-embed-core
>    - tomcat-embed-jasper
>    - tomcat-websocket-api
>    - tomcat-embed-websocket
>    - tomcat-jasper
>
>
> >You can start debugging
> >with org.apache.catalina.startup.ContextConfig.webConfig()
>
> >- processServletContainerInitializers(sContext);
>
> Thanks
> Regards
> Thusitha
>
> On Tue, Mar 17, 2015 at 6:56 PM, Violeta Georgieva <mi...@gmail.com>
> wrote:
>
>> Hi,
>>
>> 2015-03-17 15:16 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
>> >:
>> >
>> > Hi
>> > >
>> > > Hi Violeta
>> > >
>> > > Hi,
>> > >
>> > > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
>> thusithad@wso2.com
>> > >:
>> > > >
>> > > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>> > > > >>> Servlet.service() for servlet bridgeservlet threw exception
>> > > > >>> java.lang.NullPointerException
>> > > > >>> at
>> > > > >>>
>> > > > >
>> > > >
>> > >
>> >
>>
>> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>> > > > >>> at
>> > > > >
>> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>> > > > >>> at
>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>> > > > >>> at
>> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>> > > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
>> > > > >
>> > > > > <snip/>
>> > > > >
>> > > > >>>> I can't figure out the reason to get this NullPointerException.
>> > > > >>>> Can someone help me out?
>> > > > >
>> > > > >>> If we knew which version of Tomcat 8 you were using, someone
>> could
>> > > look
>> > > > >>> at the relevant source code to try to figure out what was going
>> on.
>> > > > > I'm using tomcat version *8.0.20*
>> > > >
>> > > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
>> > > >
>> > > > >>     public TldResourcePath getTldResourcePath(String uri) {
>> > > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
>> > > > >>     }
>> > > > Thanks for the quick response
>> > > >
>> > > > >> Obviously either getOptions() or getTldCache() is returning null.
>> > > >
>> > > > I debug the code as you suggest and found that getTldCache() is
>> null.
>> > > > In the code As I understand there are 2 point which set the
>> *tldCache*
>> > > >  variable
>> > > > one is the setTldCache() method and other is
>> > > > public static TldCache getInstance(ServletContext servletContext) {
>> > > >
>> > > >     if (servletContext == null) {
>> > > >         throw new IllegalArgumentException(Localizer.getMessage(
>> > > >
>> > > "org.apache.jasper.compiler.TldCache.servletContextNull"));
>> > > >     }
>> > > >     return (TldCache)
>> > > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
>> > > > }
>> > >
>> > >
>> > >
>> > > >>If you can attach a debugger try to see whether the code below is
>> > invoked:
>> > >
>> > > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
>> > > >>ServletContext) {
>> > > >>.....
>> > > >>
>> context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
>> > > >>                new TldCache(context,
>> > scanner.getUriTldResourcePathMap(),
>> > > >>                        scanner.getTldResourcePathTaglibXmlMap()));
>> > > >>
>> > > >>}
>> > > I have checked that as well. But that method didn't get hot when I'm
>> > > debugging the source.
>> > > what could be the reason?
>> >
>> > >You wrote that you are running an embedded Tomcat. Is that true?
>> > >In Tomcat 8, Jasper initialization is implemented as a standard
>> > >ServletContainderInitializer (check Servlet specification).
>> > >So you should ensure
>> > >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
>> > >during web app startup
>> >
>> > Could someone tell me how can I make sure that this method get call
>> during
>> > the web app startup?
>>
>> You didn't tell us whether you are embedding Tomcat or not.
>> If you are embedding it which jar files from Tomcat distribution you are
>> using etc.
>> You can start debugging
>> with org.apache.catalina.startup.ContextConfig.webConfig()
>>
>> - processServletContainerInitializers(sContext);
>>
>> Regards,
>> Violeta
>>
>> >
>> > Best Regards
>> > Thusitha
>> >
>>
>
>
>
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog      alokayasoya.blogspot.com
> About    http://about.me/thusithathilina
>
>


-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
2015-03-17 15:16 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> Hi
> >
> > Hi Violeta
> >
> > Hi,
> >
> > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
thusithad@wso2.com
> >:
> > >
> > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > >>> java.lang.NullPointerException
> > > >>> at
> > > >>>
> > > >
> > >
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > >>> at
> > > >
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > >>> at
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > >>> at
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > >
> > > > <snip/>
> > > >
> > > >>>> I can't figure out the reason to get this NullPointerException.
> > > >>>> Can someone help me out?
> > > >
> > > >>> If we knew which version of Tomcat 8 you were using, someone could
> > look
> > > >>> at the relevant source code to try to figure out what was going
on.
> > > > I'm using tomcat version *8.0.20*
> > >
> > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > >
> > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > >>     }
> > > Thanks for the quick response
> > >
> > > >> Obviously either getOptions() or getTldCache() is returning null.
> > >
> > > I debug the code as you suggest and found that getTldCache() is null.
> > > In the code As I understand there are 2 point which set the *tldCache*
> > >  variable
> > > one is the setTldCache() method and other is
> > > public static TldCache getInstance(ServletContext servletContext) {
> > >
> > >     if (servletContext == null) {
> > >         throw new IllegalArgumentException(Localizer.getMessage(
> > >
> > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > >     }
> > >     return (TldCache)
> > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > }
> >
> >
> >
> > >>If you can attach a debugger try to see whether the code below is
> invoked:
> >
> > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > >>ServletContext) {
> > >>.....
> > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > >>                new TldCache(context,
> scanner.getUriTldResourcePathMap(),
> > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > >>
> > >>}
> > I have checked that as well. But that method didn't get hot when I'm
> > debugging the source.
> > what could be the reason?
>
> >You wrote that you are running an embedded Tomcat. Is that true?
> >In Tomcat 8, Jasper initialization is implemented as a standard
> >ServletContainderInitializer (check Servlet specification).
> >So you should ensure
> >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> >during web app startup
>
> Could someone tell me how can I make sure that this method get call during
> the web app startup?

>You didn't tell us whether you are embedding Tomcat or not.
Thanks for response and I'm Sorry for missing the info in previous mail.
Yes I'm embedding tomcat version 8.0.20

>If you are embedding it which jar files from Tomcat distribution you are
>using etc.
I'm using following tomcat jars

   - tomcat-embed-core
   - tomcat-embed-jasper
   - tomcat-websocket-api
   - tomcat-embed-websocket
   - tomcat-jasper


>You can start debugging
>with org.apache.catalina.startup.ContextConfig.webConfig()

>- processServletContainerInitializers(sContext);

Thanks
Regards
Thusitha

On Tue, Mar 17, 2015 at 6:56 PM, Violeta Georgieva <mi...@gmail.com>
wrote:

> Hi,
>
> 2015-03-17 15:16 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
> >:
> >
> > Hi
> > >
> > > Hi Violeta
> > >
> > > Hi,
> > >
> > > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
> thusithad@wso2.com
> > >:
> > > >
> > > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > > >>> java.lang.NullPointerException
> > > > >>> at
> > > > >>>
> > > > >
> > > >
> > >
> >
>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > > >>> at
> > > > >
> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > > >>> at
> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > > >>> at
> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > > >
> > > > > <snip/>
> > > > >
> > > > >>>> I can't figure out the reason to get this NullPointerException.
> > > > >>>> Can someone help me out?
> > > > >
> > > > >>> If we knew which version of Tomcat 8 you were using, someone
> could
> > > look
> > > > >>> at the relevant source code to try to figure out what was going
> on.
> > > > > I'm using tomcat version *8.0.20*
> > > >
> > > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > > >
> > > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > > >>     }
> > > > Thanks for the quick response
> > > >
> > > > >> Obviously either getOptions() or getTldCache() is returning null.
> > > >
> > > > I debug the code as you suggest and found that getTldCache() is null.
> > > > In the code As I understand there are 2 point which set the
> *tldCache*
> > > >  variable
> > > > one is the setTldCache() method and other is
> > > > public static TldCache getInstance(ServletContext servletContext) {
> > > >
> > > >     if (servletContext == null) {
> > > >         throw new IllegalArgumentException(Localizer.getMessage(
> > > >
> > > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > > >     }
> > > >     return (TldCache)
> > > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > > }
> > >
> > >
> > >
> > > >>If you can attach a debugger try to see whether the code below is
> > invoked:
> > >
> > > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > > >>ServletContext) {
> > > >>.....
> > > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > > >>                new TldCache(context,
> > scanner.getUriTldResourcePathMap(),
> > > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > > >>
> > > >>}
> > > I have checked that as well. But that method didn't get hot when I'm
> > > debugging the source.
> > > what could be the reason?
> >
> > >You wrote that you are running an embedded Tomcat. Is that true?
> > >In Tomcat 8, Jasper initialization is implemented as a standard
> > >ServletContainderInitializer (check Servlet specification).
> > >So you should ensure
> > >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> > >during web app startup
> >
> > Could someone tell me how can I make sure that this method get call
> during
> > the web app startup?
>
> You didn't tell us whether you are embedding Tomcat or not.
> If you are embedding it which jar files from Tomcat distribution you are
> using etc.
> You can start debugging
> with org.apache.catalina.startup.ContextConfig.webConfig()
>
> - processServletContainerInitializers(sContext);
>
> Regards,
> Violeta
>
> >
> > Best Regards
> > Thusitha
> >
>



-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Violeta Georgieva <mi...@gmail.com>.
Hi,

2015-03-17 15:16 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> Hi
> >
> > Hi Violeta
> >
> > Hi,
> >
> > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
thusithad@wso2.com
> >:
> > >
> > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > >>> java.lang.NullPointerException
> > > >>> at
> > > >>>
> > > >
> > >
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > >>> at
> > > >
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > >>> at
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > >>> at
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > >
> > > > <snip/>
> > > >
> > > >>>> I can't figure out the reason to get this NullPointerException.
> > > >>>> Can someone help me out?
> > > >
> > > >>> If we knew which version of Tomcat 8 you were using, someone could
> > look
> > > >>> at the relevant source code to try to figure out what was going
on.
> > > > I'm using tomcat version *8.0.20*
> > >
> > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > >
> > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > >>     }
> > > Thanks for the quick response
> > >
> > > >> Obviously either getOptions() or getTldCache() is returning null.
> > >
> > > I debug the code as you suggest and found that getTldCache() is null.
> > > In the code As I understand there are 2 point which set the *tldCache*
> > >  variable
> > > one is the setTldCache() method and other is
> > > public static TldCache getInstance(ServletContext servletContext) {
> > >
> > >     if (servletContext == null) {
> > >         throw new IllegalArgumentException(Localizer.getMessage(
> > >
> > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > >     }
> > >     return (TldCache)
> > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > }
> >
> >
> >
> > >>If you can attach a debugger try to see whether the code below is
> invoked:
> >
> > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > >>ServletContext) {
> > >>.....
> > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > >>                new TldCache(context,
> scanner.getUriTldResourcePathMap(),
> > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > >>
> > >>}
> > I have checked that as well. But that method didn't get hot when I'm
> > debugging the source.
> > what could be the reason?
>
> >You wrote that you are running an embedded Tomcat. Is that true?
> >In Tomcat 8, Jasper initialization is implemented as a standard
> >ServletContainderInitializer (check Servlet specification).
> >So you should ensure
> >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> >during web app startup
>
> Could someone tell me how can I make sure that this method get call during
> the web app startup?

You didn't tell us whether you are embedding Tomcat or not.
If you are embedding it which jar files from Tomcat distribution you are
using etc.
You can start debugging
with org.apache.catalina.startup.ContextConfig.webConfig()

- processServletContainerInitializers(sContext);

Regards,
Violeta

>
> Best Regards
> Thusitha
>

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
Hi
>
> Hi Violeta
>
> Hi,
>
> 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
>:
> >
> > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > >>> Servlet.service() for servlet bridgeservlet threw exception
> > >>> java.lang.NullPointerException
> > >>> at
> > >>>
> > >
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > >>> at
> > >
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > >
> > > <snip/>
> > >
> > >>>> I can't figure out the reason to get this NullPointerException.
> > >>>> Can someone help me out?
> > >
> > >>> If we knew which version of Tomcat 8 you were using, someone could
> look
> > >>> at the relevant source code to try to figure out what was going on.
> > > I'm using tomcat version *8.0.20*
> >
> > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> >
> > >>     public TldResourcePath getTldResourcePath(String uri) {
> > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > >>     }
> > Thanks for the quick response
> >
> > >> Obviously either getOptions() or getTldCache() is returning null.
> >
> > I debug the code as you suggest and found that getTldCache() is null.
> > In the code As I understand there are 2 point which set the *tldCache*
> >  variable
> > one is the setTldCache() method and other is
> > public static TldCache getInstance(ServletContext servletContext) {
> >
> >     if (servletContext == null) {
> >         throw new IllegalArgumentException(Localizer.getMessage(
> >
> "org.apache.jasper.compiler.TldCache.servletContextNull"));
> >     }
> >     return (TldCache)
> > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > }
>
>
>
> >>If you can attach a debugger try to see whether the code below is
invoked:
>
> >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> >>ServletContext) {
> >>.....
> >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> >>                new TldCache(context,
scanner.getUriTldResourcePathMap(),
> >>                        scanner.getTldResourcePathTaglibXmlMap()));
> >>
> >>}
> I have checked that as well. But that method didn't get hot when I'm
> debugging the source.
> what could be the reason?

>You wrote that you are running an embedded Tomcat. Is that true?
>In Tomcat 8, Jasper initialization is implemented as a standard
>ServletContainderInitializer (check Servlet specification).
>So you should ensure
>that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
>during web app startup

Could someone tell me how can I make sure that this method get call during
the web app startup?

Best Regards
Thusitha

On Tue, Mar 17, 2015 at 9:37 AM, Thusitha Thilina Dayaratne <
thusithad@wso2.com> wrote:

> Hi Violeta,
>
> 2015-03-16 15:33 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
> >:
> >
> > Hi Violeta
> >
> > Hi,
> >
> > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
> thusithad@wso2.com
> >:
> > >
> > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > >>> java.lang.NullPointerException
> > > >>> at
> > > >>>
> > > >
> > >
> >
>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > >>> at
> > > >
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > >>> at
> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > >>> at
> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > >
> > > > <snip/>
> > > >
> > > >>>> I can't figure out the reason to get this NullPointerException.
> > > >>>> Can someone help me out?
> > > >
> > > >>> If we knew which version of Tomcat 8 you were using, someone could
> > look
> > > >>> at the relevant source code to try to figure out what was going on.
> > > > I'm using tomcat version *8.0.20*
> > >
> > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > >
> > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > >>     }
> > > Thanks for the quick response
> > >
> > > >> Obviously either getOptions() or getTldCache() is returning null.
> > >
> > > I debug the code as you suggest and found that getTldCache() is null.
> > > In the code As I understand there are 2 point which set the *tldCache*
> > >  variable
> > > one is the setTldCache() method and other is
> > > public static TldCache getInstance(ServletContext servletContext) {
> > >
> > >     if (servletContext == null) {
> > >         throw new IllegalArgumentException(Localizer.getMessage(
> > >
> > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > >     }
> > >     return (TldCache)
> > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > }
> >
> >
> >
> > >>If you can attach a debugger try to see whether the code below is
> invoked:
> >
> > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > >>ServletContext) {
> > >>.....
> > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > >>                new TldCache(context,
> scanner.getUriTldResourcePathMap(),
> > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > >>
> > >>}
> > I have checked that as well. But that method didn't get hot when I'm
> > debugging the source.
> > what could be the reason?
>
> >You wrote that you are running an embedded Tomcat. Is that true?
> >In Tomcat 8, Jasper initialization is implemented as a standard
> >ServletContainderInitializer (check Servlet specification).
> >So you should ensure
> >that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> >during web app startup
> Thanks for the quick response. Could you please tell me how can I do so?
>
> Thanks
> Best Regards
> /Thusitha
>
> On Mon, Mar 16, 2015 at 7:22 PM, Violeta Georgieva <mi...@gmail.com>
> wrote:
>
>> Hi,
>>
>>
>> 2015-03-16 15:33 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
>> >:
>> >
>> > Hi Violeta
>> >
>> > Hi,
>> >
>> > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
>> thusithad@wso2.com
>> >:
>> > >
>> > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>> > > >>> Servlet.service() for servlet bridgeservlet threw exception
>> > > >>> java.lang.NullPointerException
>> > > >>> at
>> > > >>>
>> > > >
>> > >
>> >
>>
>> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>> > > >>> at
>> > > >
>> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>> > > >>> at
>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>> > > >>> at
>> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>> > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
>> > > >
>> > > > <snip/>
>> > > >
>> > > >>>> I can't figure out the reason to get this NullPointerException.
>> > > >>>> Can someone help me out?
>> > > >
>> > > >>> If we knew which version of Tomcat 8 you were using, someone could
>> > look
>> > > >>> at the relevant source code to try to figure out what was going
>> on.
>> > > > I'm using tomcat version *8.0.20*
>> > >
>> > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
>> > >
>> > > >>     public TldResourcePath getTldResourcePath(String uri) {
>> > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
>> > > >>     }
>> > > Thanks for the quick response
>> > >
>> > > >> Obviously either getOptions() or getTldCache() is returning null.
>> > >
>> > > I debug the code as you suggest and found that getTldCache() is null.
>> > > In the code As I understand there are 2 point which set the *tldCache*
>> > >  variable
>> > > one is the setTldCache() method and other is
>> > > public static TldCache getInstance(ServletContext servletContext) {
>> > >
>> > >     if (servletContext == null) {
>> > >         throw new IllegalArgumentException(Localizer.getMessage(
>> > >
>> > "org.apache.jasper.compiler.TldCache.servletContextNull"));
>> > >     }
>> > >     return (TldCache)
>> > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
>> > > }
>> >
>> >
>> >
>> > >>If you can attach a debugger try to see whether the code below is
>> invoked:
>> >
>> > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
>> > >>ServletContext) {
>> > >>.....
>> > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
>> > >>                new TldCache(context,
>> scanner.getUriTldResourcePathMap(),
>> > >>                        scanner.getTldResourcePathTaglibXmlMap()));
>> > >>
>> > >>}
>> > I have checked that as well. But that method didn't get hot when I'm
>> > debugging the source.
>> > what could be the reason?
>>
>> You wrote that you are running an embedded Tomcat. Is that true?
>> In Tomcat 8, Jasper initialization is implemented as a standard
>> ServletContainderInitializer (check Servlet specification).
>> So you should ensure
>> that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
>> during web app startup.
>>
>> Regards,
>> Violeta
>>
>> > Thanks
>> > Regards
>> > Thusitha
>> >
>> >
>>
>
>
>
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog      alokayasoya.blogspot.com
> About    http://about.me/thusithathilina
>
>


-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
Hi Violeta,

2015-03-16 15:33 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> Hi Violeta
>
> Hi,
>
> 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
>:
> >
> > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > >>> Servlet.service() for servlet bridgeservlet threw exception
> > >>> java.lang.NullPointerException
> > >>> at
> > >>>
> > >
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > >>> at
> > >
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > >
> > > <snip/>
> > >
> > >>>> I can't figure out the reason to get this NullPointerException.
> > >>>> Can someone help me out?
> > >
> > >>> If we knew which version of Tomcat 8 you were using, someone could
> look
> > >>> at the relevant source code to try to figure out what was going on.
> > > I'm using tomcat version *8.0.20*
> >
> > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> >
> > >>     public TldResourcePath getTldResourcePath(String uri) {
> > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > >>     }
> > Thanks for the quick response
> >
> > >> Obviously either getOptions() or getTldCache() is returning null.
> >
> > I debug the code as you suggest and found that getTldCache() is null.
> > In the code As I understand there are 2 point which set the *tldCache*
> >  variable
> > one is the setTldCache() method and other is
> > public static TldCache getInstance(ServletContext servletContext) {
> >
> >     if (servletContext == null) {
> >         throw new IllegalArgumentException(Localizer.getMessage(
> >
> "org.apache.jasper.compiler.TldCache.servletContextNull"));
> >     }
> >     return (TldCache)
> > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > }
>
>
>
> >>If you can attach a debugger try to see whether the code below is
invoked:
>
> >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> >>ServletContext) {
> >>.....
> >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> >>                new TldCache(context,
scanner.getUriTldResourcePathMap(),
> >>                        scanner.getTldResourcePathTaglibXmlMap()));
> >>
> >>}
> I have checked that as well. But that method didn't get hot when I'm
> debugging the source.
> what could be the reason?

>You wrote that you are running an embedded Tomcat. Is that true?
>In Tomcat 8, Jasper initialization is implemented as a standard
>ServletContainderInitializer (check Servlet specification).
>So you should ensure
>that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
>during web app startup
Thanks for the quick response. Could you please tell me how can I do so?

Thanks
Best Regards
/Thusitha

On Mon, Mar 16, 2015 at 7:22 PM, Violeta Georgieva <mi...@gmail.com>
wrote:

> Hi,
>
>
> 2015-03-16 15:33 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
> >:
> >
> > Hi Violeta
> >
> > Hi,
> >
> > 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <
> thusithad@wso2.com
> >:
> > >
> > > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > > >>> Servlet.service() for servlet bridgeservlet threw exception
> > > >>> java.lang.NullPointerException
> > > >>> at
> > > >>>
> > > >
> > >
> >
>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > > >>> at
> > > >
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > > >>> at
> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > > >>> at
> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > > >
> > > > <snip/>
> > > >
> > > >>>> I can't figure out the reason to get this NullPointerException.
> > > >>>> Can someone help me out?
> > > >
> > > >>> If we knew which version of Tomcat 8 you were using, someone could
> > look
> > > >>> at the relevant source code to try to figure out what was going on.
> > > > I'm using tomcat version *8.0.20*
> > >
> > > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> > >
> > > >>     public TldResourcePath getTldResourcePath(String uri) {
> > > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > > >>     }
> > > Thanks for the quick response
> > >
> > > >> Obviously either getOptions() or getTldCache() is returning null.
> > >
> > > I debug the code as you suggest and found that getTldCache() is null.
> > > In the code As I understand there are 2 point which set the *tldCache*
> > >  variable
> > > one is the setTldCache() method and other is
> > > public static TldCache getInstance(ServletContext servletContext) {
> > >
> > >     if (servletContext == null) {
> > >         throw new IllegalArgumentException(Localizer.getMessage(
> > >
> > "org.apache.jasper.compiler.TldCache.servletContextNull"));
> > >     }
> > >     return (TldCache)
> > > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > > }
> >
> >
> >
> > >>If you can attach a debugger try to see whether the code below is
> invoked:
> >
> > >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> > >>ServletContext) {
> > >>.....
> > >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> > >>                new TldCache(context,
> scanner.getUriTldResourcePathMap(),
> > >>                        scanner.getTldResourcePathTaglibXmlMap()));
> > >>
> > >>}
> > I have checked that as well. But that method didn't get hot when I'm
> > debugging the source.
> > what could be the reason?
>
> You wrote that you are running an embedded Tomcat. Is that true?
> In Tomcat 8, Jasper initialization is implemented as a standard
> ServletContainderInitializer (check Servlet specification).
> So you should ensure
> that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
> during web app startup.
>
> Regards,
> Violeta
>
> > Thanks
> > Regards
> > Thusitha
> >
> >
>



-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Violeta Georgieva <mi...@gmail.com>.
Hi,


2015-03-16 15:33 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> Hi Violeta
>
> Hi,
>
> 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
>:
> >
> > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > >>> Servlet.service() for servlet bridgeservlet threw exception
> > >>> java.lang.NullPointerException
> > >>> at
> > >>>
> > >
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > >>> at
> > >
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > >
> > > <snip/>
> > >
> > >>>> I can't figure out the reason to get this NullPointerException.
> > >>>> Can someone help me out?
> > >
> > >>> If we knew which version of Tomcat 8 you were using, someone could
> look
> > >>> at the relevant source code to try to figure out what was going on.
> > > I'm using tomcat version *8.0.20*
> >
> > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> >
> > >>     public TldResourcePath getTldResourcePath(String uri) {
> > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > >>     }
> > Thanks for the quick response
> >
> > >> Obviously either getOptions() or getTldCache() is returning null.
> >
> > I debug the code as you suggest and found that getTldCache() is null.
> > In the code As I understand there are 2 point which set the *tldCache*
> >  variable
> > one is the setTldCache() method and other is
> > public static TldCache getInstance(ServletContext servletContext) {
> >
> >     if (servletContext == null) {
> >         throw new IllegalArgumentException(Localizer.getMessage(
> >
> "org.apache.jasper.compiler.TldCache.servletContextNull"));
> >     }
> >     return (TldCache)
> > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > }
>
>
>
> >>If you can attach a debugger try to see whether the code below is
invoked:
>
> >>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> >>ServletContext) {
> >>.....
> >>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
> >>                new TldCache(context,
scanner.getUriTldResourcePathMap(),
> >>                        scanner.getTldResourcePathTaglibXmlMap()));
> >>
> >>}
> I have checked that as well. But that method didn't get hot when I'm
> debugging the source.
> what could be the reason?

You wrote that you are running an embedded Tomcat. Is that true?
In Tomcat 8, Jasper initialization is implemented as a standard
ServletContainderInitializer (check Servlet specification).
So you should ensure
that org.apache.jasper.servlet.JasperInitializer.onStartup is invoked
during web app startup.

Regards,
Violeta

> Thanks
> Regards
> Thusitha
>
>

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
Hi Violeta

Hi,

2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> >>> Servlet.service() for servlet bridgeservlet threw exception
> >>> java.lang.NullPointerException
> >>> at
> >>>
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> >>> at
> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> >
> > <snip/>
> >
> >>>> I can't figure out the reason to get this NullPointerException.
> >>>> Can someone help me out?
> >
> >>> If we knew which version of Tomcat 8 you were using, someone could
look
> >>> at the relevant source code to try to figure out what was going on.
> > I'm using tomcat version *8.0.20*
>
> >>Browse to the sourcecode of v8.0.20 of tomcat here:
>
> >>     public TldResourcePath getTldResourcePath(String uri) {
> >>     return getOptions().getTldCache().getTldResourcePath(uri);
> >>     }
> Thanks for the quick response
>
> >> Obviously either getOptions() or getTldCache() is returning null.
>
> I debug the code as you suggest and found that getTldCache() is null.
> In the code As I understand there are 2 point which set the *tldCache*
>  variable
> one is the setTldCache() method and other is
> public static TldCache getInstance(ServletContext servletContext) {
>
>     if (servletContext == null) {
>         throw new IllegalArgumentException(Localizer.getMessage(
>
"org.apache.jasper.compiler.TldCache.servletContextNull"));
>     }
>     return (TldCache)
> servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> }



>>If you can attach a debugger try to see whether the code below is invoked:

>>org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
>>ServletContext) {
>>.....
>>        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
>>                new TldCache(context, scanner.getUriTldResourcePathMap(),
>>                        scanner.getTldResourcePathTaglibXmlMap()));
>>
>>}
I have checked that as well. But that method didn't get hot when I'm
debugging the source.
what could be the reason?

Thanks
Regards
Thusitha


On Mon, Mar 16, 2015 at 6:59 PM, Violeta Georgieva <mi...@gmail.com>
wrote:

> Hi,
>
> 2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <thusithad@wso2.com
> >:
> >
> > >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> > >>> Servlet.service() for servlet bridgeservlet threw exception
> > >>> java.lang.NullPointerException
> > >>> at
> > >>>
> > >
> >
>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> > >>> at
> > > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> > >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> > >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> > >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> > >
> > > <snip/>
> > >
> > >>>> I can't figure out the reason to get this NullPointerException.
> > >>>> Can someone help me out?
> > >
> > >>> If we knew which version of Tomcat 8 you were using, someone could
> look
> > >>> at the relevant source code to try to figure out what was going on.
> > > I'm using tomcat version *8.0.20*
> >
> > >>Browse to the sourcecode of v8.0.20 of tomcat here:
> >
> > >>     public TldResourcePath getTldResourcePath(String uri) {
> > >>     return getOptions().getTldCache().getTldResourcePath(uri);
> > >>     }
> > Thanks for the quick response
> >
> > >> Obviously either getOptions() or getTldCache() is returning null.
> >
> > I debug the code as you suggest and found that getTldCache() is null.
> > In the code As I understand there are 2 point which set the *tldCache*
> >  variable
> > one is the setTldCache() method and other is
> > public static TldCache getInstance(ServletContext servletContext) {
> >
> >     if (servletContext == null) {
> >         throw new IllegalArgumentException(Localizer.getMessage(
> >
> "org.apache.jasper.compiler.TldCache.servletContextNull"));
> >     }
> >     return (TldCache)
> > servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> > }
>
>
>
> If you can attach a debugger try to see whether the code below is invoked:
>
> org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
> ServletContext) {
> .....
>         context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
>                 new TldCache(context, scanner.getUriTldResourcePathMap(),
>                         scanner.getTldResourcePathTaglibXmlMap()));
>
> }
>
>
> Regards,
> Violeta
>
> >
> >  from this 2 methods I couldn't find any point that setTldCache() is been
> > used. So I think getInstance() is the method that is been used.
> >
> > Should I manually set the value o tldCache?
> >
> > Thanks
> > Regards
> > /Thusitha
>



-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Violeta Georgieva <mi...@gmail.com>.
Hi,

2015-03-16 15:07 GMT+02:00 Thusitha Thilina Dayaratne <th...@wso2.com>:
>
> >>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> >>> Servlet.service() for servlet bridgeservlet threw exception
> >>> java.lang.NullPointerException
> >>> at
> >>>
> >
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> >>> at
> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> >>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> >>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> >>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> >
> > <snip/>
> >
> >>>> I can't figure out the reason to get this NullPointerException.
> >>>> Can someone help me out?
> >
> >>> If we knew which version of Tomcat 8 you were using, someone could
look
> >>> at the relevant source code to try to figure out what was going on.
> > I'm using tomcat version *8.0.20*
>
> >>Browse to the sourcecode of v8.0.20 of tomcat here:
>
> >>     public TldResourcePath getTldResourcePath(String uri) {
> >>     return getOptions().getTldCache().getTldResourcePath(uri);
> >>     }
> Thanks for the quick response
>
> >> Obviously either getOptions() or getTldCache() is returning null.
>
> I debug the code as you suggest and found that getTldCache() is null.
> In the code As I understand there are 2 point which set the *tldCache*
>  variable
> one is the setTldCache() method and other is
> public static TldCache getInstance(ServletContext servletContext) {
>
>     if (servletContext == null) {
>         throw new IllegalArgumentException(Localizer.getMessage(
>
"org.apache.jasper.compiler.TldCache.servletContextNull"));
>     }
>     return (TldCache)
> servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
> }



If you can attach a debugger try to see whether the code below is invoked:

org.apache.jasper.servlet.JasperInitializer.onStartup(Set<Class<?>>,
ServletContext) {
.....
        context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME,
                new TldCache(context, scanner.getUriTldResourcePathMap(),
                        scanner.getTldResourcePathTaglibXmlMap()));

}


Regards,
Violeta

>
>  from this 2 methods I couldn't find any point that setTldCache() is been
> used. So I think getInstance() is the method that is been used.
>
> Should I manually set the value o tldCache?
>
> Thanks
> Regards
> /Thusitha

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
>>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>>> Servlet.service() for servlet bridgeservlet threw exception
>>> java.lang.NullPointerException
>>> at
>>>
>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>>> at
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
>
> <snip/>
>
>>>> I can't figure out the reason to get this NullPointerException.
>>>> Can someone help me out?
>
>>> If we knew which version of Tomcat 8 you were using, someone could look
>>> at the relevant source code to try to figure out what was going on.
> I'm using tomcat version *8.0.20*

>>Browse to the sourcecode of v8.0.20 of tomcat here:

>>     public TldResourcePath getTldResourcePath(String uri) {
>>     return getOptions().getTldCache().getTldResourcePath(uri);
>>     }
Thanks for the quick response

>> Obviously either getOptions() or getTldCache() is returning null.

I debug the code as you suggest and found that getTldCache() is null.
In the code As I understand there are 2 point which set the *tldCache*
 variable
one is the setTldCache() method and other is
public static TldCache getInstance(ServletContext servletContext) {

    if (servletContext == null) {
        throw new IllegalArgumentException(Localizer.getMessage(
                "org.apache.jasper.compiler.TldCache.servletContextNull"));
    }
    return (TldCache)
servletContext.getAttribute(SERVLET_CONTEXT_ATTRIBUTE_NAME);
}

 from this 2 methods I couldn't find any point that setTldCache() is been
used. So I think getInstance() is the method that is been used.

Should I manually set the value o tldCache?

Thanks
Regards
/Thusitha

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Graham Leggett <mi...@sharp.fm>.
On 16 Mar 2015, at 11:48 AM, Thusitha Thilina Dayaratne <th...@wso2.com> wrote:

>>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>>> Servlet.service() for servlet bridgeservlet threw exception
>>> java.lang.NullPointerException
>>> at
>>> 
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>>> at
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
> 
> <snip/>
> 
>>>> I can't figure out the reason to get this NullPointerException.
>>>> Can someone help me out?
> 
>>> If we knew which version of Tomcat 8 you were using, someone could look
>>> at the relevant source code to try to figure out what was going on.
> I'm using tomcat version *8.0.20*

Browse to the sourcecode of v8.0.20 of tomcat here:

https://svn.apache.org/viewvc/tomcat/tc8.0.x/tags/TOMCAT_8_0_20/java/org/apache/jasper/JspCompilationContext.java?view=markup

The lines you want look like this:

535	public TldResourcePath getTldResourcePath(String uri) {
536	return getOptions().getTldCache().getTldResourcePath(uri); 
537	}

Obviously either getOptions() or getTldCache() is returning null.

Reverse engineer the source to find out which, or stop the code in a debugger.

Regards,
Graham
—


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


Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Thusitha Thilina Dayaratne <th...@wso2.com>.
On 16/03/2015 09:26, Thusitha Thilina Dayaratne wrote:
> Hi All,
>
> I'm in the process of migrating embedded tomcat application from Tomcat 7
> to Tomcat 8.
> When I'm trying to start the embedded instance I'm getting a
> NullPointerException
> Here is the stacktrace
>
>>
>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>>  Servlet.service() for servlet bridgeservlet threw exception
>> java.lang.NullPointerException
>> at
>>
org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>> at
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)

<snip/>

>>> I can't figure out the reason to get this NullPointerException.
>>> Can someone help me out?

>> If we knew which version of Tomcat 8 you were using, someone could look
>> at the relevant source code to try to figure out what was going on.
I'm using tomcat version *8.0.20*

Thanks
Thusitha

On Mon, Mar 16, 2015 at 3:07 PM, Mark Thomas <ma...@apache.org> wrote:

> On 16/03/2015 09:26, Thusitha Thilina Dayaratne wrote:
> > Hi All,
> >
> > I'm in the process of migrating embedded tomcat application from Tomcat 7
> > to Tomcat 8.
> > When I'm trying to start the embedded instance I'm getting a
> > NullPointerException
> > Here is the stacktrace
> >
> >>
> >> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
> >>  Servlet.service() for servlet bridgeservlet threw exception
> >> java.lang.NullPointerException
> >> at
> >>
> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
> >> at
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
> >> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
> >> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
> >> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
>
> <snip/>
>
> > I can't figure out the reason to get this NullPointerException.
> > Can someone help me out?
>
> If we knew which version of Tomcat 8 you were using, someone could look
> at the relevant source code to try to figure out what was going on.
>
> Hint: Tomcat is open source. You can look at the source code too.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thusitha Dayaratne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

Mobile  +94712756809
Blog      alokayasoya.blogspot.com
About    http://about.me/thusithathilina

Re: java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536) when starting Embedded Tomcat Instance

Posted by Mark Thomas <ma...@apache.org>.
On 16/03/2015 09:26, Thusitha Thilina Dayaratne wrote:
> Hi All,
> 
> I'm in the process of migrating embedded tomcat application from Tomcat 7
> to Tomcat 8.
> When I'm trying to start the embedded instance I'm getting a
> NullPointerException
> Here is the stacktrace
> 
>>
>> ERROR {org.apache.catalina.core.ApplicationDispatcher} -
>>  Servlet.service() for servlet bridgeservlet threw exception
>> java.lang.NullPointerException
>> at
>> org.apache.jasper.JspCompilationContext.getTldResourcePath(JspCompilationContext.java:536)
>> at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
>> at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:469)
>> at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
>> at org.apache.jasper.compiler.Parser.parse(Parser.java:139)

<snip/>

> I can't figure out the reason to get this NullPointerException.
> Can someone help me out?

If we knew which version of Tomcat 8 you were using, someone could look
at the relevant source code to try to figure out what was going on.

Hint: Tomcat is open source. You can look at the source code too.

Mark


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