java.lang.Exception' threw an unexpected exception: java.lang.NoClassDefFoundError: com/ibm/icu/text/SimpleDateFormat

3,342 views
Skip to first unread message

Davide Micheletti

unread,
Feb 7, 2014, 10:56:30 AM2/7/14
to google-we...@googlegroups.com
Like title i've these error in run-mode on a tomcat server..
I've found some solution googling it but i don't want to import any .jar lib if it possible.
So, what can i do?

Thanks

Davide..

Thomas Broyer

unread,
Feb 7, 2014, 11:30:45 AM2/7/14
to google-we...@googlegroups.com
What's the stacktrace? Which class/method are you using that causes that error?

Davide Micheletti

unread,
Feb 7, 2014, 11:34:45 AM2/7/14
to google-we...@googlegroups.com
SimpleDateFormat however here the log:

org.apache.catalina.core.ApplicationContext.log Exception while dispatching incoming RPC call
 com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.pannelli.controllo.shared.Ciclo_Produzione com.pannelli.controllo.client.GreetingService.SQL_fasi_ciclo_per_tipologia(int,java.lang.String) throws java.lang.Exception' threw an unexpected exception: java.lang.NoClassDefFoundError: com/ibm/icu/text/SimpleDateFormat
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:76)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:515)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1012)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:642)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1555)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/ibm/icu/text/SimpleDateFormat
at com.pannelli.controllo.server.GreetingServiceImpl.SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
... 26 more
Caused by: java.lang.ClassNotFoundException: com.ibm.icu.text.SimpleDateFormat
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1575)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1420)
... 32 more


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Thomas Broyer

unread,
Feb 7, 2014, 11:57:31 AM2/7/14
to google-we...@googlegroups.com
If you do use SimpleDateFormat from ICU (com.ibm.icu.text.SimpleDateFormat, as opposed to java.text.SimpleDateFormat), then you have to ship it within your WAR.

Out of curiosity, what's at com.pannelli.controllo.server.GreetingServiceImpl.SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707) ?
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.

Davide Micheletti

unread,
Feb 7, 2014, 12:25:44 PM2/7/14
to google-we...@googlegroups.com
com.pannelli.controllo.server.GreetingServiceImpl.SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707) 
com.pannelli.controllo.server is the package of the server
GreetingServiceImpl is the java class for the server
SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707)  is a function on the server who start at line 707

However i have to change only the library?? 




To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

Jens

unread,
Feb 7, 2014, 1:07:48 PM2/7/14
to google-we...@googlegroups.com
com.pannelli.controllo.server.GreetingServiceImpl.SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707) 
com.pannelli.controllo.server is the package of the server
GreetingServiceImpl is the java class for the server
SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:707)  is a function on the server who start at line 707

:)) Thomas meant what source code is at that line 707.


I think you just have mistakenly chosen the wrong import of SimpleDateFormat. gwt-user.jar contains com.ibm.icu.text.SimpleDateFormat but gwt-user.jar will not be deployed on the server. I think you want to change the import to java.text.SimpleDateFormat in your server side class.

-- J.

Davide Micheletti

unread,
Feb 7, 2014, 1:55:12 PM2/7/14
to google-we...@googlegroups.com
ok thanks.. i'll try your solution.. However sorry for my stupid questions but i'm a newby on GWT and java.. ;) The source Code at line 707 is something like this:

SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
String data = "04/02/2014";
Date d = df.parse(data);
...


--

Davide Micheletti

unread,
Feb 7, 2014, 2:31:44 PM2/7/14
to google-we...@googlegroups.com
Ok now there is another error.. Now for CalendarUtil.addDaysToDate()  i think...

SOURCE CODE:

SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
Date end_date = formatter.parse(prima_data);
CalendarUtil.addDaysToDate(end_date, 5);
String ultima_data = formatter.format(end_date);


LOG:

com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.pannelli.controllo.shared.Ciclo_Produzione com.pannelli.controllo.client.GreetingService.SQL_fasi_ciclo_per_tipologia(int,java.lang.String) throws java.lang.Exception' threw an unexpected exception: java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
Caused by: java.lang.NoClassDefFoundError: com/google/gwt/core/client/GWTBridge
at com.google.gwt.user.datepicker.client.CalendarUtil.<clinit>(CalendarUtil.java:35)
at com.pannelli.controllo.server.GreetingServiceImpl.SQL_fasi_ciclo_per_tipologia(GreetingServiceImpl.java:709)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
... 26 more
Caused by: java.lang.ClassNotFoundException: com.google.gwt.core.client.GWTBridge
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1575)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1420)
... 33 more

Jens

unread,
Feb 7, 2014, 3:10:10 PM2/7/14
to google-we...@googlegroups.com
CalendarUtil is a GWT class that can not be used on the server. Use java.util.Calendar or JodaTime library.

You can avoid these issues by not blindly use classes available in Eclipse/IntelliJ. Only classes from jar files in war/WEB-INF/lib are available on the server.

--  J.

Davide Micheletti

unread,
Feb 7, 2014, 3:13:03 PM2/7/14
to google-we...@googlegroups.com
ok.. Thanks.. 


--

Davide Micheletti

unread,
Feb 10, 2014, 5:45:22 AM2/10/14
to google-we...@googlegroups.com
Solved!!!.. Thanks for help!
Reply all
Reply to author
Forward
0 new messages