gwt-dev.jar conflicts with icu jar on war/lib classpath when using GAE - google-app-engine

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.

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

Related

ANDROID: java.util.MissingResourceException: Can't find resource for bundle 'org.eclipse.paho.client.mqttv3.internal.nls.logcat_en_US', key ''

There seems to be countless reports of this bug in Stack Overflow. None of the suggestions worked. In my case it is almost identical to this stack overflow report
SPRING
except this case is in Android being built in Android Studio. It only happens in release mode with proguard. Proguard corrupts it somehow. And yes I have done the following in proguard:
-keep class org.eclipse.paho.client.mqttv3.logging.JSR47Logger { *; }
-keep class org.eclipse.paho.** { *; }
I have also parsed the jars downloaded by gradle. I cannot update to 1.2.1 because that only works with the latest versions of Android ... according to comments made by the developers. If I could get the source code for 1.1.0 maybe I could stop it from calling a resource that does not exist.
Anyone solve this problem or is it a bug in proguard/paho?
Looking at the apks generated by release builds (uses proguard) and debug builds (no proguard) shows that proguard is taking the org.eclipse.... package name of the properties and changing the 'org' to some letter like 'c'. The mqtt paho client is looking for the property file using the full package name and therefore cannot find it, no matter what you include or exclude in proguard. I looked at an apk made a few months ago (I have not done anything with the paho client or that part of the code using the paho client ... it has worked fine and I have had no need to change it). I see in that old release apk that the 'org' is there as it should be.
So the problem is in proguard. All I could do to move forward is take the source files for 1.1.0, create a new java project module, and tediously comment out every 'log' and getLogger in the source code. Its a temporary and unpleasant fix but it works. When proguard (R8) fixes this, then I can go back to what I had.
So I guess the only real fix is to submit a bug to R8. That I have not done.

Error:Could not find method getCompileConfiguration() for arguments [] on object of type com.android.build.gradle.internal.api.ApplicationVariantImpl

I' am working on React Native technology and everything was working fine until yesterday and today when I opened react-native project in the android studio it gave me this error:
Error:Could not find method getCompileConfiguration() for arguments [] on object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.
Please help me out with the best solution to resolve this issue.
Thanks
I think this is due to com.google.gms:google-services released a new version that is not compatible with the gradle build tools, to fix it I changed android/build.gradle
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.+'
- classpath 'com.google.gms:google-services:3.+'
+ classpath 'com.android.tools.build:gradle:2.2.3'
+ classpath 'com.google.gms:google-services:3.2.1'
}
To use strict versions, as per the docs here

Gxt 3 Neptune Theme Setup Issue

I just installed GXT SDK 2.6 and created a new google web project.
added the following jars to the lib folder and to the build path
gxt-3.1.1.jar
gxt-theme-neptune.jar
but when i run my page on the browser i get the following error pls help.
[ERROR] [ia] - Errors in 'jar:file:/C:/Anant%20Choubey/Eclipse%20Workspace/GXT%20-%20IA%20-%2003Oct2014/IA/lib/gxt-theme-neptune.jar!/com/sencha/gxt/theme/neptune/client/base/Css3ThemeAppearance.java'
[ERROR] [ia] - Line 58: The method moreIcon() of type Css3ThemeAppearance must override or implement a supertype method
I have made no other changes elsewhere.
I think you have old version of theme plugin. Download new gxt-theme-neptune.jar-3.1.1 and try again.
Download link of gxt-theme-neptune.jar-3.1.1...

Extracting .docx files with Tika in Apache Solr gives NoSuchMethod error

I have a Solr 4.0 module in my project (basically, a maven web project with all the solr dependencies). It worked pretty well, including content extraction and everything.
But, when I tested it with a .docx document, It gives me the following error:
13:50:34,468 ERROR [org.apache.solr.servlet.SolrDispatchFilter] (http--0.0.0.0-8080-9)
null:java.lang.RuntimeException: java.lang.NoSuchMethodError:
org.apache.poi.openxml4j.opc.PackagePart.getRelatedPart(Lorg/apache/poi/openxml4j/opc/PackageRelationship;)
Lorg/apache/poi/openxml4j/opc/PackagePart;
I tried to manually add the openxml4j dependency to the project. I've downloaded the sources and looked at it, the PackagePart#getRelatedPart really doesn't exist.
What is this error? How can I fix this?
Thanks in advance.
EDIT
I noticed that poi-ooxml already had those classes inside it. Cool, but I also inspected those sources, and still doesn't have the needed method in the PackagePart class.
BTW: I tried to add openxml4j version 1.0-beta.
It was a jarhell related issue.
Thanks, "jarhell related" was the clue I needed!
My project had POI jars prior to import of the Tika app jar, which includes its own POI jars. I deleted the standalone POI jars, and then Tika was able to handle DOCX Word 2013 file without error.
Now hopefully I won't run into a situation where I need both! :|

jTwitter, oAuth, and Google App Engine. NoClassDefFoundError

I'm trying to use jTwitter to get an oauth instance to twitter with my consumer key/secret and access token/secret. This is well documented in the javadoc here. I have downloaded signpost, signpost-jetty, and the jtwitter library, but after deploying and running the servlet, I get a error java.lang.NoClassDefFoundError: winterwell/jtwitter/OAuthSignpostClient Eclipse isn't complaining about the class not being there, because it is there-- I can see it in the JAR file itself, which is in my project. So, I said forget it, I'll try out OAuthScribeClient instead, but this generated a VERY SIMILAR ERROR java.lang.NoClassDefFoundError: org/scribe/oauth/Token This one confuses me even further because I have the following code in my java file, and it compiles without error or warning:
import org.scribe.oauth.Token;
Token token = new Token("myaccesstokeninfo", "accesstokensecret");
Clearly, I'm missing something very fundamental, but I am at an absolute loss as to what it may be. Thanks.
Usually "NoClassDefFoundError" happens when you forget to copy all jar-files to your "/war/WEB-INF/lib" directory, so those libs will be unavailable from server-side.
Xo4yHaMope is probably right.
If you're working from Eclipse but running using a web container, then your runtime classpath might be different from your project classpath - which can cause this error.
In order to complete Ben Winters answer what I actually did and worked is add the jar in
the libs folder within the project
see also here about folder hierarchy.
When you do this eclipse will normally add the jar to the android dependencies before launching the application. What I realise is that adding a jar in the build path will make classes available only during the build

Resources