users@glassfish.java.net

Re: Glassfish 3.1 fails to add instance to cluster on Debian

From: Scott Fordin <scott.fordin_at_oracle.com>
Date: Tue, 24 May 2011 12:13:43 -0400

On 05/24/2011 11:58 AM, Tom Mueller wrote:
> Typically this problem is due to how the .profile and .bashrc or .cshrc
> files are setup. When you login to the host, a different startup file is
> executed compare with when you just execute a remote command using ssh.
> Try the following:
>
> ssh nodehost java -version
>
> I expect that you'll get an error message that says java isn't found.
> Trying setting the PATH in your startup file, e.g., .bashrc, and then
> try this again. Once you can execute java using the command above, then
> you'll be able to create and start instances too.

This issue has been addressed in the soon-to-be-published 3.1.1 Release
Notes, per JIRA issue GLASSFISH-13023
(http://java.net/jira/browse/GLASSFISH-13023). To wit:

------------------------------- Snip -------------------------------
All remote asadmin subcommands require the correct version of Java to be
available on the affected remote machine. For example, when creating a
cluster or server instance on a remote machine, the remote machine uses
its local default Java installation, not the Java installation that is
on the DAS. Errors will therefore occur if the remote machine uses the
wrong Java version.

Depending on the remote subcommand, the errors may not occur when the
subcommand is executed, but may occur later, when interacting with a
configuration or resource created or modified by the subcommand. For
example, when creating a clustered server instance on a remote machine,
the error may only first appear when you attempt to deploy an
application on that server instance.

This issue is more likely to be encountered when GlassFish Server is
installed on the remote server by means of a ZIP file package rather
than a self-extracting installer run in GUI mode. This is because the
GUI installer gives you the option to specifically choose your Java
version, whereas you do not have that option when simply unzipping a ZIP
file.

Depending on what shell is invoked via SSH on the remote host, the
JAVA_HOME and PATH environment variables may need to be explicitly set
in .bashrc, .cshrc, or some other shell configuration file. This
configuration file may differ from the one that is used when you log in
to the machine, such as .profile.

Alternatively, you can specifically set the Java path with the AS_JAVA
property in the in the <install-dir-parent>/glassfish/config/asenv.conf
file.
------------------------------- Snip -------------------------------

Hope this helps,

Scott

-- 
Scott Fordin | Principal Technical Writer
Oracle GlassFish&  Fusion Middleware
8 Van De Graaff | Burlington, MA 01803
Phone: +1.781.442.2021 | Mobile: +1.603.459.3836
Oracle | http://www.oracle.com