Glassfish 3.1.1 start fails - java

I'm running glassfish 3.1.1. on my development machine (using Windows XP) for some time now, but this morning it fails to start. Running
asadmin start-domain domain1
it reports:
Waiting for domain1 to start .....Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
Completed shutdown of GlassFish runtime
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NullPointerException
at com.sun.enterprise.server.logging.GFFileHandler.postConstruct(GFFileH
andler.java:159)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.
java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreato
r.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.jav
a:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.jav
a:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingIn
habitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantIm
pl.java:76)
at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
at java.util.AbstractList$Itr.next(AbstractList.java:358)
at com.sun.enterprise.server.logging.LogManagerService.postConstruct(Log
ManagerService.java:374)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.
java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreato
r.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.jav
a:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.jav
a:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingIn
habitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantIm
pl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.ja
va:229)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartu
p.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.
java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishI
mpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(Glass
FishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(O
SGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:117)
... 6 more
However, the server.log reads:
Jan 16, 2
012 10:59:14 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
Information: JVM invocation command line:
C:\Programme\Java\jdk1.7.0\bin\java.exe
-cp
C:/glassfish3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:C:/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.keyStore=C:\glassfish3\glassfish\domains\domain1/config/keystore.jks
-Djava.awt.headless=true
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=C:\glassfish3\glassfish/modules/endorsed;C:\glassfish3\glassfish/lib/endorsed
-Dfelix.fileinstall.bundles.startTransient=true
-Djavax.net.ssl.trustStore=C:\glassfish3\glassfish\domains\domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=C:\glassfish3\glassfish\domains\domain1/config/login.conf
-Dgosh.args=--nointeractive
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\glassfish3\glassfish/modules/autostart/
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\glassfish3\glassfish\domains\domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.aas.instanceRoot=C:\glassfish3\glassfish\domains\domain1
-Dcom.sun.aas.installRoot=C:\glassfish3\glassfish
-Djava.ext.dirs=C:\Programme\Java\jdk1.7.0/lib/ext;C:\Programme\Java\jdk1.7.0/jre/lib/ext;C:\glassfish3\glassfish\domains\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.fileinstall
-Djava.library.path=C:/glassfish3/glassfish/lib;C:/Programme/Java/jdk1.7.0/bin;C:/WINDOWS/Sun/Java/bin;C:/WINDOWS/system32;C:/WINDOWS;C:/Programme/NVIDIA Corporation/PhysX/Common;C:/oracle/product/10.2.0/client_1/BIN;C:/WINDOWS/system32/wbem;C:/Programme/Microsoft SQL Server/80/Tools/Binn;C:/WINDOWS/system32/WindowsPowerShell/v1.0;Y:/Maven-3.0.3/bin;C:/TP/ant/bin;Y:/Lotto/JOB-4.3.4-win32/JOB-4.3.4-bin/bin;C:/glassfish3/glassfish/bin
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
--host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--debug=false,,,--domaindir,,,C:\glassfish3\glassfish\domains,,,domain1
-instancename
server
-verbose
false
-debug
false
-asadmin-classpath
C:/glassfish3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-type
DAS
-domaindir
C:/glassfish3/glassfish/domains/domain1
-read-stdin
true
Jan 16, 2012 10:59:14 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
Information: Successfully launched in 31 msec.
We updated to JDK7u2 on Friday, but I was able to start the domain afterwards. The log shows it is still using JDK1.7.0. anyway.
Any ideas?

You are seeing http://java.net/jira/browse/GLASSFISH-17161 which is a duplicate of GLASSFISH-17037. GLASSFISH-17037 is in the release notes.
The workaround is to run a CLI command after adjusting/changing the log levels in console.
%asadmin set-log-levels com.sun.enterprise.server.logging.GFFileHandler=ALL
Specify the --target option for a server instance other than the domain administration server (DAS).
This has been fixed in 3.1.2 Release which is scheduled for FCS soon.

We resolved the issue by replacing the "logging.properties" file taken from domain1/config/default-config floder and placed into domains/domain1/config/

Try to uninstall the patch and run your Glassfish server.
Do you install the patch to the same directory? Maybe you have 2 JDK installed? I don't remember, but maybe Glassfish uses it's own JDK and so you have a clash. Anyway, I recommend you to go to JDK 1.7.0 and try again.
Check also windows environment variables as JAVA_HOME and PATH, maybe the problem is there.
You can also try to uninstall JDK completely, and install JDK 1.7.0_02 (patched one).

Related

Elastic APM Tomcat zip file or JAR manifest missing

I am trying to instrument our java webapp based on tomcat using Elastic APM. Tomcat starts fine without the javaagent but refuses to start with it. I do not see any logs in /var/log/tomcat. The following is the log:
Redirecting to /bin/systemctl status -l tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-04-17 01:45:36 UTC; 1s ago
Process: 25660 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=1/FAILURE)
Main PID: 25660 (code=exited, status=1/FAILURE)
arguments used: start
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: Ignoring option PermSize; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error opening zip file or JAR manifest missing : /opt/elastic/elastic-apm-agent-1.15.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument
tomcat.service: main process exited, code=exited, status=1/FAILURE
Unit tomcat.service entered failed state.
tomcat.service failed.
Has anyone faced this before? Any ideas what I could do to fix it?
did you try to give permissions to folder /opt/elastic ?
chmod -R uog+x

