Fail to "play new" on Mac - java

I run into an exception whenever trying play run on my Mac.
Detail stack track is as
The new application will be created in /Users/admin/mine/test2
What is the application name?
> test2
Which template do you want to use for this new application?
1 - Create a simple Scala application
2 - Create a simple Java application
3 - Create an empty project
> 2
java.lang.StackOverflowError
at scala.reflect.ClassManifest$class.newArray(ClassManifest.scala:113)
at scala.reflect.ClassTypeManifest.newArray(ClassManifest.scala:233)
at scala.reflect.ClassManifest$class.newWrappedArray(ClassManifest.scala:133)
at scala.reflect.ClassTypeManifest.newWrappedArray(ClassManifest.scala:233)
at scala.collection.mutable.WrappedArrayBuilder.mkArray(WrappedArrayBuilder.scala:31)
at scala.collection.mutable.WrappedArrayBuilder.resize(WrappedArrayBuilder.scala:37)
at scala.collection.mutable.WrappedArrayBuilder.ensureSize(WrappedArrayBuilder.scala:49)
at scala.collection.mutable.WrappedArrayBuilder.$plus$eq(WrappedArrayBuilder.scala:54)
at scala.collection.mutable.WrappedArrayBuilder.$plus$eq(WrappedArrayBuilder.scala:24)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:213)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:212)
at scala.collection.mutable.WrappedArray.filter(WrappedArray.scala:33)
at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:223)
at scala.collection.mutable.WrappedArray.filterNot(WrappedArray.scala:33)
at scalax.file.FileSystem.fromSeq(FileSystem.scala:97)
at scalax.file.FileSystem.apply(FileSystem.scala:108)
at scalax.file.FileSystem.presentWorkingDirectory(FileSystem.scala:48)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:26)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:20)
at scalax.file.FileSystem.fromString(FileSystem.scala:90)
at scalax.file.defaultfs.DefaultPath.toAbsolute(DefaultPath.scala:40)
at scalax.file.defaultfs.DefaultPath.toAbsolute(DefaultPath.scala:36)
at scalax.file.FileSystem.presentWorkingDirectory(FileSystem.scala:48)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:26)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:20)
at scalax.file.FileSystem.fromString(FileSystem.scala:90)
at scalax.file.defaultfs.DefaultPath.toAbsolute(DefaultPath.scala:40)
at scalax.file.defaultfs.DefaultPath.toAbsolute(DefaultPath.scala:36)
at scalax.file.FileSystem.presentWorkingDirectory(FileSystem.scala:48)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:26)
at scalax.file.defaultfs.DefaultFileSystem.doCreateFromSeq(DefaultFileSystem.scala:20)
....
Error during sbt execution: java.lang.StackOverflowError
Java version is OpenJDK Runtime Environment (build 1.7.0-internal-henri_2011_06_08_08_48-b00)
Scala version is 2.9.1 (install via brew)
Sbt version is 0.11.3
Playframework version is 2.0.4 (same problem with 2.10 actually)
What should I do then?

Probably this is because of java version. You should try another java version. I use java version "1.6.0_37" on my mac.

Related

"zsh: killed" output in terminal, when trying to run a FHIR Validator (Java)

