Getting NullPointerException while trying to run jetty start.run - java

I am trying to make jetty server as service, and im using this guide:
https://www.eclipse.org/jetty/documentation/current/startup-windows-service.html
However I cant make it work, when trying to proceed with:
java -jar ..\jetty\start.jar --add-to-start=deploy,http,console-capture
im getting this:
java.lang.NullPointerException
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at sun.nio.fs.WindowsPath.parse(Unknown Source)
at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
at java.nio.file.Paths.get(Unknown Source)
at org.eclipse.jetty.start.StartArgs.findMavenLocalRepoDir(StartArgs.java:845)
at org.eclipse.jetty.start.BaseBuilder.<init>(BaseBuilder.java:90)
at org.eclipse.jetty.start.Main.start(Main.java:439)
at org.eclipse.jetty.start.Main.main(Main.java:77)```

I had the same problem using version jetty-distribution-9.4.10.v20180503. So, I downgrade to jetty-distribution-9.4.19.v20190610 and it started to work fine. Environment details below:
Windows 10 Pro
java version "1.8.0_151"

Related

updating scala jar (lang:scala-library:jar:2.7.7) is giving exception

I am trying to update org.scala-lang:scala-library:jar:2.7.7 , from version 2.7.7 to 2.10.7 , in my project it is throwing exception
while starting server -
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.proxy.$Proxy171
at sun.reflect.GeneratedConstructorAccessor126.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:122)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:109)
at org.springframework.aop.framework.AbstractSingletonProxyFactoryBean.afterPropertiesSet(AbstractSingletonProxyFactoryBean.java:178)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1648)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1585)
How to approach to solve this problem?
Please let me know if any other detail is required.
You can't just update the Scala runtime jar like this: any dependencies of your application which are written in Scala will need to be updated to a 2.10-compatible version and Scala code of your application will need to be recompiled with Scala 2.10 as well.

Unable to start mule-standalone-3.5.0 server in my local system

I am unable to start mule standalone server 3.5.0. in my Windows7 PC. My java version installed is "1.6.0_45" and it is 64 bit. I have set the Path, JAVA_HOME, MULE_HOME environment variables in system settings. While starting the mule server by running mule.exe from bin folder I am getting the following error.
Can you please anyone suggest me to get rid of this error.
C:\Applications\mule-standalone-3.5.0\bin>mule
MULE_HOME is set to C:\Applications\mule-standalone-3.5.0
Running in console/foreground mode by default, use Ctrl-C to exit...
--> Wrapper Started as Console
Launching a JVM...
java.lang.UnsupportedClassVersionError: Bad version number in .class file
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)
Exception in thread "main"
JVM exited while loading the application.
CTRL-C trapped. Shutting down.
<-- Wrapper Stopped
Terminate batch job (Y/N)?
The exceptions java.lang.UnsupportedClassVersionError are very often 100% right. I would triple check that you are not using an older version.
Mule 3.5 is built with Java 1.6 so it's very unlikely there is a problem unless you have the wrong JVM.
Sometimes yo have everything setted properly, but it's getting the java from somewhere else.
tyy to run a
C:\Applications\mule-standalone-3.5.0\bin>java -version
just in case, to see if you are using the correct java version.
By the way, the exception is on a mule class or is in a project of yours deployed in this mule runtime? (seems like the log you copied is truncated).

Google App Engine DataNucleus 3.1.1 Unexpected Exception Error

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

java 6 broke webstart application installation with error 'java.lang.Exception: cache failed for'

After upgrading to the latest java version (Java 6 update 13) a webstart application that was being used in production environments for many years, stopped installing with the following error:
java.lang.Exception: cache failed forhttp://localhost:8080/ReactorStudio/studio/installer.jnlp
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The application jnlp is downloaded correctly and all the associated jar files. The application also contains a reference to an installer jnlp file that extracts a few files to the local disk the first the application is being run.
Any ideas on what is the problem, or how I could bypass this?
We had a similar issue when upgrading to the latest JRE. Our issue seemed to be related to this bug that should be fixed in 6u14. Perhaps your issue is also related.
The only workaround we found was to clear the webstart cache and launch the application again. In our experience this seems to be the solution to most webstart issues.
Try to remove href="..." from the "jnlp" tag of the "launch.jnlp" file.

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