Netbeans set root as author

I'm running Linux Mint 18.3 cinnamon 64 bits
I just downloaded Apache NetBeans IDE 9.0
It wasn't necessary to run any script to install it, i just had to run the following command to launch it: sudo /opt/netbeans/bin/netbeans
Then enter my password and netbeans opens.
Then i made a launcher for the program because i didn't want to type the command and my password every time i open netbeans.
But the launcher didn't worked.
I realize that i didn't put "sudo" in the command that the launcher would execute so i put it. And didn't work.
I thought that it wasn't working because the launcher executes sudo /opt/netbeans/bin/netbeans but don't put the password.
After some research i end up adding star_man ALL=(ALL) NOPASSWD: /opt/netbeans/bin/netbeans at the end of /etc/sudoers and it finally works. But when i create a new project Netbeans sets root as the author of every file it creates.
For example, when i type ls -l in my project directory it outputs this:
-rw-r--r-- 1 root root 3527 sep 15 20:01 build.xml
-rw-r--r-- 1 root root 82 sep 15 20:01 manifest.mf
drwxr-xr-x 3 root root 4096 sep 15 20:01 nbproject
drwxr-xr-x 3 root root 4096 sep 15 20:01 src
Root is the group and the owner of every file an directory.
This causes that when Netbeans generates documentation files it put "root" instead my username.
Update:
I only can start neatbeans as root (sudo ./netbeans).
when i run neatbean without sudo from the terminal it looks like it's starting:screen shot
but then it closes.
This is the output:
>Log Session: Sunday, September 16, 2018 at 12:58:20 PM Eastern Daylight Time
>System Info:
Product Version = Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708)
Operating System = Linux version 4.15.0-34-generic running on amd64
Java; VM; Vendor = 10.0.1; Java HotSpot(TM) 64-Bit Server VM 10.0.1+10; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 10.0.1+10
Java Home = /opt/java/jdk-10.0.1
System Locale; Encoding = es_DO (nb); UTF-8
Home Directory = /home/star_man
Current Directory = /opt/netbeans
User Directory = /home/star_man/.netbeans/9.0
Cache Directory = /home/star_man/.cache/netbeans/9.0
Installation = /opt/netbeans/nb
/opt/netbeans/ide
/opt/netbeans/extide
/opt/netbeans/java
/opt/netbeans/apisupport
/opt/netbeans/websvccommon
/opt/netbeans/profiler
/opt/netbeans/harness
/opt/netbeans/javafx
/opt/netbeans/platform
Boot & Ext. Classpath =
Application Classpath = /opt/netbeans/platform/lib/boot.jar:/opt/netbeans/platform/lib/org-openide-modules.jar:/opt/netbeans/platform/lib/org-openide-util.jar:/opt/netbeans/platform/lib/org-openide-util-lookup.jar:/opt/netbeans/platform/lib/org-openide-util-ui.jar
Startup Classpath = /opt/netbeans/platform/core/core-base.jar:/opt/netbeans/platform/core/org-netbeans-libs-asm.jar:/opt/netbeans/platform/core/asm-all-5.0.1.jar:/opt/netbeans/platform/core/org-openide-filesystems.jar:/opt/netbeans/platform/core/org-openide-filesystems-compat8.jar:/opt/netbeans/platform/core/core.jar:/opt/netbeans/nb/core/org-netbeans-upgrader.jar:/opt/netbeans/nb/core/locale/core_nb.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.modules.netbinox]: Install area set to file:/opt/netbeans/
!SESSION 2018-09-16 12:58:21.698 -----------------------------------------------
eclipse.buildId=unknown
java.version=10.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_DO
!ENTRY org.eclipse.osgi 4 0 2018-09-16 12:58:21.706
!MESSAGE Error reading configuration: Permission denied
!STACK 0
java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
java.lang.RuntimeException: Permission denied
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:194)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
... 16 more
I find out that every file and directory under ~/.netbeans has root as owner and group. I thought that might be the problem so i changed the owner and group with ~/.netbeans $ sudo chown -R myusername: .netbeans/. And still i'm only able to run netbeans as root.
This is a basic unix permissions problem.
For reasons that escape me, you used sudo to launch the netbeans IDE.
- You should not have done that.
- You should not have needed to do that!
When you use sudo to run something, you are typically running as the root user. (That is what sudo does!)
So, naturally, the something (in this case, the netbeans application run using sudo) will create files and directories owned by the "root" user. So when you try to update them as a normal user, the operating system says "Nope: you don't own those files / directories, so you can't modify them.".
Solution: use the chown command to change the ownership of the files and the directories as required.
How? Read man chown, or look for a tutorial on how to change the ownership of a file.
Hint: you will need to use sudo when chowning ...
Hint 2: be very, very careful when you use sudo, because sudo has the power to trash your system if you make a mistake.