I'm trying to run the FHIR Validator through terminal, but the process seems to get killed everytime I try to run it.
I'm using the following command:
java -Xmx46144m -jar validator_cli.jar generatedTest2.xml -version 3.0 -bundle Patient:0 http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips
The validator is available here:
https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar
Here is the log from the terminal (macOS):
user#myMac assets % java -Xmx46144m -jar validator_cli.jar generatedTest2.xml -version 3.0 -bundle Patient:0 http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips
FHIR Validation tool Version 5.2.20 (Git# af05868a82bf). Built 2021-01-25T15:02:44.742Z (81 days old)
Java: 15.0.1 from /Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home on x86_64 (64bit). 46144MB available
Paths: Current = /Users/user/Documents/implementation/assets, Package Cache = /Users/user/.fhir/packages
Params: generatedTest2.xml -version 3.0 -bundle Patient:0 http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips
Loading
Load FHIR v3.0 from hl7.fhir.r3.core#3.0.2 - 4017 resources (00:06.0267)
Load hl7.terminology#2.0.0 - 3749 resources (00:01.0567)
Terminology server http://tx.fhir.org - Version 1.9.371 (00:02.0288)
Get set... go (00:01.0248)
Validating
Validate generatedTest2.xmlzsh: killed java -Xmx46144m -jar validator_cli.jar generatedTest2.xml -version 3.0 -bundl
I'm using the -Xmx46144m addition, since otherwise I was receiving the "OutOfMemoryError: Java heap space" Error.
Is there an option, which can help me, so that my process is not being killed?
Thanks in advance!

Scala incompatibility with Java 9 - java.lang.NoClassDefFoundError

Just run a sample Scala SBT project after installing Java 9 on my pc and I took this exception.
I already tried some solutions that I found but nothing.
Is there any incompatibility between Java 9 and Scala?
Scala Version: 2.12.3
Java Version: java version "9"
IDE: IntelliJ
Thanks in advance.
info] Compiling 7 Scala sources and 1 Java source to /Users/ermis/Projects/begining-scala/target/scala-2.12/classes...
[info] p.a.h.EnabledFilters - Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):
play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
[info] play.api.Play - Application started (Dev)
Uncaught error from thread [play-dev-mode-akka.actor.default-
dispatcher-2]: javax/xml/bind/DatatypeConverter, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[play-dev-mode]
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at io.jsonwebtoken.impl.Base64Codec.decode(Base64Codec.java:26)
at io.jsonwebtoken.impl.DefaultJwtBuilder.signWith(DefaultJwtBuilder.java:106)
at play.api.mvc.JWTCookieDataCodec$JWTFormatter.format(Cookie.scala:710)
at play.api.mvc.JWTCookieDataCodec.encode(Cookie.scala:569)
at play.api.mvc.JWTCookieDataCodec.encode$(Cookie.scala:567)
at play.api.mvc.DefaultJWTCookieDataCodec.encode(Cookie.scala:760)
at play.api.mvc.FallbackCookieDataCodec.encode(Cookie.scala:734)
at play.api.mvc.FallbackCookieDataCodec.encode$(Cookie.scala:733)
at play.api.mvc.DefaultSessionCookieBaker.encode(Session.scala:95)
at play.api.mvc.CookieBaker.encodeAsCookie(Cookie.scala:414)
at play.api.mvc.CookieBaker.encodeAsCookie$(Cookie.scala:413)
at play.api.mvc.DefaultSessionCookieBaker.encodeAsCookie(Session.scala:95)
at play.api.mvc.Result.$anonfun$bakeCookies$2(Results.scala:281)
at scala.Option.map(Option.scala:146)
at play.api.mvc.Result.bakeCookies(Results.scala:280)
at play.core.server.common.ServerResultUtils.prepareCookies(ServerResultUtils.scala:227)
at play.core.server.AkkaHttpServer.$anonfun$executeAction$3(AkkaHttpServer.scala:302)
at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:55)
at akka.http.scaladsl.util.FastFuture$.flatMap$extension(FastFuture.scala:26)
at play.core.server.AkkaHttpServer.executeAction(AkkaHttpServer.scala:301)
at play.core.server.AkkaHttpServer.executeHandler(AkkaHttpServer.scala:254)
I tried this but didn't work.
--add-modules java.xml.bind
or
--add-modules java.se.ee
Try adding a compiler option to temporarily fix this:
--add-modules java.se.ee
since the Module shared by Java EE would not be resolved by default in JDK9.
You can also keep track of the issue to Support JDK 9 at scala-dev repository for updates as well.
I just remove Java 9 until someone gives me some lights and the compile works as usual.

NoSuchMethodError: eclipse.core.runtime.ListenerList error in eclipse

