Rick,

On 4/15/24 11:29, Rick Noel wrote:
The complete trace.........

java.lang.reflect.InvocationTargetException
         at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
         at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
         at com.radiovoodoo.display.EvalExpr.evalIdentifier(EvalExpr.java:317)
         at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:57)
         at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:30)
         at com.radiovoodoo.display.Expr.evaluate(Expr.java:370)
         at com.radiovoodoo.display.PropertyTag.evaluate(PropertyTag.java:102)
         at com.radiovoodoo.display.PropertyTag.doStartTag(PropertyTag.java:55)
         at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspx_meth_ww_005fproperty_005f5(contest_005fschedule_005fedit_jsp.java:6193)
         at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspService(contest_005fschedule_005fedit_jsp.java:1299)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
         at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456)
         at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
         at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)

The compiler is working. Whatever RadioVoodoo is is causing this error. I can see that the JSP compiler has finished because the call stack includes org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspService which means your services/system/contesting/contest-schedule-edit.jsp has been compiled successfully.

RadioVoodoo appears to be a JSP tag library and I'm guessing that it's being invoked to perform some kind of expression evaluation and THAT is failing.

You might need to reach out to the RadioVoodoo people to find out what's happening...

Caused by: java.lang.NullPointerException: Cannot invoke 
"java.util.TimeZone.getDisplayName()" because "this.customerTimeZone" is null
         at 
com.radiovoodoo.action.station.ContestManager.getCustomerTimeZoneDisplayName(ContestManager.java:1195)
         ... 51 more

Well, that tells you what is really happening: you have a null reference and you are trying to make a call on it. RadioVoodoo is allowing you to try to invoke a method on a null reference and getting an NPE for its trouble. The rest of the details are below:

Apr 15, 2024 11:26:51 AM com.radiovoodoo.util.Log log
SEVERE:
         Exception:  java.lang.NullPointerException: Cannot invoke 
"java.util.TimeZone.getDisplayName()" because "this.customerTimeZone" is null
         Stack Trace follows:
         java.lang.NullPointerException: Cannot invoke 
"java.util.TimeZone.getDisplayName()" because "this.customerTimeZone" is null
         at 
com.radiovoodoo.action.station.ContestManager.getCustomerTimeZoneDisplayName(ContestManager.java:1195)
         at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
         at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
         at com.radiovoodoo.display.EvalExpr.evalIdentifier(EvalExpr.java:317)
         at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:57)
         at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:30)
         at com.radiovoodoo.display.Expr.evaluate(Expr.java:370)
         at com.radiovoodoo.display.PropertyTag.evaluate(PropertyTag.java:102)
         at com.radiovoodoo.display.PropertyTag.doStartTag(PropertyTag.java:55)
         at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspx_meth_ww_005fproperty_005f5(contest_005fschedule_005fedit_jsp.java:6193)
         at 
org.apache.jsp.services.system.contesting.contest_005fschedule_005fedit_jsp._jspService(contest_005fschedule_005fedit_jsp.java:1299)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
         at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:456)
         at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
         at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
         at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
         at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:653)
         at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:419)
         at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:340)
         at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:277)
         at 
com.radiovoodoo.action.ServletDispatcher.service(ServletDispatcher.java:177)
         at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
         at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
         at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175)
         at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150)
         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
         at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
         at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
         at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
         at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
         at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
         at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)

-chris

-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Monday, April 15, 2024 11:09 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: .intermittent InvocationTargetException errors

Rick,

On 4/15/24 10:04, Rick Noel wrote:
Hello,

I am using Tomcat 10 with java 17.

I am getting itermitant jsp compile errors below.

Some times the page compiles correctly but sometimes the page hits result in 
below errors............

java.lang.reflect.InvocationTargetException
          at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at com.radiovoodoo.display.EvalExpr.evalIdentifier(EvalExpr.java:317)
          at com.radiovoodoo.display.EvalExpr.eval(EvalExpr.java:57)

What is RadioVoodoo?

Is there more of the stack trace?

I found this explanation for possible cause..........
Normally "java.lang.reflect.InvocationTargetException" occurs when java 
compiler finds 2 different classes with same name in 2 different packages.
When you are importing both classes at a time and when you are trying to create object of 
that class it throws "java.lang.reflect.InvocationTargetException" exception .
The solution is that when you are creating the object of the class use package 
name also along with class name so that compiler knows what class it has to use.

This is unlikely to be the explanation. I've never seen InvocationTargetException under 
the conditions described. The compiler should never allow you to import two classes with 
the same "simple"
(without package) name, because it's impossible for it to then tell which one 
you mean in a given expression.

I looked at my code in the jsp and the code in question could be mistaking for 
two different classes.
My code is meant to use  java.util.Timezone but my code also has a
com.radiovoodoo.customer.Timezone class

What do your imports look like?

So I thought ah ah will specifical declare the class the I want, so I
changed From private TimeZone customerTimeZone; to private
java.util.TimeZone customerTimeZone;

so that the compiler will not think to use
com.radiovoodoo.customer.Timezone but instead always use java.util.TimeZone But 
this had no effect.

What do your imports look like?

I still get intermittent java.lang.reflect.InvocationTargetException
Could this be a possible bug in   the class tomcat 10 uses to compile jsp   ->  
        org.apache.jasper.servlet.JspServlet

It's possible, but not very likely. We have a pretty good set of unit tests, 
plus we aren't getting any reports from others that the compiler is failing in 
this way.

Is there a different JspServlet class I could use to test that theory out?

I'm curious as to why RadioVoodoo is being invoked during compilation.
Or is this happening during JSP execution, post-compile? A more complete stack 
trace would reveal that.

-chris

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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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


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

Reply via email to