Glassfish fails to restart from web portail but works with asadmin command

With the systemctl command systemctl restart glassfish, GF restarts properly.
But when I try to restart via the Web portail https://127.0.0.1:4848 => server => Restart, it fails without any reason.
Glassfish stops but never restarts.
I'm using Glassfish 3.1.2.2 on Fedora 20 with java 1.6.0_45 x86_64.
(I've also tried with GF 4.1 on Centos 7 with java 1.8.0_66 x86_64 with the same result)
Here is my glassfish.service file:
[Unit]
Description=GlassFish Server
[Service]
User=glassfish
ExecStart=/usr/share/glassfish3/glassfish/bin/asadmin start-domain
ExecStop=/usr/share/glassfish3/glassfish/bin/asadmin stop-domain
ExecReload=/usr/share/glassfish3/glassfish/bin/asadmin restart-domain
Type=forking
[Install]
WantedBy=multi-user.target
Here is the service status systemctl status glassfish -l:
glassfish.service - GlassFish Server
Loaded: loaded (/usr/lib/systemd/system/glassfish.service; enabled)
Active: failed (Result: exit-code) since Wed 2016-07-27 11:17:22 CEST; 52s ago
Process: 9366 ExecStop=/usr/share/glassfish3/glassfish/bin/asadmin stop-domain (code=exited, status=0/SUCCESS)
Process: 877 ExecStart=/usr/share/glassfish3/glassfish/bin/asadmin start-domain (code=exited, status=0/SUCCESS)
Main PID: 1420 (code=exited, status=10)
Jul 27 10:24:20 decoder asadmin[877]: Successfully started the domain : domain1
Jul 27 10:24:20 decoder asadmin[877]: domain Location: /usr/share/glassfish3/glassfish/domains/domain1
Jul 27 10:24:20 decoder asadmin[877]: Log File: /usr/share/glassfish3/glassfish/domains/domain1/logs/server.log
Jul 27 10:24:20 decoder asadmin[877]: Admin Port: 4848
Jul 27 10:24:20 decoder asadmin[877]: Command start-domain executed successfully.
Jul 27 10:24:20 decoder systemd[1]: Started GlassFish Server.
Jul 27 11:17:22 decoder systemd[1]: glassfish.service: main process exited, code=exited, status=10/n/a
Jul 27 11:17:22 decoder asadmin[9366]: CLI306 Warning - The server located at /usr/share/glassfish3/glassfish/domains/domain1 is not running.
Jul 27 11:17:22 decoder asadmin[9366]: Command stop-domain executed successfully.
Jul 27 11:17:22 decoder systemd[1]: Unit glassfish.service entered failed state.
Here is the GF server.log:
[#|2016-07-27T11:17:20.805+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=23;_ThreadName=Thread-2;|Server restart initiated|#]
[#|2016-07-27T11:17:20.810+0200|WARNING|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=23;_ThreadName=Thread-2;|There should be only 1 primordial module but 0 primordial modules were found.|#]
Jul 27, 2016 11:17:21 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:PermSize=64m
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:/usr/share/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.keyStore=/usr/share/glassfish3/glassfish/domains/domain1/config/keystore.jks
-Djava.awt.headless=true
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=/usr/share/glassfish3/glassfish/modules/endorsed:/usr/share/glassfish3/glassfish/lib/endorsed
-Dfelix.fileinstall.bundles.startTransient=true
-Djavax.net.ssl.trustStore=/usr/share/glassfish3/glassfish/domains/domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=/usr/share/glassfish3/glassfish/domains/domain1/config/login.conf
-Dgosh.args=--nointeractive
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=/usr/share/glassfish3/glassfish/modules/autostart/
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=/usr/share/glassfish3/glassfish/domains/domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Duser.timezone=Europe/Zurich
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.aas.instanceRoot=/usr/share/glassfish3/glassfish/domains/domain1
-Dcom.sun.aas.installRoot=/usr/share/glassfish3/glassfish
-Djava.ext.dirs=/usr/java/jdk1.6.0_45/lib/ext:/usr/java/jdk1.6.0_45/jre/lib/ext:/usr/share/glassfish3/glassfish/domains/domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
Jul 27, 2016 11:17:22 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 3 msec.
I've no SELinux denials, here is the only trace:
type=SERVICE_STOP msg=audit(1467638602.044:1652): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="glassfish" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Setting selinux mode to permissive has no effect. I've absolutely no idea what's going wrong...
I've also tested GF 3.1.2.2 on Centos 6 and it works. Maybe it is related to systemctl (Fedora 20 and Centos 7 both uses systemctl by default)?
I had to leave the default admin port in 8080 and to add a "Port Forwarding" Firewall rule from 80 to 8080 and then the Glassfish restart works correctly.
From https://serverfault.com/a/112798/393296 and the FirewallD rule was (for Centos7)
sudo firewall-cmd --zone="dmz" --add-forward-port=port=80:proto=tcp:toport=8080 --permanent
sudo firewall-cmd --reload
Note: Remember to change your zone to your active one (in this case my active zone is dmz -- more info about FirewallD Centos7)
need to add to the section [Service] Restart=on-failure

Jenkins Fails to Start

We have a server running FreeBSD 9.1-p17 and Jenkins. I interact with it via PuTTY. We upgraded from Jenkins 1.458 to 1.570, via FreeBSD's ports collection. Due to this problem with starting, we decided to reinstall.
First we uninstalled Jenkins, then we moved the main Jenkins folder (/usr/local/eweru-dev/jenkins) to a backup location, and reinstalled (again, from the ports collection). When we reinstalled, we kept the user 'jenkins' from the last install.
Now, when we try to start Jenkins, we get an error. The error below is from when we try to start it by navigating to /usr/local/share/jenkins and typing java -jar jenkins.war. When we try to run it as a service (with service jenkins onestart), we get a very similar message.
The exception looks similar to the one from this blog, but I have tried connecting Jenkins to openjdk 7 and 8 to no avail.
Is information from our old Jenkins install finding its way into this one, breaking stuff? Or maybe there's some compatibility issue with FreeBSD 9.1.
Running from: /usr/local/share/jenkins/jenkins.war
webroot: $user.home/.jenkins
Jul 18, 2014 10:53:51 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jul 18, 2014 10:53:51 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-8.y.z-SNAPSHOT
Jul 18, 2014 10:53:55 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /homes/maxerdwien/.jenkins found at: $user.home/.jenkins
Jul 18, 2014 10:53:55 AM hudson.util.BootFailure publish
SEVERE: Failed to initialize Jenkins
hudson.util.AWTProblem: java.lang.NullPointerException
at hudson.WebAppMain.contextInitialized(WebAppMain.java:182)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at winstone.Launcher.<init>(Launcher.java:154)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:293)
at Main.main(Main.java:98)
Caused by: java.lang.NullPointerException
at sun.awt.X11FontManager.getDefaultPlatformFont(X11FontManager.java:779)
at sun.font.SunFontManager$2.run(SunFontManager.java:433)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:376)
at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at java.awt.Font.getFont2D(Font.java:490)
at java.awt.Font.getFamily(Font.java:1219)
at java.awt.Font.getFamily_NoClientCode(Font.java:1193)
at java.awt.Font.getFamily(Font.java:1185)
at java.awt.Font.toString(Font.java:1682)
at hudson.util.ChartUtil.<clinit>(ChartUtil.java:229)
at hudson.WebAppMain.contextInitialized(WebAppMain.java:181)
... 19 more
Jul 18, 2014 10:53:56 AM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Failed startup of context w.{,file:/home/maxerdwien/.jenkins/war/},/homes/maxerdwien/.jenkins/war
java.lang.NullPointerException
at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:63)
at hudson.util.BootFailure.publish(BootFailure.java:43)
at hudson.WebAppMain.contextInitialized(WebAppMain.java:244)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at winstone.Launcher.<init>(Launcher.java:154)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:293)
at Main.main(Main.java:98)
Jul 18, 2014 10:53:56 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector#0.0.0.0:8080
Jul 18, 2014 10:53:56 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Any help would be very appreciated. I've been googling for days.
The FreeBSD server is a headless server. So it doesn't have any graphics installed, including fonts.
For some reason, Jenkins tries to access fonts when it loads. This behavior can be suppressed by adding the option -Djava.awt.headless=true to the container JVM. This is the solution that worked for me.
It looks like some operating systems recognize this type of error, but FreeBSD does not. https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem
Check the permission of the jenkins folder. make sure the user run the jenkins server have the permission to access the folder.
For me -Djava.awt.headless=true didn't help at all. In fact, it's already specified in the Fedora default config, so chances are it's also in the default FreeBSD config. For me it missed the fontconfig package.
Details: http://vault-tec.info/post/98877792626/jenkins-service-unavailable
Am facing the same issue here, and adding -Djava.awt.headless=true doesn't help. I downloaded jenkins.war and tried running it using java -jar jenkins.war on windows 7 & 10 and it doesn't work. Am running java version,
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
The solution that worked for me,
1. Uninstall all versions of java and updates from your system
2. Cleanup temporary files and registry (I used CCLeaner)
3. Download latest version from Oracle
4. Install and like this comment if this solution worked for you !
Additionally, try removing the .jenkins directory, if possible