I recently run into this problem when trying to run a application in Windows which was built in Linux. My jdk is 1.8. Can someone suggest me how to fix it
Below is the full log
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.core.runtime.ListenerList.iterator()Ljava/util/Iterator;
at org.eclipse.core.databinding.observable.ChangeManager.fireEvent(ChangeManager.java:116)
at org.eclipse.core.databinding.observable.value.AbstractObservableValue.fireValueChange(AbstractObservableValue.java:82)
at org.eclipse.core.databinding.observable.value.WritableValue.doSetValue(WritableValue.java:98)
at org.eclipse.core.databinding.observable.value.AbstractObservableValue.setValue(AbstractObservableValue.java:66)
at org.eclipse.jface.internal.databinding.viewers.ObservableCollectionContentProvider.setViewer(ObservableCollectionContentProvider.java:167)
at org.eclipse.jface.internal.databinding.viewers.ObservableCollectionContentProvider.inputChanged(ObservableCollectionContentProvider.java:160)
at org.eclipse.jface.databinding.viewers.ObservableListContentProvider$Impl.inputChanged(ObservableListContentProvider.java:58)
at org.eclipse.jface.databinding.viewers.ObservableListContentProvider.inputChanged(ObservableListContentProvider.java:184)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1696)
at com.fk.comprende.views.SituationAnalysisComposite.initDataBindings(SituationAnalysisComposite.java:1847)
at com.fk.comprende.views.SituationAnalysisComposite.<init>(SituationAnalysisComposite.java:1383)
at com.fk.ComprendeMapper.createContents(ComprendeMapper.java:362)
at com.fk.ComprendeMapper$1.run(ComprendeMapper.java:70)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at com.fk.ComprendeMapper.open(ComprendeMapper.java:67)
at com.fk.ComprendeMapper.main(ComprendeMapper.java:55)
The version of the org.eclipse.core.runtime plugin you are using is not compatible with the JFace databinding classes you are using.
Only the version of org.eclipse.core.runtime in Eclipse Neon (4.6) or later has the ListenerList class with the iterator method. Earlier versions of Eclipse have ListenerList but it does not have the iterator method which your code wants to use.

Oracle JDK Update 5 (1.7.0_05) not working on SUSE Linux Enterprise Server 11. EOFException while connecting to Javaspace Blackboard (JINI)

We are trying to run a process (broker) from a SUSE Linux Enterprise Server 11 (java-1_7_0-ibm) which connects to a Javaspace Blackboard (JINI) deployed on another linux machine. (CentOs with Open JDK "1.7.0_05-icedtea" version)
Stack Trace :
INFO: Starting broker
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:259)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:653)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy0.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at edu.vt.ndssl.blackboard.JiniSpaceService.findSpace(JiniSpaceService.java:372)
at edu.vt.ndssl.blackboard.JiniSpaceService.<init>(JiniSpaceService.java:74)
at edu.vt.ndssl.blackboard.JavaSpaceBlackboard.<init>(JavaSpaceBlackboard.java:31)
at edu.vt.ndssl.blackboard.BlackboardFactory.make(BlackboardFactory.java:28)
at edu.vt.ndssl.broker.Broker.<init>(Broker.java:53)
at edu.vt.ndssl.broker.Broker.main(Broker.java:231)
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:237)
... 10 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1387)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2059)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1984)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1867)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1419)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:420)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 13 more
Same code works fine with Java 1.6 version upto 26.
I am looking for a correct version of Java to be installed on the SUSE Linux Enterprise Server which will be compatible with this OS and also equivalent to the Oracle JDK Update 5 or Open JDK Version 1.7.0_05 (icedtea).
Apparently, the root cause of the problem is that Oracle has made an incompatible change to the serialization format of the com.sun.jini.logging.Levels class. The change reportedly happened in Oracle JDK 1.6.0_38 and JDK 1.7.0_13, and has presumably made it into recent OpenJDK versions as well.
This problem has manifested in a variety of projects that use JINI. Examples:
https://issues.apache.org/jira/browse/RIVER-415 + https://issues.apache.org/jira/browse/RIVER-416.
https://cloudifysource.zendesk.com/entries/23079726-bootstrap-localcloud-not-working-Could-not-initialize-class-com-sun-jini-logging-Levels
More examples can be found by searching for "com.sun.jini.logging.Levels EOFException".
I can't say what the solution is / would be for you, but I have a couple of ideas:
Avoidance: I think you can avoid the problem if you don't mix pre and post-change JVM versions in your application network.
If you need to upgrade your application JVMs, I suggest that you upgrade them all, and then do a complete shutdown/restart of your JINI applications and services.
Fix your applications: It appears that the Apache River project fixed the problem by modifying the JINI code. As the issue ticket says:
The com.sun.jini.logging.Levels class produces a RuntimeException with the latest version of Java (both 1.6 and 1.7). The issue surrounds creation of custom java.util.logging.Level. The current implementation uses a ClassReplacingObjectOutputStream and the LevelData approach. By removing this approach and creating a subclass of java.util.logging.Level the issue gets resolved.
The issue ticket has a lot of discussion on the best way to do this, proposed patches and links to the checkin where they actually implemented the fix.

