Skip to main content

Problems installing Glassfish on Ubuntu

10 replies [Last post]
kevinmacdonald
Offline
Joined: 2007-12-18

I have tried installing Glassfish using apt-get install glassfish, and everything works fine except that whenever I hit a JSP I get an because the app server is unable to find org/apache/tools/ant/BuildListener or sometimes AntMain. The stacktrace indicates this is happening when compiling a JSP at runtime. This problem does not occur on my Windows installation.

I have also tried installing Glassfish using the directions shown here:
https://glassfish.dev.java.net/downloads/v2-b58g.html

This installs O.K. using the jar file for Linus, but when I try to run "asadmin" it tells me that I must run apt-get install glassfish, which puts me back where I started.

I was able to repro this problem using the hello.war file bundled with glassfish by hitting the default jsp page. Can anyone suggest anything to fix this?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Gabor Szokoli

On Dec 19, 2007 3:33 AM, wrote:
> If I start from a clean ubuntu machine with no Glassfish installations, after I install Glassfish using the jar file (rather than apt-get) the only file on the entire disk named "asadmin" is the one under /glassfish/bin. When I try go to the directory and try to execute a command such as "asadmin start-domain domain1" it tells me asadmin is not installed.

Excuse me if this is too obvious, but "./" might not be on your path:
try to run
./asadmin
or
/glassfish/bin/asadmin

We had multiple versions of glassfish running on the two most recent
versions of Ubuntu without problems. I personally prefer to install
manually, others here use aptitude.

Gabor Szokoli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

kevinmacdonald
Offline
Joined: 2007-12-18

That was definitely *not* to obvious! Thank you. Linux Newbie that I am I did not realize that a ./ in front of the filename was required if the file is not on my path. That allowed me to start the domain and JSPs now compiled correctly. I still don't know how to make this work via apt-get without running into errors, but I have a means of getting it working.

Thanks to all for the much needed help!

sm157516
Offline
Joined: 2005-03-28

Hi,

I did a "sudo apt-get install glassfish" on my Ubuntu 7.04 Feisty Fawn.
After which, when i do a "which asadmin" i get "/usr/bin/asadmin". Also, during installation i observed that the binaries are installed in "/usr/share/sunappserver" and a domain is created in "/var/lib/sunappserver/domains" directories. I check my asenv.conf file under "/usr/share/sunappserver/config" directory and see that the AS_DEF_DOMAINS_PATH=/var/lib/sunappserver/domains. One more thing is the domain1 under "/var/lib/sunappserver/domains" directory is started at the end of installation.

I try to stop this domain by issuing "asadmin stop-domain --domaindir /var/lib/sunappserver/domains domain1". But the results are weird. This is what i get :

[i]GlassFish Default Domain Not Present. Creating one in /home/shalini/glassfish/domain1
If you want to use other domains under /usr/share/sunappserver/domains use /usr/share/sunappserver/bin/asadmin command.
Creating domain domain1 @ admin port 4848
Port 4848 is in use.
CLI130 Could not create domain, domain1
Starting GlassFish domain1
Starting Domain domain1, please wait.
Log redirected to /home/shalini/glassfish/domain1/logs/server.log.
Domain domain1 does not exist in /home/shalini/glassfish. Use a different domain name or the --domaindir option.
CLI156 Could not start the domain domain1.
[/i]

Hence i do "sudo /usr/share/sunappserver/bin/asadmin stop-domain domain1". This stops the domain that was started in the process of installation. Now i issue "asadmin start-domain domain1". Now what happens is

[i]GlassFish Default Domain Not Present. Creating one in /home/shalini/glassfish/domain1
If you want to use other domains under /usr/share/sunappserver/domains use /usr/share/sunappserver/bin/asadmin command.
Creating domain domain1 @ admin port 4848
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
2007-12-19 06:17:52.823 GMT Thread[main,5,main] java.io.FileNotFoundException: derby.log (Permission denied)
----------------------------------------------------------------
2007-12-19 06:17:53.013 GMT:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.1.3.1 - (417277): instance c013800d-0116-f10d-0db9-0000000879f8
on database directory /home/shalini/glassfish/domain1/lib/databases/ejbtimer