After Java OutOfMemoryError, Tomcat Won't Start

After running my App in Tomcat many times, I've maxed out the PermGen memory (a problem with my quartz servlet, I suspect) and Java threw a OutOfMemoryError. Normally, I just restart tomcat from time to time, but since this happened I'm unable to start/restart. Tomcat is running in our qa environment and is normally started/stoped/restarted via the sbin folder. I've tried to start tomcat using the alternative, catalina.sh run, but it says the port is being used! That led me to suspect that tomcat was already running, but when I try to stop it, I get this error:
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jan 19, 2014 3:10:58 PM org.apache.catalina.startup.Catalina
stopServer SEVERE: Catalina.stop: java.net.ConnectException:
Connection refused at java.net.PlainSocketImpl.socketConnect(Native
Method) at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at
java.net.Socket.connect(Socket.java:579) ...
So, if it's not started or stopped, then what state is tomcat in?! How can I bring it back to a startable state?
Update
As per Boris's comment, I've used ps auxfww to list processes and the only one with tomcat as the user is the following:
tomcat 5111 8.0 29.0 2052336 556512 ? Sl Jan17 221:48
/usr/java/latest/bin/java
-Djava.util.logging.config.file=/var/lib/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -javaagent:/usr/share/tomcat/newrelic/newrelic.jar -Xmx512m -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/share/tomcat/endorsed -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar
-Dcatalina.base=/var/lib/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.io.tmpdir=/var/lib/tomcat/temp org.apache.catalina.startup.Bootstrap start
For some reason, even as root, I can't delete the process. I use
sudo kill 5111
but the process is still listed after and tomcat still won't restart...
Read about kill here
sudo kill -9 5111 will do the work. Tomcat is binded to 8005 port: until you kill the process with a SIGKILL signal it won't release the port (and you are not allowed to start another tomcat on this port).

Categories