1

I'm setting up a vagrant machine with Glassfish 4.1 using Ansible. I tried to use asadmin to start the domain, etc. According to the logs, there is no error but Glassfish doesn't starts.

changed: [vagrant] => {"changed": true, "cmd": "/opt/glassfish4/glassfish/bin/asadmin --user admin --passwordfile /opt/glassfish4/glassfish/bin/fich-password.txt start-domain", "delta": "0:00:12.558981", "end": "2015-09-12 09:30:48.805112", "rc": 0, "start": "2015-09-12 09:30:36.246131", "stderr": "", "stdout": "Waiting for domain1 to start ...........\nSuccessfully started the domain : domain1\ndomain  Location: /opt/glassfish4/glassfish/domains/domain1\nLog File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log\nAdmin Port: 4848\nCommand start-domain executed successfully.", "warnings": []}

I have been looking in Glassfish logs and there isn't any errors neither

When i try to run the script from the terminal it works ok, in fact, i set cron to start the domain on reboot and once i rebooted everything it's fine, even the enable-secure-admin command that i set in the script .

I have created a custom user and group for glassfish and setted the permissions of opt/glassfish4/

I've been struggling with this problem for 3 days. Any guidance you can provide it's welcome.

UPDATE: I used top command and apparently while the script is running, up to 3 instances of java starts. As far as i know that's not right, so it's not a surprise that glassfish got killed as fvu and alfredocambera said.

I don't know why that is happening,

Ansible Task

command: /opt/glassfish4/glassfish/bin/asadmin multimode --file /opt/glassfish4/glassfish/bin/glassfish-multimode.txt

glassfish-multimode.txt

start-domain

change-admin-password --user admin --interactive=false --passwordfile /opt/glassfish4/glassfish/bin/fich-password.txt

create-password-alias --interactive=false --user admin --passwordfile /opt/glassfish4/glassfish/bin/fich-password2.txt aliaspwadmin

enable-secure-admin --interactive=false --user admin --passwordfile /opt/glassfish4/glassfish/bin/fich-password2.txt

restart-domain

Thank you for your help

1
  • The logfile suggests that Glassfish was properly started, but that somehow it was stopped. If there's no trace of GF stopping in its log that means that something killed the GF process.
    – fvu
    Sep 12, 2015 at 10:42

1 Answer 1

0

I had a similar problem with Jenkins while doing some test on a vm with Ubuntu 14.04. The problem was that I had assigned too little RAM (256Mb) and Jenkins was starting but the kernel would kill the process a few seconds later. Try running:

dmesg

You can also check memory configuration (-Xms and -Xmx) on:

$GLASSFISH_HOME/config/asenv.conf
5
  • dmesg doesn't show anything related to Glassfish or Java. I though that asenv.conf was only to set directories if you have multiple JVM installed, for example. I'm trying later today raise values from -Xms and -Xmx in domain.xml configuration.
    – R5498
    Sep 20, 2015 at 9:36
  • You're right Glassfish and Java logs are not shown on dmesg. What you may see (as it was my case) is that the operating system killed the java process. Try: dmesg | grep -i --color java Sep 21, 2015 at 21:56
  • Nope, it doesn't show anything :(
    – R5498
    Sep 27, 2015 at 8:46
  • Ok, I had on domain.xml 512m of Xmx but only 512m in my Vagrant VM, i raised to 1024m the VM but i have still the same problem. It works once i reboot the machine but not the first time when running ansible.
    – R5498
    Sep 27, 2015 at 20:37
  • What user are you using to restart the service on the terminal? I mean, the one that makes the app work correctly. What user are you using to run the remote commands via ansible? Sep 28, 2015 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .