Glassfish5 not starting - server

i have tomcat working fine, the error is not even about the port, which i know how to change, is this some sort of java version compatibility problem?
i'm a student so i don't know much
here's the output
$ asadmin start-domain domain1
Exception in thread "main" java.lang.NullPointerException
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
the command $ asadmin list-applications says the server is not up
i'm on Mx Linux fully updated
$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)
i haven't done anything yet, i can't find any problem similar to this on google

It was the JDK version
Inside netbeans when i clicked on Start to start the server, it says something about JDK 11, netbeans has a feature that let's you download many open JDK versions, i downloaded a random openJDK8 version and it worked
I don't know how to edit the JDK version manually or from any other IDE though, but my (video) class is using netbeans so for now i'm ok (they didn't teach on video because the video is 2 years old so it's outdated)

Related

sdkman! How to manage pre-existing JDK?

I wanted to try Java 19 and have easy switching back to the Java 17 that I have already installed.
So, I installed sdkman but it knows nothing of the previous Java.
Found the "install local" command, used it to link the java 17 location to a unique name and sdkman seems happy, as it reports "Done installing!".
After that the "sdk current java" returns "Not using any version of java".
So then I tried "sdk use java [my unique name]. That was also accepted.
But still the "sdk current java" response is unchanged.
Have I misunderstood how this should work? I want to be sure sdkman knows what is there already before I add another Java.
Thanks for your advice!
Terminal commands follow (Kubuntu 22.04)
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bellsoft /usr/lib/jvm/bellsoft-java17-full-amd64
Invalid version! 17.0.4.1-Bellsoft with length 17 exceeds max of 15!
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bell /usr/lib/jvm/bellsoft-java17-full-amd64
Linking java 17.0.4.1-Bell to /usr/lib/jvm/bellsoft-java17-full-amd64
Done installing!
john#NUC8i3BEH:~$ sdk list
john#NUC8i3BEH:~$ sdk current
No candidates are in use
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$ sdk list java
john#NUC8i3BEH:~$ sdk use java 17.0.4.1-Bell
==== BROADCAST =================================================================
* 2022-09-21: neo4jmigrations 1.12.0 available on SDKMAN! https://github.com/michael-simons/neo4j-migrations/releases/tag/1.12.0
* 2022-09-21: micronaut 3.7.0 available on SDKMAN!
* 2022-09-20: quarkus 2.12.3.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.12.3.Final
================================================================================
Setting java version 17.0.4.1-Bell as default.
Using java version 17.0.4.1-Bell in this shell.
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$
OK, I should have tried harder.
I installed Java 19 with sdkman then the command "sdk default java [my old version]" switches back as required.

java web start fails to locate java runtime

Hi I am trying to run javaws but it prompts:
To open this Web Start application you need to download the Java Runtime Environment.
I am sure JRE is installed, maybe javaws does not find it, how do I fix that?
Johns-MacBook-Pro:~ johnmactavish$ java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Johns-MacBook-Pro:~ johnmactavish$ javaws
No Java runtime present, requesting install.
Unable to locate a Java Runtime to invoke.
Johns-MacBook-Pro:~ johnmactavish$
Java Web Start (javaws) was deprecated in Java 9 and removed in Java 11.
As you are using java 13, you can either downgrade from 13 to 8, or look for alternatives.
Perhaps an alternative such as https://openwebstart.com/ can help you out with that.
P.S: In case you're using tools to manage version such as sdkman or such, there might be the case where it's also not available in SDKs # version 8 provided by sdkman.

SIGSEGV signal while executing "Eclipse Application" run configuration for my Xtext project

Since my computer has been updated to Mojave (macOS), I get the following error when I am trying to execute an Xtext project (Run As -> Eclipse Application):
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007fff51115248, pid=10464, tid=775
JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
Problematic frame:
C [CoreFoundation+0x8248] CFDictionaryGetValue+0xb
No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as:
/Applications/Eclipse.app/Contents/MacOS/hs_err_pid10464.log
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Unfortunately, I do not have so much information to share.
Here my setup:
Mojave, v. 10.14.1
Eclipse DSL Tools, v: 2018-09 (4.9.0), Build id: 20180917-1800
java version "11.0.1" 2018-10-16 LTS, Oracle one
What I have tested:
Running the ulimit -c unimited command
Reinstalling Eclipse
Reinstalling my JDK. I also tested on OpenJDK.
Running on a fresh computer. I don't have the bug on macOs Sierra.
I tested the solution mention here:
how to fix “Failed to write core dump. Core dumps have been disabled” error while running java
Thanks for your help.
#Christian Dietrich: many thanks for the link!
Here the current workaround explained in the link: to add the '-nosplash' in Arguments tab of run configuration.