Database Class Loader started - derby.database.classpath=''
Domain domain1 created.
Starting GlassFish domain1
Starting Domain domain1, please wait.
Log redirected to /home/shalini/glassfish/domain1/logs/server.log.
Domain domain1 is ready to receive client requests. Additional services are being started in background.
Domain [domain1] is running [Sun Java System Application Server Platform Edition 9.0_01 (build b21)] with its configuration and logs at: [/home/shalini/glassfish].
Admin Console is available at [http://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8080 https://localhost:8181 ].
Following web-contexts are available:
[/web1 /asadmin ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://shalini:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
[/i]

I see that the domain1 is created again in my home directory and is started. When i do "asadmin version" i get

[i]Version = Sun Java System Application Server Platform Edition 9.0_01
Command version executed successfully.
[/i]

Now i deploy the hello.war quickstart sample from the admin console. When i launch, i get the exception javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException.

So i do a "sudo apt-get install ant". When i do a "which ant" i get "/usr/bin/ant". I restart the domain "asadmin stop-domain && asadmin start-domain" and when i launch the application, there is no exception.

km
Offline
Joined: 2005-10-28

Dumb suggestion (perhaps) --[but not as dumb as the one which is not given :)]

- what asadmin are you running? Please run asadmin from the installation. (Ubuntu has GlassFish
V1 integrated and it might collide with that GlassFish instance).

Regards,
Kedar

kevinmacdonald
Offline
Joined: 2007-12-18

If I start from a clean ubuntu machine with no Glassfish installations, after I install Glassfish using the jar file (rather than apt-get) the only file on the entire disk named "asadmin" is the one under /glassfish/bin. When I try go to the directory and try to execute a command such as "asadmin start-domain domain1" it tells me asadmin is not installed. If I open that file it contains:

#!/bin/sh
#
# Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#

. "/root/glassfish/config/asenv.conf"

LD_LIBRARY_PATH="$AS_NSS":"$AS_INSTALL/lib":"$AS_ICU_LIB":"$LD_LIBRARY_PATH";export LD_LIBRARY_PATH

cleanup()
{
stty echo
exit 1;
}

trap 'cleanup' 1 2 3 9 15

"$AS_JAVA"/bin/java -Dcom.sun.aas.instanceName=server -Djava.library.path="$AS_NSS":"$AS_INSTALL/lib":"$AS_ICU_LIB" -Dcom.sun.aas.configRoot="$AS_CONFIG" -Djava.endorsed.dirs="$AS_INSTALL/lib/endorsed" -Dcom.sun.aas.processLauncher="SE" -cp "$AS_DERBY_INSTALL/lib/derby.jar":"$AS_INSTALL/jbi/lib/jbi-admin-common.jar":"$AS_INSTALL/lib":"$AS_INSTALL/lib/appserv-rt.jar":"$AS_INSTALL/lib/appserv-ext.jar":"$AS_INSTALL/lib/javaee.jar":"$AS_INSTALL/lib/appserv-se.jar":"$AS_INSTALL/lib/admin-cli.jar":"$AS_INSTALL/lib/appserv-admin.jar":"$AS_INSTALL/lib/commons-launcher.jar":"$AS_INSTALL/lib/install/applications/jmsra/imqjmsra.jar" -Dcom.sun.appserv.admin.pluggable.features=com.sun.enterprise.ee.admin.pluggable.EEClientPluggableFeatureImpl com.sun.enterprise.cli.framework.CLIMain "${@}"

km
Offline
Joined: 2005-10-28

Still beats me.

Your asadmin is at: /glassfish/bin, but your asenv.conf (a config file needed by server) is at:
. "/root/glassfish/config/asenv.conf"?

That's unusual. More data needed.

- Kedar

Gabe Wong

glassfish@javadesktop.org wrote:
> Still beats me.
>
> Your asadmin is at: /glassfish/bin, but your asenv.conf (a config file needed by server) is at:
> . "/root/glassfish/config/asenv.conf"?
>
> That's unusual. More data needed.
>
> - Kedar
> [Message sent by forum member 'km' (km)]
>
> http://forums.java.net/jive/thread.jspa?messageID=250683
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
Good point. asenv.conf should correspond with the correct asadmin.
You should try call env to see if there are any conflicting environment
variables that is corrupting the build.

--
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

kevinmacdonald
Offline
Joined: 2007-12-18

My exact repro steps for this problem are

-start with an Ubuntu ISO that I downloaded launched in VMWare
- apt-get install ant
- apt-get install sun-java6-jdk
- install Glassfish via jar file
- run ant -f setup.xml

All of that works fine, but asadmin doesn't work. I am a relative newbie to Linux. Is there more specific information I could provide to help diagnose the issue?

kevinmacdonald
Offline
Joined: 2007-12-18

I should point out that this exact same problem has occurred on two different Ubuntu boxes built independently. I am referring to my original problem of AntMain not being found by the app server when navigating to any JSP page.

km
Offline
Joined: 2005-10-28

Kevin,

Like Shalini has stated, I do think you are somehow having conflict of two GlassFish installs.
I will try your *exact* install steps and see what happens.

- Kedar