Google App Engine DataNucleus 3.1.1 Unexpected Exception Error - java

Trying to find a way to get rid of this error on eclipse.
DataNucleus Enhancer (version 3.1.1) : Enhancement of classes
Encountered a problem: Unexpected exception
Here is the log
java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
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.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.datanucleus.enhancer.asm.ASMClassEnhancer.getClassNameForFileName(ASMClassEnhancer.java:272)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:727)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258)
... 7 more
I have two versions of java, one is 1.8.0_25, the other is 1.7.0_46
this is my path
C:\Program Files (x86)\Java\jre7\bin;;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;
and as a default I use the jre7 on eclipse, dont know what else to mention here. I found no solutions clearly explained here or on the other websites rather than trying to change the java version, tried all java instances on my computer, uninstalled and installed again. I am guessing it may be about java and datanucleus compability issue, but currently using the java7 and the plugins i am using were downloaded automatically from eclipse so no clue. If you need any clarifications, ask me out please.

If you are using Java 8, you need to set the compiler compliance level to 1.7 in project properties. You will also need to change the java facet version

Note that (GoogleAppEngine Enhancer Error Code 1:)
App Engine doesn't work with Java 1.8. Try doing it again, with Java 1.7
Setting Java 1.7 in Project settings solves me the problem.

Well like I have guessed, it is all about the compatibility issue. If you are getting this error, make sure EVERYTHING your eclipse AND your computer use is the same version of java everywhere. What I mean is you need to check;
In eclipse, from the top menu choose Project->Properties, then make sure all the versions of java used by eclipse are the same.
AND
AND
and of course your environment variable should point to the same version that eclipse uses.
Hope this helps. Post comments if you found it unclear. Getting errors before even started coding sucks :p

Related

Problems with Repast Model Launch

After a fresh install of Repast Symphony 2.5.0 (Win 64bit) and JDK 9.0.1 on a Windows 10 system, when importing a JZombies_Demo example, the model cannot be launched with the default configuration.
The error says:
An internal error occurred during: "Launching JZombies_Demo Model".
org.codehaus.groovy.eclipse.core.builder.GroovyClasspathContainer.<init>(Lorg/eclipse/core/resources/IProject;)V
When I edit the default run configuration, in the Dependencies tab I see only the JRE System Library and nothing else. In the same tab, the Restore Default Entries is enabled - when I press it all the dependencies from Repast Symphony are added, and the previous error disappears. However, in this case when trying to launch another error is observed:
saf.core.runtime.Boot - null
java.lang.NullPointerException
at saf.core.runtime.Boot.init(Boot.java:79)
at saf.core.runtime.Boot.main(Boot.java:246)
at repast.simphony.runtime.RepastMain.main(RepastMain.java:43)
I also read about this problem on Repast Mailing List, and saw people talking about missing boot.properties file in the X\eclipse\plugins\repast.simphony.runtime_2.5.0 folder. However, the file is well in place there. So, I tried to link this to the previous error and saw that at (RepastMain.java:43) the pathInfo value was actually X\eclipse\plugins\repast.simphony.bin_and_src_2.5.0. Thus I tried to copy the boot.properties from the runtime directory to the bin_and_src - this removed the previous error, but brought a number of warnings related to UI initialization and an error:
repast.simphony.ui.RSUIPlugin - Fatal error starting Repast
java.lang.NoSuchMethodError: com.jgoodies.forms.layout.ColumnSpec.createGap(Lcom/jgoodies/forms/layout/ConstantSize;)Lcom/jgoodies/forms/layout/ColumnSpec;
at com.jgoodies.forms.layout.FormSpecs.<clinit>(FormSpecs.java:115)
at repast.simphony.ui.RunOptionsPanel.initComponents(RunOptionsPanel.java:114)
at repast.simphony.ui.RunOptionsPanel.<init>(RunOptionsPanel.java:39)
at repast.simphony.ui.RSGui.addRunOptionsView(RSGui.java:558)
at repast.simphony.ui.RSApplication.initGui(RSApplication.java:655)
at repast.simphony.ui.RSAppConfigurator.fillBars(RSAppConfigurator.java:52)
at saf.core.ui.GUICreatorDelegate.createDisplay(GUICreatorDelegate.java:160)
at saf.core.ui.GUICreator.createDisplay(GUICreator.java:12)
at repast.simphony.ui.RSUIPlugin$1.run(RSUIPlugin.java:102)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
After seeing all that, enough frustration, and tries to reinstall the Repast and JDK the situation remained unchanged. Also need to note, that the same behavior is observed for other examples, and newly created Repast projects.
Would be very glad to hear your opinions on what can cause such Repast behavior.
It looks like this is an issue with Java 9 compatibility. Can you try a fresh install using the latest Java 8? In the meantime we'll follow up on what changes in Repast Simphony will be needed for Java 9 compatibility.

leiningen cannot run because of java class not found exception

