GlassFish 3.1 and NetBeans 7.0 – remote server

Recently I was trying to get GlassFish 3.1 working within NetBeans 7.0. There are few places where you can get lost. That’s why I have prepared this short tutorial.

First of all you will need two instances of GlassFish: local and remote. Make sure you are using the same GlassFish version on both systems. I’d suggest using the same Java version as well. After you have your GlassFish running, create a domain at remote server and make sure that domain can be accessed remotely via admin port. In my case, I have changed ownership of the GlassFish to user tomcat.tomcat

# create domain with non standard ports
su -c "./asadmin create-domain --adminport 20001 \
     --instanceport 20002 testdomain" tomcat

# start domain
su -c "./asadmin start-domain testdomain" tomcat

# enable security
su -c "./asadmin --host hostname --port 20001 \
     --user admin enable-secure-admin" tomcat

# stop domain
su -c "./asadmin stop-domain testdomain" tomcat

# start domain again
su -c "./asadmin start-domain testdomain" tomcat 

Now, you should be able to add hostname:20001 into NetBeans and it should be available for remote development.

Comments (2)

anonymousNovember 2nd, 2012 at 10:45 pm

Excelent!!! it was really helpfull and a headache killer!

anonymousNovember 3rd, 2012 at 10:14 am