Can't launch glassfish server at boot

Discussion in 'Mac OS X Server, Xserve, and Networking' started by Leslie.Hon, Jun 20, 2012.

  1. macrumors member

    Joined:
    Apr 27, 2008
    Location:
    Hong Kong
    #1
    Hi, I setup a Lion Server and install Glassfish 3.1.2 using Homebrew
    Now I can start the service by manual
    Code:
    asadmin start-domain domain1
    Now I want to start the glassfish at server boot (without login)
    I tried to follow
    HERE to setup a launchd

    Here is my script (modified the path for homebrew)

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>com.sun.glassfish</string>
    <key>Disabled</key>
    <false/>
    <key>UserName</key>
    <string>appserver</string>
    <key>GroupName</key>
    <string>appserverusr</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/bin/asadmin</string>
    <string>start-domain</string>
    <string>domain1</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>
    When I reboot the server, it can't start the service , the log is shown below:

    Code:
    Jun 20 17:06:54 server com.apple.launchd[1] (com.sun.glassfish[2439]): Suspicious setup: User "appserver" maps to user: _appserver
    Jun 20 17:06:55 server com.apple.launchd[1] (com.sun.glassfish[2439]): Tried to setup shared memory more than once
    Jun 20 17:06:56 server com.sun.glassfish[2439]: The main GlassFish configuration file is missing.  This is where it is supposed to be: /usr/local/Cellar/glassfish/3.1.2/libexec/glassfish/domains/domain1/config/domain.xml
    Jun 20 17:06:56 server com.sun.glassfish[2439]: Command start-domain failed.
    Jun 20 17:06:56 server com.apple.launchd[1] (com.sun.glassfish[2439]): Exited with code: 1
    Jun 20 17:07:05 server sandboxd[2319] ([73]): mds(73) deny file-write-data /dev/dtracehelper
    :confused:
     
  2. macrumors newbie

    Joined:
    Jul 23, 2012
    #2
    Glassfish server on reboot

    Hi Leslie,

    Did you find a solution?

    thanks in advance,
    Adam.
     
  3. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    The first thing to check when diagnosing issues like this one is the working directory. Remember that when launchd starts something, its working directory will NOT be the same as the one used when you start things manually from the Terminal. This is especially troublesome if relative paths are used, as these break if the working directory isn't set to what is expected.
     

Share This Page