I recently--as in, today--became interested in learning to program with clojure. Now after having installed the latest version of java's jdk and downloading the leiningen script, I followed the installation instructions for the latter, specifically those given at: http:/www.lispcast.com/clojure-ubuntu.
Now, after the running lein version and downloading the relevant jar file, the program exits with an error about a class not being found. The error in question reads as follows:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)>
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core__init.load(Unknown Source)
at clojure.core__init.(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.doInit(RT.java:461)
at clojure.lang.RT.(RT.java:331)
at clojure.main.(main.java:20)
Caused by: java.lang.ClassNotFoundException: java/sql/Timestamp
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForNameNonLoading(RT.java:2181)
at clojure.instant$loading__5569__auto____6869.invoke(instant.clj:9)
at clojure.instant__init.load(Unknown Source)
at clojure.instant__init.(Unknown Source)
... 23 more
My java 9 jdk is installed in /usr/lib/jvm/java-9-oracle/bin/java, with my JAVA_HOME variable set to /usr/lib/jvm/java-9-oracle but I tried /usr/lib/jvm/java-9-oracle/bin as well, just in case. I am running xubuntu 16.04.3, if this is of any importance. I did try setting the default java jdk back to the openjdk which is bundled with xubuntu but this also was to no avail.
As an aside, the entire problem originated because I tried running the REPL
in intellij after installing the cursive plugin, which didn't work. I then surmised that it might be because I had not installed leiningen beforehand (I thought that the IDE and cursive would have this bundled along). However, the actual information on what intellij and clojure require to run successfully has eluded me, since much of the information is rather 'scattered' and I'm not sure whether I missed something along the way.
In any case, I am having quite a hard time of getting everything to work--probably because I'm not yet that savvy when it comes to these kinds of issues, having only been on a linux distro for a short while as well as being completely unfamiliar with clojure. If I'm missing something obvious, I apologize, but it stands to reason that something can only be obvious once it is shown to be so.
Any and all suggestions will be greatly appreciated.
That looks like a problem caused by Java 9's new concept of "modules": Clojure expects to be able to access java.sql.Timestamp, but it can't. I haven't kept up with Java development or Clojure development, so I can't say for sure that's your problem, but it looks that way to me. Try with an earlier JDK.
If you cant downgrade your JAVA version, run lein upgrade 2.8.1 or the latest Leiningen would do. Leiningen has been updated to include support for Java 9.

Javafx application can not launch when migrating from java 7u21 to higher version

I'm taking over this guy application and he left me pretty much nothing, even the coding is not commented. With luck (and a bit of time), I was able to improve the app and make it run like a charm on my computer.
But I'm having a problem, which is annoying and prevent me from upgrading the app. My app can run fine on any machines installed with java version 1.7.0_21, but when I update to newer version (for now it's 1.7.0_60), the app can not run, it just keeps having this stupid error and I can not do anything to fix it.
Here is the error log:
RenderJob.run: internal exception
java.lang.UnsatisfiedLinkError: com.sun.prism.d3d.D3DContext.nSetBlendEnabled(JZ
Z)I
at com.sun.prism.d3d.D3DContext.nSetBlendEnabled(Native Method)
at com.sun.prism.d3d.D3DContext.initState(D3DContext.java:84)
at com.sun.prism.d3d.D3DResourceFactory.<init>(D3DResourceFactory.java:5
7)
at com.sun.prism.d3d.D3DPipeline.createResourceFactory(D3DPipeline.java:
150)
at com.sun.prism.d3d.D3DPipeline.getD3DResourceFactory(D3DPipeline.java:
156)
at com.sun.prism.d3d.D3DPipeline.findDefaultResourceFactory(D3DPipeline.
java:182)
at com.sun.prism.d3d.D3DPipeline.getDefaultResourceFactory(D3DPipeline.j
ava:204)
at com.sun.prism.GraphicsPipeline.getDefaultResourceFactory(GraphicsPipe
line.java:97)
at com.sun.javafx.tk.quantum.QuantumRenderer$3.run(QuantumRenderer.java:
143)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at com.sun.prism.render.RenderJob.run(RenderJob.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Quantu
mRenderer.java:98)
at java.lang.Thread.run(Unknown Source)
I found another issue which is similar
Unable to deploy JavaFX applicaiton with external libraries in a JAR
but I can not apply that in my case since this program/framework need to run from a .bat file (which is command line actually) to creat a bunch of report files and folders.
Wich JavaFX version you have attached to your app?
I suspect the attached JavaFX version is not compatible with 1.7.0_60. I had some equal issues with that.
But the exception is new to me (its some internal prism stuff)
It has been my experience that the JFXRT jar is tightly coupled to the JRE/JDK version.update that it comes bundled with (in the case of oracles jvm). This means that the application needs to be ran on a jvm version.update as it was pulled from. You should be able to work around this by using the prescribed methods of building found here, http://docs.oracle.com/javafx/2/deployment/packaging.htm.

JavaMail ClassNotFound

