2
votes

I have written a web application using netbeans which I have always deployed to the Glassfish server through netbeans itself. Now that I've finished it, I want to be able to run it independently of netbeans, and this was succesful on the first PC I tried it on, I started the glassfish server using "start-domain" command, and my previously deployed service was already there waiting for me.

However I have since tried doing this on another PC. The service deploys completely fine through netbeans, but when I try starting the glassfish server on its own, the problems start. For some strange reason netbeans seems to be using a different version of glassfish to me, because if I start the server, and then go to netbeans to deploy the service, I get the following error message:

Starting GlassFish Server 3.1
GlassFish Server 3.1 Server cannot start. Port is occupied.
In-place deployment [path]
Initializing...
deploy?DEFAULT=[path] failed. Instance is not GlassFish Server 3.1.

I only have one version of glassfish installed, and that is 3.1. In the project settings I have the correct Glassfish server selected, but still, it seems to be running it separately. Any help would be very much appreciated, because it's confused the heck out of me!

3
are you running Windows on these PCs? Where is NetBeans installed? Where is GlassFish installed?vkraemer

3 Answers

2
votes

GlassFish Server 3.1 Server cannot start. Port is occupied.

Your GF (server I meant;) )is trying to open a port which is aquired by some other process.

You can look for the process that is binded with port using netstat -aon

Check here my answer for detailed information

2
votes

finally i solved the problem for glassfish.

here you are :

  1 - find where glassfish is installed. if you dont know check here; 
  Select Services window by using **Window -> Services** in NetBeans IDE
  Expand **Server**s node and select GlassFish Domain
  Right click and select **Properties** 
  On the right of Domains Folder you can see the folder where **GlassFish** is installed.

  2 - go to directory. eg: mine is  **C:\Users\UserME\.netbeans\7.1\config\GF3\domain1\config**
  3 - here you will find a **domain.xml**
  4 - open domain.xml and find **8080**. change 8080 t0 **8284** and **save domain.xml**
  5 - enjoy your software :P 

PS: We changed port to 8284 but be careful that 8284 is not in use. if it is in use too you can change any other number.

regards.

0
votes

I don't think you have registered the instance of Glassfish that you started manually with Glassfish (Services tab, rightclick on Servers, Add Server, type Glassfish 3.1, point to the base directory of the installation. Now Netbeans should recognize that server, and show that it's running.

On the other hand, why don't you just deploy the built war or ear to Glassfish via its console? You don't have to pass through Netbeans for deployment....