webserver: tomcat
web framework: spring3
I use gson-2.3.1
follow error log
java.lang.ClassNotFoundException: com.mysite.chart.**ChartCtrl$2**
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
**at com.mysite.chart.ChartCtrl.msyData(ChartCtrl.java:278)**
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
and ChartCtrl 278 line is follow
Type objType = new TypeToken<ArrayList<HashMap<String, Object>>>(){}.getType();
How can I solve this problem.
I also faced this issue, in my case I was importing the wrong class which somehow was available in the classpath for IDE but not on runtime.
Replace the below one:
import com.google.common.reflect.TypeToken;
With this one:
import com.google.gson.reflect.TypeToken;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With