I've run in to a strange error with the javamail 1.4.2 api and jdk/jre 1.6.0u16. I've placed the unzipped javamail-1.4.2 folder (along with the MySQL Connector-J 5.1.7 also needed) in both the jdk and jre folders as in the %classpath% below.
.;"C:\Program
Files\Java\jdk1.6.0-16\jre\lib\ext\mysql-connector-java-5.1.7-bin";"C:\Program Files\Java\jdk1.6.0-16\jre\lib\ext\javamail-1.4.2\mail.jar";"C:\Program
Files\Java\jdk1.6.0_16\bin";"C:\Program
Files\GameLabInventory\GameLabInventory-7.0.jar";"C:\Program
Files\Java\jre6\lib\ext\mysql-connector-java-5.1.7-bin";"C:\Program Files\Java\jre6\lib\ext\javamail-1.4.2\mail.jar";
But when I run my compiled jar with the command
C:\Program Files\Java\jre6\bin>java -cp %classpath% -jar "C:\Program Files\GameLabInventory\GameLabInventory_7.0.jar"
I get the following error message:
Exception in thread "main"
java.lang.NoClassDefFoundError:
javax/mail/MessagingException
at gamelab.inventory.GameLabInventory.main(GameLabInventory.java:62)
Caused by:
java.lang.ClassNotFoundException:
javax.mail.MessagingException
at java.net.URLClassLoader$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native
Method)
at java.net.URLClassLoader.findClass(Unknown
Source)
at java.lang.ClassLoader.loadClass(Unknown
Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown
Source)
at java.lang.ClassLoader.loadClass(Unknown
Source)
at java.lang.ClassLoader.loadClassInternal(Unknown
Source)
... 1 more
I can't find anything wrong with my setup here, hopefully you guys can help me out. Thanks!
Here is the manifest file:
Manifest-Version: 1.0
Main-Class: gamelab.inventory.GameLabInventory
Here is the jar -tvf (link)
According to the documentation for the java tool:
When you use [the -jar] option, the
JAR file is the source of all user
classes, and other user class path
settings are ignored.
You can specify a Class-Path attribute in yourJAR file that "specifies the relative URLs of the extensions or libraries that [your] application or extension needs."
When using -jar, java overrides the classpath setting (-cp). In this configuration, however, classpath jars can be specified in the manifest file of your jar.
I've experienced a similar issue (not identical to yours, since mine is spring-related) and found this link was helpful:
http://forum.springsource.org/showthread.php?t=65840&page=3
It seems that implementation changes in the JDK might be causing this behaviour. Quoting from the link:
"I managed to reproduce the problem on my Mac development box using Java 6 (1.6.0_07). I then tried it on my Mac using Java 5, and could not reproduce the problem. Crucially, in the Java 5 case, the JVM would be using the javax.activation API and implementation from the 1.1.1 javax activation bundle, whereas on Java 6, it would be using them from the JRE (anything that's part of the JRE takes precedence over what's in dm Server's lib directory). I then tried the app on an Ubuntu box, this time using Java 6 1.6.0_10. I could not reproduce the problem."
and/but:-
"I've just had this same problem "No object DCH for MIME type" but on Ubuntu java version "1.6.0_13". So I don't know how you guys solved it by upgrading to 1.6.0_11.
What I did is copy the mailcab.default to my own bundle and it worked. Seems to be a classloading problem which I don't fully understand yet."

Tinyos Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

When I use make command, like make mica2, in TinyOS. The following problem will occured:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
make: *** [exe0] Error 1
I reinstalled JAVA and add env variables, but it didn't work. I use TinyOS 2.1 and JAVA 1.5 u18. Can any one help me?
Problem solved by install JDK 1.6. Although when I run tos-check-env command, it shows me a warning that tell me its not JDK 1.4 or 1.5. Maybe it is a bug in TinyOS.
an UnsupportedClassVersionError means you are trying to run byte code on an older version of the JVM than it was compiled in. You can use a class file viewer to check which version of the JDK the source code was compiled it and make sure it is compatible with JAVA 1.5 u18.
The error you're getting means that the version of Java that's running is trying to load a class that was compiled with an incompatible version of Java.
With the information you've provided it's not possible to diagnose the problem any more specifically than this - look at any Java libraries you're using and what their required Java versions are. If you can't find anything wrong here, you might just need to clean out some cached *.class files that were built with a version of Java before the reinstall.
Finally, if you have multiple JVMs installed be sure that make is using the one you expect. It's definitely possible for you to have installation Java 1.5u18 but for the application to still be finding and using a 1.4 JVM from somewhere.
I got the same error today, and I simply solved it by installing java version 1.6 and jre6, and by making Java 1.6 version as the default version.
I also had java 1.5 installed earlier, as tos-check-env wanted me to have either java 1.4 or java 1.5 versions installed.
I also included both the java 1.5 and 1.6 versions to my classpath and ran make micaz again in the /opt/tinyos-2.1.0/apps/Blink directory and it worked.
Normally there would be a message such as
(Unsupported major.minor version 49.0)
in the first line of the exception message. However, you got
Bad version number in .class file
So maybe your class file is corrupted?
Use sudo update-alternatives --config java and set the version you may want to use.

Categories