Re: [google-appengine] NoClassDefFoundError (org.eclipse.core.runtime.Platform)

2015-03-12 Thread Vinny P
On Thu, Mar 5, 2015 at 11:06 AM, Syed Rizvi  wrote:

>
> Error for /cron/loadDataset
> java.lang.NoClassDefFoundError: Could not initialize class
> org.eclipse.core.runtime.Platform
> As you can see in the Platform.class.PNG screenshot, the class is present
> (At least at compile time. I don't know how it vanishes at runtime?), The
> dependencies are downloaded from the public Maven repo.
> All these Maven dependencies including the external JAR are packaged with
> the WAR file (as seen in Dependencies.PNG). Where could the problem lie? I
> have spent days but still cannot find where the problem exists
>



I'm curious to see what is actually on App Engine servers. I'd try
uploading your application, then downloading it again using appcfg:
https://cloud.google.com/appengine/docs/java/tools/uploadinganapp#Downloading_an_Application
. As the sample in the link shows, you should also get back a printed list
of the files and directory structure.

The problem is that there might be a deeper issue here. Your stack trace
shows that the exception message comes from Platform. A
NoClassDefFoundError can also pop from errors in statically-initialized
code, and unfortunately Platform has exactly that:
http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.7/org.eclipse.core/runtime/3.7.0/org/eclipse/core/runtime/Platform.java
. It looks like part of the static code
calls org.eclipse.core.internal.runtime.Messages which (within static)
calls org.eclipse.osgi.util.NLS.initializeMessages which makes some calls
requiring privileged actions

-
meaning that GAE's SecurityManager would have to allow the calls, and I'm
not sure if those calls run properly due to the GAE sandbox - you'd have to
ask a Googler to investigate.

Happily enough, there's a shortcut instead of drilling through mountains of
code to debug: try moving your application to use Managed VMs
. If this really
is a SecurityManager issue, the more-permissive Managed VM instance should
be able to run the code perfectly fine.



-
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CALSvALBBRkgELSRkYADsFwjmAD8bUF7J_9RjHg%2BgXQ0OjUQoYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] NoClassDefFoundError (org.eclipse.core.runtime.Platform)

2015-03-05 Thread Syed Rizvi
Hi,
I am making a maven based GAE project. It's a service that is supposed to 
serve some data to its clients. The project works perfectly on the local 
machine, but gives the NoClassDefFoundError when deployed to GAE. Here's 
the complete StackTrace:

Error for /cron/loadDataset
java.lang.NoClassDefFoundError: Could not initialize class 
org.eclipse.core.runtime.Platform at 
org.eclipse.ocl.common.OCLCommon.getPreference(OCLCommon.java:74 

) at org.eclipse.ocl.lpg.AbstractBasicEnvironment.getValue(
AbstractBasicEnvironment.java:440 

) at org.eclipse.ocl.options.ParsingOptions.getValue(ParsingOptions.java:330 

) at org.eclipse.ocl.AbstractEnvironment.createTypeChecker(
AbstractEnvironment.java:1214 

) at org.eclipse.ocl.AbstractEnvironment.getTypeChecker(
AbstractEnvironment.java:1196 

) at org.eclipse.ocl.AbstractEnvironment.getAdapter(
AbstractEnvironment.java:1236 

) at org.eclipse.ocl.util.OCLUtil.getAdapter(OCLUtil.java:102 

) at org.eclipse.ocl.util.TypeUtil.getTypeCheckerAdapter(TypeUtil.java:800 

) at org.eclipse.ocl.util.TypeUtil.findAttribute(TypeUtil.java:171 

) at org.eclipse.ocl.AbstractEnvironment.doLookupProperty(
AbstractEnvironment.java:657 

) at org.eclipse.ocl.AbstractEnvironment.lookupProperty(
AbstractEnvironment.java:638 

) at org.eclipse.ocl.AbstractTypeResolver.findTupleType(
AbstractTypeResolver.java:430 

) at org.eclipse.ocl.AbstractTypeResolver.resolveTupleType(
AbstractTypeResolver.java:382 

) at org.eclipse.ocl.AbstractTypeResolver$ResolveSwitch.caseTupleType(
AbstractTypeResolver.java:1008 

) at org.eclipse.ocl.types.util.TypesSwitch.doSwitch(TypesSwitch.java:267 

) at org.eclipse.ocl.types.util.T