How to Install Glassfish
A thread
https://abs.twimg.com/emoji/v2/... draggable="false" alt="⬇️" title="Pfeil nach unten" aria-label="Emoji: Pfeil nach unten"> https://www.timehorse.com/2020/10/15/how-to-install-glassfish/">https://www.timehorse.com/2020/10/1...
A thread
Glassfish ( https://javaee.github.io/glassfish/ )">https://javaee.github.io/glassfish... is a Java ( https://www.java.com/en/ )">https://www.java.com/en/"... Library for creating Java Message Queues ( https://www.oracle.com/technical-resources/articles/java/intro-java-message-service.html).">https://www.oracle.com/technical...
Regular readers my be surprised to know I am also a Java coder since I usually talk about Python ( https://www.python.org/ )">https://www.python.org/">... and C++ ( https://www.cplusplus.com/ ),">https://www.cplusplus.com/">... but just as I occasionally speak Italian ( https://en.wikipedia.org/wiki/Italian_language),">https://en.wikipedia.org/wiki/Ital... I am multilingual.
In this case, though, this is all about Java.
Unfortunately, despite what it& #39;s billed to be, Glassfish 5 isn& #39;t as turn-key an application as it appears to be and therefore I wanted to fill in the gaps for would be message queuers—whatever the word is—who may be struggling.
Unfortunately, despite what it& #39;s billed to be, Glassfish 5 isn& #39;t as turn-key an application as it appears to be and therefore I wanted to fill in the gaps for would be message queuers—whatever the word is—who may be struggling.
First, let& #39;s download Glassfish: https://javaee.github.io/glassfish/download
When">https://javaee.github.io/glassfish... you check out the readme ( https://en.wikipedia.org/wiki/README )">https://en.wikipedia.org/wiki/READ... file, you& #39;ll see the following text:
When">https://javaee.github.io/glassfish... you check out the readme ( https://en.wikipedia.org/wiki/README )">https://en.wikipedia.org/wiki/READ... file, you& #39;ll see the following text:
“2. Starting GlassFish
=====================
The & #39;asadmin& #39; command-line utility is used to control and manage GlassFish (start, stop, configure, deploy applications, etc).
=====================
The & #39;asadmin& #39; command-line utility is used to control and manage GlassFish (start, stop, configure, deploy applications, etc).
To start GlassFish, just go in the directory where GlassFish is located and type:
On Unix: glassfish5/glassfish/bin asadmin start-domain
On Windows: glassfish5\glassfish\bin asadmin start-domain
After a few seconds, GlassFish will be up and ready to accept…
On Unix: glassfish5/glassfish/bin asadmin start-domain
On Windows: glassfish5\glassfish\bin asadmin start-domain
After a few seconds, GlassFish will be up and ready to accept…
…requests. The default & #39;domain1& #39; domain is configured to listen on port 8080. In your browser, go to http://localhost:8080 to see the default landing page.
To manage GlassFish, just go to web administration console: http://localhost:4848” – The GlassFish README.txt file.
To manage GlassFish, just go to web administration console: http://localhost:4848” – The GlassFish README.txt file.
That& #39;s all well and good, but, if you& #39;ve never used Glassfish before, when you follow those steps, you& #39;ll see the following cryptic error:
“Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.glassfish.hk2.api.DynamicConfigurationService.createDynamicConfiguration()" because "dcs" is null
at…
at…
…com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator( http://AbstractModulesRegistryImpl.java:152"> http://AbstractModulesRegistryImpl.java:152 )
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator( http://AbstractModulesRegistryImpl.java:144"> http://AbstractModulesRegistryImpl.java:144 )
at…
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator( http://AbstractModulesRegistryImpl.java:144"> http://AbstractModulesRegistryImpl.java:144 )
at…
…com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator( http://AbstractModulesRegistryImpl.java:218"> http://AbstractModulesRegistryImpl.java:218 )
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator( http://AbstractModulesRegistryImpl.java:224"> http://AbstractModulesRegistryImpl.java:224 )
at…
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator( http://AbstractModulesRegistryImpl.java:224"> http://AbstractModulesRegistryImpl.java:224 )
at…
…com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator( http://StaticModulesRegistry.java:88"> http://StaticModulesRegistry.java:88 )
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator( http://CLIContainer.java:217"> http://CLIContainer.java:217 )
at…
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator( http://CLIContainer.java:217"> http://CLIContainer.java:217 )
at…
…com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand( http://CLIContainer.java:255"> http://CLIContainer.java:255 )
at com.sun.enterprise.admin.cli.CLICommand.getCommand( http://CLICommand.java:231"> http://CLICommand.java:231 )
at com.sun.enterprise.admin.cli.AdminMain.executeCommand( http://AdminMain.java:371"> http://AdminMain.java:371 )
at…
at com.sun.enterprise.admin.cli.CLICommand.getCommand( http://CLICommand.java:231"> http://CLICommand.java:231 )
at com.sun.enterprise.admin.cli.AdminMain.executeCommand( http://AdminMain.java:371"> http://AdminMain.java:371 )
at…
…com.sun.enterprise.admin.cli.AdminMain.doMain( http://AdminMain.java:306"> http://AdminMain.java:306 )
at org.glassfish.admin.cli.AsadminMain.main( http://AsadminMain.java:57"> http://AsadminMain.java:57 )” – $ glassfish5/glassfish/bin/asadmin start-domain
Clearly, Glashfish is not a turn-key installation.
at org.glassfish.admin.cli.AsadminMain.main( http://AsadminMain.java:57"> http://AsadminMain.java:57 )” – $ glassfish5/glassfish/bin/asadmin start-domain
Clearly, Glashfish is not a turn-key installation.
From here, it was up to me. Google ( https://www.google.com/ )">https://www.google.com/">... was no help. "dcs" is null as a search term was too generic and including the full, topmost error only gave a page with sample Java code, not how to actually start the server.
To the best of my ability, I believe the error is related to the DynamicConfigurationService object—that& #39;s what dcs stands for.
Looking through the QuickStart document I thought maybe it& #39;s because I didn& #39;t install to my home directory, ~, but moving it there produced the same results.
The next thing to try is to downgrade to Java 8 ( https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html).">https://www.oracle.com/java/tech...
I& #39;m not fond of Java 8 as it was one of the last Java versions to be 32-bit—which is incompatible with MacOS Catalina ( https://www.apple.com/macos/catalina/ )—but">https://www.apple.com/macos/cat... fortunately, Oracle ( https://www.oracle.com/ )">https://www.oracle.com/">... provides a 64-bit, Catalina-compatible version.
Once Java 8 was installed, I just needed to tell my terminal to use that version instead of the default one. First, I needed to get the location for Java 8 in the list of installed Java VMs:
“$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
15, x86_64: "OpenJDK 15" /Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
13.0.4, x86_64: "Zulu 13.33.25"…
Matching Java Virtual Machines (3):
15, x86_64: "OpenJDK 15" /Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
13.0.4, x86_64: "Zulu 13.33.25"…
…/Users/username/Library/Java/JavaVirtualMachines/azul-13.0.4/Contents/Home
1.8.0_261, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
/Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
$” – What Java VMs are…
1.8.0_261, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
/Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
$” – What Java VMs are…
…available?
Finally, I had to set the local Terminal to use the Java 8 VM:
“$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_261`
$” – Set the Java VM to Java 8.
Success!
Finally, I had to set the local Terminal to use the Java 8 VM:
“$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_261`
$” – Set the Java VM to Java 8.
Success!
“$ glassfish5/glassfish/bin/asadmin start-domain
Waiting for domain1 to start ......
Successfully started the domain : domain1
domain Location: /Users/puyenpa/Dropbox/Puyenpa/glassfish5/glassfish/domains/domain1
Log File:…
Waiting for domain1 to start ......
Successfully started the domain : domain1
domain Location: /Users/puyenpa/Dropbox/Puyenpa/glassfish5/glassfish/domains/domain1
Log File:…
…/Users/puyenpa/Dropbox/Puyenpa/glassfish5/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
$” – Starting Glassfish!
I hope that helps and I am so happy with my new job!
Admin Port: 4848
Command start-domain executed successfully.
$” – Starting Glassfish!
I hope that helps and I am so happy with my new job!
This thread can be read here: https://www.timehorse.com/2020/10/15/how-to-install-glassfish/">https://www.timehorse.com/2020/10/1...