1

Ok I have to rewrite my question after further investigation.

I run into below problem in my GWT/GAE project :

java.lang.RuntimeException: Class com.google.appengine.tools.development.agent.runtime.Runtime$21 can not access a member of class com.ibm.icu.text.CollatorServiceShim with modifiers ""
    at com.ibm.icu.text.Collator.getShim(Collator.java:456)
    at com.ibm.icu.text.Collator.getInstance(Collator.java:478)
    at com.google.visualization.datasource.datatable.value.TextValue$1.<init>(TextValue.java:126)
    at com.google.visualization.datasource.datatable.value.TextValue.getTextLocalizedComparator(TextValue.java:125)
    at com.google.visualization.datasource.datatable.value.Value$1.<init>(Value.java:141)
    at com.google.visualization.datasource.datatable.value.Value.getLocalizedComparator(Value.java:140)
    at com.google.visualization.datasource.query.engine.TableRowComparator.<init>(TableRowComparator.java:66)
    at com.google.visualization.datasource.query.engine.QueryEngine.performSort(QueryEngine.java:234)
    at com.google.visualization.datasource.query.engine.QueryEngine.executeQuery(QueryEngine.java:128)
    at com.google.visualization.datasource.DataSourceHelper.applyQuery(DataSourceHelper.java:410)
    at com.klawt.server.resources.chart.InvoicesChartServerResource.retrieve(InvoicesChartServerResource.java:129)

Some more investigation revealed that gwt-dev.jar contains a copy of the icu library :

public abstract class com.ibm.icu.text.Collator implements java.util.Comparator, com.ibm.icu.util.Freezable

is part of gwt-dev.jar

My project has a dependency on icu4j 4.0.1 (for the Google Visualization Datasource library). But GAE SDK insists on using the version included in gwt-dev.jar;

I guess there must a way to setup my development environment so this kinda works, it did before.

I have tried moving GWT SDK to the bottom in the 'Order and export' tab of my build path and the icu jar to the top, but no luck.

enter image description here

koma
  • 6,486
  • 2
  • 27
  • 53
  • I'm not sure I understand: is this server-side code? Is your icu4j JAR in `WEB-INF/lib`? What if you also remove it from the DevMode classpath? – Thomas Broyer Jul 28 '13 at 10:35
  • @ThomasBroyer yes, this is server-side code. the appengine devserver picks up the icu version in gwt-dev.jar, not the one from the icu-4.0.1.jar but the appengine security sandbox prohibits the use of these classes somehow. What do you mean remove from DevMode classpath ? remove gwt-dev.jar ? then DevMode wont work anymore, right ? – koma Jul 28 '13 at 13:54
  • @ThomasBroyer removing icu-4.0.1.jar gives java.lang.ClassNotFoundException: com.ibm.icu.util.GregorianCalendar, so that's not an option :-( Also tried keeping icu-4.0.1.jar in the lib folder but without adding it in the eclipse build path, no luck. – koma Jul 28 '13 at 14:47
  • @ThomasBroyer added a picture that shows how i figured it takes the wrong jar, because clicking the offending class in the stack trace shows that the line number is invalid for the gwt-dev.jar; – koma Jul 28 '13 at 14:54
  • If it's server-side code, there's no need to have it in the classpath when launching DevMode, it should just live in `WEB-INF/lib` and/or `WEB-INF/classes`. – Thomas Broyer Jul 28 '13 at 17:12
  • gwt-dev.jar is not in either WEB-INF/lib or WEB-INF/classes; it is part of the GWT SDK container which is included in my classpath but external to my workspace (btw, many thanks for helping out !!) – koma Jul 28 '13 at 18:18
  • Sorry if I wasn't clear; let's try this way: gwt-dev.jar is akin to Tomcat, Jetty, Glasfish, etc., it's in the classpath of what you launch; icu4j.jar is part of your webapp, it doesn't need to be in the classpath when launching the DevMode, it has to be in the webapp's `WEB-INF/lib`. The 2 JARs should be in different classloaders and shouldn't conflict with each others. – Thomas Broyer Jul 28 '13 at 21:45
  • I understand that, but a default eclipse GWT project will include the GWT SDK on the classpath. AFAIK this will ALSO make gwt-dev.jar available to the classloader of the actual webapp, apart from acting as the servlet container (main function DevMode); – koma Jul 29 '13 at 11:28
  • The "outer classloader" is only used as a fallback in the webapp (with a warning that the class was found outside the webapp's classloader), so it shouldn't be a problem: the webapp uses ICU from the icu4j JAR in `WEB-INF/lib`, DevMode uses ICU from the `gwt-dev.jar` (doesn't see the icu4j JAR if it's not in the classpath). – Thomas Broyer Jul 29 '13 at 14:44
  • It shouldn't be a problem, but it is. the webapp **insists** on using the version from `gwt-dev.jar` and this causes my problem with GAE. Question remaining: why, oh why ? I am trying to dig some deeper... – koma Jul 29 '13 at 17:16
  • I'm sorry but I can't reproduce it (using Maven, but that's the same gwt-dev and DevMode); calling `new com.ibm.icu.util.GregorianCalendar().getType()` and `com.ibm.icu.text.Collator.getInstance().getDecomposition()`, with and without icu4j-4.0.1.jar in the classpath (before and after gwt-dev.jar), but always in `WEB-INF/lib`. So is your icu4j-4.0.1.jar correctly in `war/WEB-INF/lib` (and not `war/lib` as you typed in the title, for example); note that Eclipse will always search classes in the build path only, so that's not the way to _debug_ the situation. – Thomas Broyer Jul 29 '13 at 19:13
  • thx for testing. if I figure out the prob, I will post back here (the title is a typo, it is of course `war/WEB-INF/lib`). prodution is not a problem, only DevMode. – koma Jul 29 '13 at 19:53
  • Switching from OpenJDK to Oracle JDK fix it !! [It is not the first time][1] I ran into this :-/ [1]: http://stackoverflow.com/questions/10034900/appengine-devmode-access-denied-java-lang-runtimepermission-accessclassinp – koma Nov 09 '13 at 15:59

1 Answers1

0

Switching from OpenJDK to Oracle JDK fixes it !! It is not the first time I ran into issues with OpenJDK !

Community
  • 1
  • 1
koma
  • 6,486
  • 2
  • 27
  • 53