Marcin M
Marcin M

Reputation: 1

Glassfish claims the port is occupied. Netsat disagree

I have succesfully deployed application on port 8080. After undeploy and killing all processes "java" and cleaning folders: "domains/domain1/osgi-cache/felix" and "domains/domain1/applications/" then I tried to redeploy application.

It occured the port is occupied. I could not find that port using netstat (like it was suggested on many other posts) so I guess port should be available.

I managed to deploy on different port (9090). I did again undeploy and rest of actions like killing and stopping domain... it occured the port is still occupied as well and I could not deploy app on port 8080 and 9090 now.

I am using glassfish 4.1.2 and Windows. Anyone have ideas what can I do more?

I also added my hostname under etc/host.

Upvotes: 0

Views: 127

Answers (2)

Marcin M
Marcin M

Reputation: 1

Actually, I did not find answer why the port is occupied. But if someone else found similar issue, this procedure of redeploy works for me: 1: go to admin panel of glassfish (by default :4848). Select application and click undeploy 2: stop domain using console (asadmin stop-domain domain1) 3: start domain using console (asadmin start-domain domain1) 4: go to admin panel(by default :4848), deploy application.

This procedure worked for me, instead of clicking "redeploy" on admin panel.

Glassfish and Windows...

Upvotes: 0

Mike
Mike

Reputation: 4963

From the description of your post, it sounds like you have tried to follow some instructions intended for Linux on your Windows system. Since you managed to start GlassFish on port 9090, that indicates that the hostname issue does not affect you. The fact that you could not start GlassFish on port 9090 afterwards suggests that you have not shutdown GlassFish properly.

On Windows, it is not always possible to view all Java processes if they were started by another user. So if you have GlassFish installed as a Windows service, then a Windows system user will start GlassFish and the Java process will not be visible to you.

A good way to verify whether or not GlassFish is still running is to visit the endpoint in a browser, in your case http://localhost:9090. If your application is there, then its homepage will show, otherwise GlassFish will serve a 404 which will look a lot like this:

screenshot of 404 page

If you manage to get a response in your browser, then you will be certain that GlassFish is still running.

Upvotes: 1

Related Questions