Error when open eclipse - MAC

I have installed eclipse on my iMac and when I try to open it, it gives me this error:
Failed to find a Main Class in
"/Applications/Eclipse.app/Contents/MacOS//../Eclipse/ plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar".
On my MacBook Pro, everything works fine, but I have done nothing different.
I have checked other posts, but most of them refer to a windows OS. There was an answer which said that it can just open when everything is in an English folder and this is true for me!
Thanking you in advance!
I came across this error after installing Eclipse PDT.
Open your terminal and run the version command: java -version.
If your java version is below 1.8, you will have to update your Java
Runtime Environment to at least 1.8.0 by installing an updated JDK
here.
Then re-run the java version command and your version
should be updated.
You should now be able to install and run
Eclipse.
I have the same issue, but on my MacBookPro. I first installed eclipse Photon, which when starting up prompted me to install Java 6, which I did from https://support.apple.com/kb/DL1572?locale=en_US
Then I also installed the latest JRE (jre-8u171-macosx-x64 as of yesterday). When running eclipse again I started getting this error. Then I tried to run from the command line, and got this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/equinox/launcher/Main : Unsupported major.minor version 51.0
When googling that, the answers said that the reason for that is that the Oracle installer does not update the symlink in /usr/bin, which seemed to be confirmed by the fact that running java -version returned this:
java -version
java version "1.6.0_65"
The solutions I found for that were not feasible in MacOS starting in version El Capitan, and I am on High Sierra, so I followed the instructions in this post to fix that, and it worked, now I get:
java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
After all of this, however, I get the same "Failed to find a Main Class" error on the dialog as reported initially here, and the same "UnsupportedClassVersionError" on the CLI that I had when the system was still on java 6, so now I am still stuck and out of ideas.
EDIT: FIXED IT!!
I kept thinking that the problem was the java version, it was somehow still using java 6 (which I had installed due to the initial prompt).
So I followed the instructions here to remove what I had installed for the alleged java 6 issue. Then I found this post in the eclipse forums, which stated at the end (comment added by Eric Rizzo on Tue, 14 February 2017 21:56) that this is not an Eclipse message, but rather an OS message, and that one should NOT do that as apple messed things up with that patch. And then it goes to explain that one should install java 8 JDK (NOT just the JRE as I had done). Once I removed Java 6 and installed the full java 8 JDK, it ran fine :)
You can edit the eclipse.ini with your vm configuration in the beginning of the file
-vm
/yourJvmPath/jdk-12.0.1.jdk/bin/java
cat /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini
-vm
/Users/SomeUser/jdk-12.0.1.jdk/bin/java
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1000.v20190125-2016
PD. It works with ApacheDirectoryStudio for MAC
This one works for me with MAC OS Mojave.
You can download the Java SE Development Kit 8u221 for mac from the below link.
jdk-8u221-macosx-x64.dmg
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Starting kafka on Linux or Win

I have tried for the last 10 hours to start the kafka server but I couldn't.
I managed to install zookeeper and run it on win10 but I had the
classpath is empty. please build the project first e.g. by running 'gradlew
jarall'
error.
So I installed ubuntu and the jre 9, zookeeper workd fine here ,too. But kafka does not. The latest error I get is:
[0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/home/emi/kafka/bin/../logs/kafkaServer-gc.log instead.
Unrecognized VM option 'PrintGCDateStamps'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I even switched to java 8 and tried different versions of kafka, but I can't get it going. In both cases I don't think it's a problem of environement variables for java since zookeeper works just fine: java -version returns
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Problem solved on Windows, probabily using the source file instead the scala compiled was the problem