JAX-WS and version conflicts

As test project I've create a very simple WebService using wsdl and jax-ws. The client runs very well if it is deployed as web application in GlassFish but if I start the same (WebService-)Code in Eclipse directly, I get the following error:
WARNUNG: Input Action on WSDL operation AddNumbers and #Action on its associated Web Method addNumbers did not match and will cause problems in dispatching the requests
Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException
at com.sun.xml.ws.rx.mc.runtime.McConfigurationFactory.createInstance(McConfigurationFactory.java:66)
at com.sun.xml.ws.rx.mc.runtime.McTubeFactory.createTube(McTubeFactory.java:68)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:205)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:178)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:85)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
at javax.xml.ws.Service.getPort(Service.java:134)
at mnm.namedesdienstes.webservice.service.NameDesDienstesService.getNameDesDienstesPortTypePort(NameDesDienstesService.java:56)
at webserviceClient.NameDesDienstesClient.myTest(NameDesDienstesClient.java:12)
at webserviceClient.NameDesDienstesClient.main(NameDesDienstesClient.java:25)
Caused by: java.lang.ClassNotFoundException: org.glassfish.ha.store.api.BackingStoreException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 16 more
After some research I found out that it must have something to do with different versions of some library files. So now my question is, how can I "fix" my eclipse java execution to run my webservice client correctly? I've found some tips to copy some jar to an endorsed-directory, but which jars into which directory :-)
I'm using Max OS 10.6.8, Eclipse Project uses JVM 1.6. My Mac Java Version is
xmacbook:~ cstraube$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
UPDATE: My first try (thanks to the link from remipod) I performed the following steps:
Get the directory of endorsed lirbaries with System.out.println(System.getProperty("java.endorsed.dirs"));
Next, I copied the two files JAXWS2.1.7-20090419.jar and JAXB2_20080513.jar (both Version 2.1.7) into this directory
Unfortunately I get still the same error
I have similar problem with yours when deploying web service (JAX-WS) in tomcat 7.
The missing class definition could be found in ha-api.jar.
org/glassfish/ha/store/api/BackingStoreException
You should add the ha-api.jar (From JAX-WS distribution) into server lib. For my case, the eclipse run tomcat 7, so the location is (Tomcat 7.0\lib).
You have to copy the fitting versions of jaxws-api.jar and jaxb-api.jar into the directory /Library/Java/Home/lib/endorsed (Mac).
Have a look at this link JAX WS with WS 2.1.1. You will need to give precedence to your version of jaxws to the provided jaxws from the jre 1.6.
Edit:
Glassfish already includes some libraries, as well as java 6. I had to track down version conflicts with jaxws in glassfish 3.1 / 3.1.1 and java 6 / 7. You might check the exact java runtime eclipse uses to start the application and look for duplicate jars on the effective classpath.
The endorsed mechanism just provides an easy and error prone way to override the included jaxws distribution. Error prone, because your colleague will suffer from the same problem.
I havn't seen the exception org.glassfish.ha.store.api.BackingStoreException in the context of jaxws. Your version conflict could be created by another library than jaxws...
I experienced the exact same exception
org.glassfish.ha.store.api.BackingStoreException
And after ensuring my JAX-WS and JAX-B jars were all the same version the issue was still occurring.
THE FIX: I then added the ha-api.jar to the WEB-INF\lib directory and this solved the issue.
The clue here was the "ha" package in the exceptions class path as seen above. Hope this helps!

Categories