How to change the JavaVersion of Jboss/wildfly Dockerimage - java

I'm really new to Docker and wanted to setup a Wildfly-Container (v26) and deploying a .war-File to it.
The problem I've encountered is, that Wildfly is using JDK11 as base image.
My program was written in JDK17. I've found this to change the JDK and the wildfly is running, but I have no idea if it worked. Is there any command or way to read out the used java version the docker image of wildfly is now using?
Sure I could 'just deploy' the war, but I have no access to the admin console. It looks like there is another problem I have to fix before.

Related

docker-compose for jakartaee restful jpa web application not working

I am struggling for a few days to write a docker-compose file for a simple jakartaEE/JavaEE restful JPA web application. DB is PostgreSQL and the application server is payara. This application inserts few entries to the DB and returns the collection in each rest call response. When I deploy the same application in the locally installed payara and Postgres, it is working fine. But it is failing with docker-compose with the error:
An error occurred during deployment: Class
com.docker.java.petstore.service.PetstoreService has unsupported major or
minor version numbers, which are greater than those found in the Java
Runtime Environment version 1.8.0_222. Please see the server.log for more details.
https://imgur.com/a/zVvVaGP
I tried deploying the war file from the payara admin console but failed with the same error.
The relevant code is shown here in the gist:
https://gist.github.com/JohnyzHub/cf8e9560b8640dbfd27dc4bb98d5991c
The environment used:
java 11
JakartaEE 8
Payara appserver
postgresql
Using glassfish-resource.xml file for dynamically creating the connection pool and data source.
The error looks strange, I am using java 11 but the error is about a specific java 8 version. I am not getting any clue what could be wrong here.
When I deployed the similar java 11 web application without JPA layer with a same docker file, it is working fine on docker.
Let me know if additional details are needed.
Any help is appreciated.
The official Payara Docker images on Dockerhub are using Java 8 inside. This clashes with your Java 11 compiled source code and does not work.
There is an open issue for this on GitHub, but unfortunately, now answer for months.
As a work-around either pick another application server (e.g. Open Liberty Universal Base Docker images have tags for the latest Java versions) or build your own Docker image from e.g. an OpenJDK 11 base image.
To figure out how to create your own Docker image, I would suggest to have a look at Adam Bien's Docklands repository, which contains multiple examples.
The error of your server says you compiled the classes in a higher version (JDK11) than its currently using (JDK8) in the docker image.
Check the used Java Runtime on the Application Server Docker image.
Then either compile the petstore using that JDK8 version of the server, or upgrade the docker container image to use a higher JDK than the one used to compile.

HEROKU - can't deploy java app with jdk11

Current approach:
As suggested there https://devcenter.heroku.com/articles/java-support, I've created a system.properties file in a root folder, with java.runtime.version=11
Still jdk 8 is installed as seen in the picture
JAVA_HOME
Not sure what am I missing here?
For any one who is still facing this issue. My problem was i was on a different branch so i had to run git push heroku yourbranch:master.
I would suggest using Docker. It will easier to configure and you will be able to run it locally and it should behave the same as in Heroku. Moreover Heroku has good support for deploying using Docker.
You can check out deploying process here: https://devcenter.heroku.com/categories/deploying-with-docker
Process of building docker image will be different depending on what build system you use.

How to deploy an unmanaged plugin and restart the Neo4j server from maven?

I am trying to make my development process as automatic as I can.
I am using maven and got the deploy to work by simply putting the jar in my server folder when building the project (like this).
This works fine, but I still have to restart my server manually. I found this solution to run a command after install.
I can run neo4j to start the server, but can not find out how I can restart (or stop and then start). I tried neo4j restart and got the following output:
This command is not supported by the Neo4j utility. Please try "Neo4j.bat help" for more info.
When running Neo4j.bat help I get the following output:
Proper arguments for this command are: help console
Something does not seem right... I am using Neo4j version 2.2.0.
This could be a bad approach, if so let me know. How do you setup your environment when developing unmanaged extensions?
You can use chaining of commands
neo4j stop & neo4j start
If you run on windows I recommend you to upgrade to latest version of Neo4j, because it supports PowerShell instead of old batch files.
http://neo4j.com/docs/stable/powershell.html
In Neo4j 2.3.0 you have powershell modules that should allow you this kind of functionality.
http://neo4j.com/docs/stable/powershell.html

How to create an enterprise application client with Netbeans 7.4 and JBoss 7?

I try to create an enterprise application client with JBoss by following this official tutorial (based on Glassfish):
https://netbeans.org/kb/docs/javaee/entappclient.html
but I get this error message: Error: Unable to access jarfile C:\EntAppClient\${client.jar}
As far as I know, Netbeans IDE supports JBoss 7 since its version 7.3 RC1 and I use Netbeans 7.4. This feature seemed already broken for a long time according to this thread:
http://forums.netbeans.org/topic40270.html
It is expected to work as Netbeans is intended to support other application servers. However, some Glassfish specific properties are hardcoded inside the Ant build scripts and the property client.jar is set if and only if j2ee.clientName isn't set which isn't my case (it's set to EntAppClient.jar).
When I set client.jar to ${dist.dir}/${j2ee.clientName}, I go a bit further but Netbeans doesn't find the JAR of the remote interface and the Glassfish specific agent class loader org.glassfish.appclient.client.acc.agent.ACCAgentClassLoader.
How can I make it work? I'm going to try to fix build-impl.xml to use the correct classpath and I hope to find a smarter solution.

Can't deploy vaadin project

i have a little vaadin project for a school project that originally deployed well and worked.
i am using jboss as 7.1.1, vaadin7 and jdk8. My target platform is a raspberry pi running raspbian os.
so i am using the pi4j library to access the gpio interface of the raspberry and everything worked just fine until i implemented a check for null when creating a new instance of the web page. at first the error was because somehow the "jboss/standalone/deployments/roboterarm.war/WEB-INF/..../classes" directory became empty. afterwards the error came to eclipse as i could not use the pi4j library anymore. i did not touch the libraries and i can't figure out why it suddenly stopped working. i reinstalled eclipse, jboss and redownloaded all the libraries but i still can not use anything, not even in normal java applications!
afterwards i grabbed a copy from SVN that used to work normally but no luck there either, i can not use the pi4j jar-files.
everything looks fine to me there, yet it fails to give me code completion or compilation
i also tried creating a new vaadin project and c&p'ing the source code into the new project but the jar files are not recognized there either.
What am i doing wrong? how can i fix this? thanks in advance!
Eclipse buildpath, clearly indicates that your JRE is not properly added. Add your JRE to your build path, using the option Add Library.

Categories

Resources