java -jar payara-micro-4.1.2.181.jar throwing Cannot find javadb client jar file - payara

I am getting the following exceptions
running ==>> java -jar payara-micro-4.1.2.181.jar
[2019-01-15T20:55:37.913-0800] [] [1;92m[INFO][0m []
[[1;94mfish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder[0m]
[tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1547614537913]
[levelValue: 800] Built Payara Micro Runtime
And also
[2019-01-15T20:55:43.539-0800] [] [1;92m[INFO][0m [NCLS-CORE-00046]
[[1;94mjavax.enterprise.system.core[0m] [tid: _ThreadID=1
_ThreadName=main] [timeMillis: 1547614543539] [levelValue: 800] Cannot find javadb client jar file, derby jdbc driver will not be available
by default.
I am using jdk 1.8.

The javadb client file exception is irrelevant to your actual problem. It is an INFO level message to tell you that it has looked in the default place for the Apache Derby database libraries, but hasn't found them. This default place only applies to Payara Server, not Payara Micro.
The actual problem you're seeing is in your comment. I can see that you are using a version of Java that includes the JPMS (module system). The modularity introduced in Java 9 is not compatible with your version of Payara Micro, so you will need a version of Java no higher than 8.
You may be able to start Payara Micro on Java 9+ by explicitly adding the java.se.ee module, but there was no change in 4.181 to allow Payara Micro to actually run correctly with JPMS, so it would almost certainly break if you tried to deploy any kind of complex app.
TL;DR: change to use Java 8 because Payara Micro 4.181 will not run on Java 9 or higher. And the javadb message can be ignored.
Note: Even though you say you are using Java 1.8, the stack trace proves that you are not. Double check your Java installation and make sure to definitely use Java 8.

Related

How to run Apache CXF wadl2java with JDK 12?

The following command used to work flawlessly:
C:\tools\apache-cxf-3.3.1\bin\wsdl2java -client -d generated foo.wsdl
It no longer works with the latest version of JDK - 12. I have downloaded the latest version of Apache CXF, and still get the same error:
-Djava.endorsed.dirs=C:\tools\apache-cxf-3.3.1\bin\..\lib\endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Could anyone offer a tip on how to remedy this?
I got the Apache CXF 3.3.1 wsdl2java utility to work with the latest OpenJDK 11 by doing 4 things:
Pull down this jar and place it into the {CXF_HOME}/lib directory: https://mvnrepository.com/artifact/javax.jws/jsr181-api/1.0-MR1
Pull down this jar and also place it in the {CXF_HOME}/lib directory: https://mvnrepository.com/artifact/javax.xml.ws/jaxws-api/2.3.1
In my case, since I'm running on a Mac, I vi'd the wsdl2java script and made sure these two jars are explicitly being set on the CXF classpath, by doing the following declaration within the script right before the execution of the java command:cxf_classpath=${cxf_classpath}:../lib/jaxws-api-2.3.1.jar:../lib/jsr181-api-1.0-MR1.jar
Lastly, I removed the '-Djava.endorsed.dirs="${cxf_home}/lib/endorsed"' parameter from the java command at the end of the script, since newer JDKs no longer support this argument, so my command now looks like this:$JAVA_HOME/bin/java -Xmx${JAVA_MAX_MEM} -cp "${cxf_classpath}" -Djava.util.logging.config.file=$log_config org.apache.cxf.tools.wsdlto.WSDLToJava "$#"
Now, using OpenJDK11, I'm able to point to an external WSDL file and successfully generate the client code I need to consume this SOAP service with the following command:
./wsdl2java -client -d src https://somewhere.com/service\?wsdl
Whether or not this all works yet is TBD in terms of being able to call and consume the SOAP service I'm coding against, but I've at least now overcome the Java9+ support issue with this tool specific to generating client code from a WSDL.
If your needs are different, I would at least remove the '-Djava.endorsed.dirs="${cxf_home}/lib/endorsed"' JVM parameter and start calling the wsd2java command with the parameters you need set and just start iteratively adding back in the missing libs it starts throwing java.lang.NoClassDefFoundError errors for.
Their FAQ specifically says starting in 3.3.x, Java 9+ will be supported but something clearly dropped the ball between the no-longer-supported hardcoded JVM arguments still being passed in the utility and the missing libraries to support the newer JDKs where these legacy libs have been removed.
Hope this helps someone out there unfortunate enough to ALSO still be programming against SOAP endpoints but trying to at least keep the client-side code you're writing up to date and taking advantage of the newer features of the modern JDK.

GeneXus 15 + Google Cloud Deployment Error: Class file is Java 8 but max supported is Java 7

I have seen many answers in these forum, but none related to GX so far, and the ones I've tried haven't solved this issue.
When trying to deploy a GX 15 + JAVA + Web + Mobile I get the following error:
...
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
Unable to update app: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
error: C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild(4,3): error MSB3073: The command ""C:\android\engine\appengine-java-sdk-1.9.51\bin\appcfg.cmd" -A proyecto02 update "C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109" -V 3" exited with code 1.
Done Building Project "C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild" (Deploy target(s)) -- FAILED.
...
To build mobile apps GX 15 requires JDK 8.
Has anyone been able to deploy to Google Cloud?
Any suggestions to solve the error?
GeneXus Java generator does not require Java 8, it requires Java 6 or higher, Genexus Android generator requires Java 8.
Each generator has independent properties to set the JDK to be used, compiler options, etc. So, no matter you are using JDK 8 you are able to set "Java compiler options" (for Java Generator) as: -O -source 1.7 -target 1.7 in order to compile the application to run on 1.7 JVM (as explained here)
Another solution is to have both JDKs installed, to set JDK 1.7 path as Java Generator/Compiler path and JDK 1.8 path as Android/Compiler Path.

Running app in IDE stops working

Last week I finished development on a test app and ran it successfully in all simulators.
Today I decided to look at publishing the app and used "Sent Android Build". Build status "Successful".
Then tried running jar from command line and got:
peter#PeteSuse:~> java -jar "/home/peter/NetBeansProjects/mobile-apps/pGame/dist/pGame.jar"
java.lang.ArrayIndexOutOfBoundsException: 0
at com.codename1.impl.javase.Executor$1.run(Executor.java:84)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
So tried to run from GUI and got:
run:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
at com.codename1.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:69)
at com.codename1.ui.Display.init(Display.java:566)
at com.codename1.impl.javase.Executor$1.run(Executor.java:112)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
Java version:
peter#PeteSuse:~> java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (IcedTea 3.3.0) (suse-23.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
I am using Netbeans (new to this) on Suse Linux 42.1 64b.
Have I lost a library somewhere? or something else?
Thanks guys. I fixed the problem by adding jfxrt.jar to the Libraries in NetBeans.
JFXPanel is in the JavaFX library.
See: JavaFX and OpenJDK for info on why JavaFX is not available by default in your OpenJDK distribution.
If your linux distribution makes an open JavaFX package available (like ubuntu does: Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?), then you can use that.
Otherwise you can build from source (for the adventurous yak shaver).
Or, easiest, is just to an Oracle Java distribution.
I don't know codenameone or have any idea how it works. Possibly whatever it is, you could ask the creators to package their thing as a self-contained application, so that it ships with a compatible Java runtime, which would (potentially) avoid issues such as you are encountering. Not knowing codenameone, I don't know if that would make sense or not.
I also don't know the cause of your original ArrayIndexOutOfBoundsException as that looks internal to codenameone or your use of it.
With regards to NetBeans, you might need to set the Java platform to one with JavaFX installed (in case you have multiple Java platforms installed on your machine).
You can run a Codename One application in the simulator by pressing the play button in the IDE. It won't work for you from Command Line and shouldn't since the app shouldn't have a main() method.
You can execute the Codename One simulator from Command Line using:
java -jar JavaSE.jar:dist/MyApp.jar
Notice this assumes your project is the working directory.

Which sonar-maven-plugin version to use?

I am wondering which sonar-maven-plugin in which version I should use.
As far as I know there is a org.codehaus.mojo version and two org.codehaus.sonar versions (sonar-maven3-plugin, sonar-maven-plugin).
As far as I understand the sonar-maven3-plugin is now deprecated and the org.codehaus.sonar:sonar-maven-plugin should be used instead. However those org.codehaus.sonar version are tied to a certain version of the sonar server, therefore it makes probably no sense to use them directly.
To be able to deal with this there is the org.codehaus.mojo:sonar-maven-plugin which checks which sonar version the server has and from there checks which org.codehaus.sonar:sonar-maven-plugin to use.
So in order to have a maven pom that is independent of the Sonar Server Version one should probably use the org.sonar.mojo:sonar-maven-plugin:RELEASE version to be safe.
Did I get this right?
Any further things to consider?
Thanks
As described in the documentation page (see "Project analyzed with Maven 3"), the plugin you have to use is org.codehaus.mojo:sonar-maven-plugin, not the internal one(s).
When we were using sonarserver ver 3.7.1 we used to have org.codehaus.sonar:sonar-maven-plugin.
Once we migrated from Sonar Server to SonarQube server 4.5+ onwards, we need to use org.codehaus.mojo:sonar-maven-plugin.
Currently in our project , we need to compile our code with jdk 6(as it is old project) and run the sonarqube server ver 4.5.7 analysis with java 7
so with java 6 we run the command mvn clean org.jacoco:jacoco-maven-plugin:0.7.4.201502262128:prepare-agent install and while running the sonar analysis we change the jvm to java 7 and execute the command mvn org.codehaus.mojo:sonar-maven-plugin:2.4:sonar -Dsonar -Dsonar.host.url=http://localhost:9000 -Dsonar.dynamicAnalysis=true

appcfg.cmd java version; 1.7 installed; 1.6 in path; tells me it needs 1.6 ti yokiad

I try to use this command to deploy my application to
appspot.google.com:
c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Generates the error messsage.
C:\a>c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.7', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
I tried setting the path to use the Java 1.6 SDK we downloaded
but that did not help or change any thing.
The web resources talk about what version of Java is used
by the application once it appears on Google's servers; I
did not see anything about the Java version for the upload
process including developers.google.com/appengine/docs/java/gettingstarted/uploading and developers.google.com/appengine/docs/java/tools/uploadinganapp#Command_Line_Arguments as well as searching this site specifically and checking google.
Can I deploy
an application from the computer in my house without
deinstalling the Java 1.7 I use for other purposes?
Thank you for looking at this question. I resolved the problem. It was not related to Google Application Development
Server. It was a difficult-to-resolve path problem to the directory where the Java executables were kept.

Resources