Glassfish hangs on OS X 10.5/Java 6 - java

I want to play around with glassfish on a Mac, but I'm having trouble getting it to start.
I've followed the installation instructions and created a default domain, which seemed to go fine, but when I try to start it (asadmin start-domain domain1) it just sits there:
[kris#Macintosh-2:~/glassfish] ./bin/asadmin start-domain domain1
Starting Domain domain1, please wait.
Default Log location is /Users/kris/glassfish/domains/domain1/logs/server.log.
Redirecting output to /Users/kris/glassfish/domains/domain1/logs/server.log
The log contains nothing but the command to launch the server:
Mar 12, 2009 7:09:40 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
<crapload of system properties>
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/Users/kris/glassfish/domains/domain1/logs/jvm.log
-cp
/Users/kris/glassfish/lib/jhall.jar:/Users/kris/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
Eventually, asadmin gives up waiting:
Timeout waiting for domain domain1 to go to starting state.
CLI156 Could not start the domain domain1.
This is using glassfish v2.1, but I get similar behaviour on v3 prelude. I've also tried both java 5 and 6. I'm at a loss as to what sort of debugging to do as it doesn't seem to be even getting off the ground.

I was able to start my glassfish for the first time, but the second time, it just gives me that weird error message that it could not start the domain.
Googling around, there was mention of a lock file in the imq.
Check if you have a file 'lock' in "/glassfish/domains/domain1/imq/instances/imqbroker/". If there is one, delete it, and then try to start glassfish again.

Also on the JMS front, have you tried changing your broker from EMBED to LOCAL in your domain.xml? I seem to remember that help on OS X.

Have you perhaps moved the glassfish installation dir since you first started it up? GF gets very confused about caching when you do this. Solution here.

Related

Tomcat9 creates files in /tmp/systemd-private*** path instead of my given path [duplicate]

I'd like for my webapp which is deployed as a war ROOT.war to have write access to /var/www/html/static/images so that it can write uploaded and converted images to that folder so nginx can serve it statically. Currently it doesn't work and triggers a java.nio.file.FileSystemException exception together with the Filesystem is read-only message.
But the filesystem is not read-only and is in great condition. The folder has already been chmodded 777.
Extra info:
The tomcat setup is running on an Ubuntu 18.04 Azure VM with managed disk. The folder is residing on an Ext4 formatted drive
Let's start with: chmod 777 is great for testing, but absolutely unfit for the real world and you shouldn't get used to this setting. Rather set the owner/group correctly, before you give world write permissions.
Edit: A similar question just came up on the Tomcat mailing list, and Emmanuel Bourg pointed out that Debian Tomcat is sandboxed by systemd. Read your /usr/share/doc/tomcat9/README.Debian which contains this paragraph:
Tomcat is sandboxed by systemd and only has write access to the
following directories:
/var/lib/tomcat9/conf/Catalina (actually /etc/tomcat9/Catalina)
/var/lib/tomcat9/logs (actually /var/log/tomcat9)
/var/lib/tomcat9/webapps
/var/lib/tomcat9/work (actually /var/cache/tomcat9)
If write access to other directories is required the service settings
have to be overridden. This is done by creating an override.conf file
in /etc/systemd/system/tomcat9.service.d/ containing:
[Service]
ReadWritePaths=/path/to/the/directory/
The service has to be restarted afterward with:
systemctl daemon-reload
systemctl restart tomcat9
Edit 2022: Note that these are the 2019 paths - validate the file locations for later versions. From the comments to this answer (thank you to V H and Ng Sek Long) here are some updates:
In current Ubuntu file is here: sudo vi /etc/systemd/system/multi-user.target.wants/tomcat9.service – V H Feb 26, 2022 at 19:55
Mine (Ubuntu 20) is installed here /lib/systemd/system/tomcat9.service smh everybody use a different path. – Ng Sek Long Mar 28, 2022 at 8:36
End of edit, continuing with the passage that didn't solve OP's problem, but should stay in:
If - all things tested - Tomcat should have write access to that directory, but doesn't have it, the error message points me to an assumption: Could it be that
Tomcat is running as root?
The directory is mounted through NFS?
The default configuration for NFS is that root has no permissions whatsoever on that external filesystem (or was it no write-permission? this is ancient historical memory - look up "NFS root squash" to get the full story)
If this is a condition that matches what you are running, you should stop running Tomcat as root, and rather run it as an unprivileged user. Then you can set the permissions on the directory in question to be writeable by your tomcat-user, and readable by nginx, and you're done.
Running Tomcat as root is a recipe for disaster: You don't want a process that's available from the internet to run as root.
If these conditions don't meet your configuration: Elaborate on the configuration. I'd still stand by this description for others who might find this question/answer later.

SAP Hybris on Mac OS Catalina

I just update my Mac OS to Catalina version and my Hybris server stopped turning on. So on command ./hybrisserver.sh start I get this
MacBook-Pro-Sasha:platform sashayukhimchuk$ ./hybrisserver.sh start
Starting hybrisPlatform on Tomcat...
/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/wrapper.sh:
line 1388: 4614 Killed: 9
"/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/./wrapper-macosx-universal-64"
"/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/conf/wrapper.conf"
wrapper.syslog.ident="hybrisPlatform"
wrapper.pidfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.pid"
wrapper.daemonize=TRUE wrapper.name="hybrisPlatform"
wrapper.displayname="hybrisPlatform on Tomcat"
wrapper.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.status"
wrapper.java.statusfile="/Users/sashayukhimchuk/hybris/CXCOMM181100P_1-70004085/hybris/bin/platform/tomcat/bin/hybrisPlatform.java.status" wrapper.script.version=3.5.29 --
Waiting for hybrisPlatform on Tomcat..................
WARNING: hybrisPlatform on Tomcat may have failed to start.
I had to allow the wrapper-macosx-universal-64 and some other libs in Systemsettings > Security > General while starting the Hybris Server.
Remove the app (and all the necesary side apps) from Mac OS quarantine:
xattr -d com.apple.quarantine wrapper-macosx-universal-64
You can find the blocked wrapper under /bin/platform/tomcat/bin
If you get an error saying that the wrapper-macosx-universal-64 or libwrapper-macosx-universal-64.jnilib cannot be opened because the developer cannot be verified, proceed as follows:
Go to system preferences security and privacy
Click the General tab.
In the list, select the executable that you tried to run, and unblock it.
Run the command again.
to fix it, u need new tomcat in bin/platform. I just create new hybris project with .zip and copy tomcat folder to my hybris project and after some confirming about security in Mac OS setting, it works
It's probably could happen as a result that wrapper-macosx-universal-64 was deleted by macOS during a security check.
You can copy the file from the original path in hybris zip archive -
hybris-dir/bin/platform/tomcat/wrapper-macosx-universal-64
to your installation and follow the actions related to macos developers security check to allow starting the tomcat

How to pass configuration argument on jboss

I added db2 driver, edited module.xml in JBOSS_HOME/modules/com/ibm/main.
In this folder, I have
db2jcc4.jar
db2jcc_lecense_cu.jar
db2jcc_license_cisuz.jar
module.xml
After having these, I tried to launch JBoss console on Powershell
.\standalone.bat --server-config=standalone-full-ha.xml -Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl
which I tried to handle ORB exception(related to this https://bugs.openjdk.java.net/browse/JDK-6497156)
But my jboss container is not launched. I checked the log file,
2019-09-17 296 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code
and error display on Powershell
WFLYSRV0073: Invalid option '.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl'
It works on command prompts though. I am wondering it is correct way to pass argument like this. Thanks in advance!
Edit
I am using Java8, JBoss7.1
Powershell has issues with -D. Try this instead, notice the " around -D
.\standalone.bat --server-config=standalone-full-ha.xml "-Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl"

Glassfish - Unable to update http port. Server shut down

I have a problem with Glassfish 4 that occurs when I try to start it.
I have searched for this error only but I haven't found a similar case.
Here's the error log:
Unable to update http port. Server shut down.
org.eclipse.core.runtime.CoreException:
Could not save to L/Servers/GlassFish 4 at localhost [myDomain].server.
But even though I've had this error, in Eclipse, the state of the Glassfish server is said to [Started, Republish] and I can access the Glassfish admin console.
Have any idea about what is going on there ?
Thanks for your consideration.
It's an old question but the issue still happens on Eclipse 2019-09 so here's what I found and a workaround for it.
It's caused by hitting the Switch Location button on server properties
That will remove this element on <workspace>/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml
<server auto-publish-setting="1"
glassfish.adminserverportnumber="4948"
glassfish.debugport="4909"
glassfish.serverportnumber="4980"
glassfish.domainpath="/home/luis.munoz/projects/bin/glassfish3/glassfish/domains/domain-test/domain-test-1"
hostname="localhost"
id="GlassFish 3.1 [domain-test-1]"
name="GlassFish 3.1 [domain-test-1]"
runtime-id="GlassFish 3.1"
server-type="glassfish.server"
server-type-id="glassfish.server"
start-timeout="240" stop-timeout="240" timestamp="0" />
runtime-id must match the one in .plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs
WORKAROUND:
Close Eclipse since servers.xml is cached.
Add the element back on servers.xml to fix the error. Change details as needed.
Start Eclipse
Server properties will show Location: [workspace metadata] again and the error message will not appear when starting Glassfish.
are you using 8080 port ?
ensure that no other processes are listening, if yes - kill em.
netstat -a -n -o | find "8080"

Unable to start Neo4j on Windows, no error messages

I'm using the following on Windows 7:
neo4j-community-1.9.2
Java 7 Update 25
I have Windows Firewall disabled.
When I start Neo4j.bat, both as Administrator and normally, I get the following message:
c:\Tools\neo4j\bin>Neo4j.bat
28/07/13 9:34:27 PM org.neo4j.server.AbstractNeoServer INFO: Setting startup tim
eout to: 120000ms based on -1
A blank Java console window pops up, no messages, then the window disappears after a minute or so.
When I go to http://localhost:7474/, I just get a server not found error.
If I try to install it as a service, the service wouldn't start.
Any ideas what I need to do to start Neo4j? I see here that Neo4j 1.9 does support Java 7:
http://blog.neo4j.org/2013/03/neo4j-19m05-released-wrapping-up.html
base.bat correctly points to windows-service-wrapper-5.jar, so not the windows-service-wrapper-*.jar problem that some people have had in the past. It would be helpful if it outputted an error message.
I just tried it with neo4j 2.0 milestone, and it didn't make any difference. The Java window pops up with no messages, http://localhost:7474/ gets a server not found error, then the Java window closes after a minute or two.
I added JAVA_HOME and JRE_HOME system variables, made no difference. I think I would get an error if Neo4j was not able to locate Java anyway.
I've fixed it.
With help from Neo4j's Google Group, I looked at the logs in data/logs/*.log and data/graph.db/messages.log, and found the following exception:
Caused by: java.rmi.server.ExportException: Port already in use: 1337; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
Once I disabled my other service that uses that port, Neo4j's web admin at http://localhost:7474 worked. I then found out port 1337 is used by Neo4j's remote shell, I disabled it by adding enable_remote_shell = false to neo4j.properties, then I was able to have both Neo4j and my other service running.
I'm using the version 2.2.1 community edition of Neo4j on Windows 7, Java 1.8 update 45
In my case the log file messages.log was under default.graphdb directory. In there, you'll see the root cause of the problem.

Categories