java
Java-Monitor Forum > Java Application Server Administration > Tomcat Administration » webapp won't deploy listening on port 8080
Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30-03-2012, 16:24
ahart ahart is offline
Junior Member
 
Join Date: Mar 2012
Posts: 5
Default webapp won't deploy listening on port 8080

Hello. This has been a helpful thread indeed. But I have a follow-up.

My problem is that I am trying to install a Java webapp instance which uses localhost:8080 to be viewed. But it wont install (coz java.net.BindException: Address already in use:8080). I checked to see what process is using 8080 (netstat -anp | grep 8080). A jsvc.exec process listening to my 8080 port. Upon checking (ps -fp) I find out that this is Tomcat.

So I killed the process, and yeah, the Webapp installed completely. But when I navigate browser to localhost:8080 it says the service is not running - coz I killed Tomcat! So I restart Tomcat, and now the webapp instance won't complete.

Can you tell me what I should do? I am running Tomcat 5.5 in a LAMP environment.

Thanks!
Reply With Quote
  #2  
Old 30-03-2012, 20:12
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,123
Default

Dear ahart,

Sounds like you have two tomcat servers installed, could that be?

Kees Jan
Reply With Quote
  #3  
Old 30-03-2012, 20:29
ahart ahart is offline
Junior Member
 
Join Date: Mar 2012
Posts: 5
Default

Nope. Just one. I tried a trick> I changed the Connector element from 8080 to 8081 (/conf/server.xml) and that did not resolve the issue either.
Reply With Quote
  #4  
Old 30-03-2012, 21:02
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,123
Default

Dear ahart,

In that case, you need to resolve any errors you see in the logs. Why does the web app not deploy the second time? What precise stack trace do you see?

Kees Jan
Reply With Quote
  #5  
Old 30-03-2012, 21:04
admin admin is offline
Administrator
 
Join Date: Jul 2008
Posts: 209
Default

New threads for new problems, please.
Reply With Quote
  #6  
Old 30-03-2012, 23:34
ahart ahart is offline
Junior Member
 
Join Date: Mar 2012
Posts: 5
Default

I am able to control the result of the web app build. If another process (like Tomcat) is tethered to 8080 port, then the Webapp will not build. If I kill whatever is tethered to 8080 port (or reassign it to 8081), then the webapp does build successfully. IOW, webapp will only build if 8080 is open. OK, so that resolves the build. Now, what about Tomcat? I need Tomcat to run in order for the webapp service to be up. So now that I have reassigned Tomcat to 8081, it is up and running. And accoording to the message at the completion of the webapp build instance, the web app is up too (see below).

However, when I navigate my browser to localhost:8080, it gives me this error:

HTTP ERROR: 503.
Problem accessing /. Reason:
Service Unavailable
Powered by Jetty://

-----------------------------
End-of-build message copied from SSH terminal:

2012-03-30 17:26:36.375:INFO::Started SocketConnector@0.0.0.0:8080 STARTING
================================================== ===========
=
= Your OneBusAway instance has started. Browse to:
=
= http://localhost:8080/
=
= to see your instance in action.
=
= When you are finished, press return to exit gracefully...
Reply With Quote
  #7  
Old 30-03-2012, 23:38
ahart ahart is offline
Junior Member
 
Join Date: Mar 2012
Posts: 5
Default

Ok, sorry. Thanks.
Reply With Quote
  #8  
Old 31-03-2012, 07:22
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,123
Default

Dear ahart,

You mention in your posts that you want to use Tomcat, but the error message is generated by Jetty (note: "Powered by Jetty://"). Which app server did you install on your system, Tomcat or Jetty?

Are you sure Jetty is not dragged into the application (and started up) as a dependency of something? Maven can play really tricky games, sometimes.

Kees Jan
Reply With Quote
  #9  
Old 01-04-2012, 01:04
ahart ahart is offline
Junior Member
 
Join Date: Mar 2012
Posts: 5
Default

Thanks Kees Jan. You are right, according to my server admin, the .war file has a self contained Jetty server. Apparently the .war file starts up a server on port 80, which is apparently the source of the 'Powered by Jetty' message. It appears to be self-contained. (this is confusing to me as the 'Powered by Jetty' message is from the 8080 port). Anyway, the webapp is outside the server admin's scope of support, so cannot tell me what way I need to configure it to make it behave as I want it to (I want to be able to view the webapp through port 8080). And the developer is a part of an open source community and is not responding to my emails. Is it possible that there are a standard set of additional arguments along with the "java -jar myfilename.war -webapp path/to/the/database" command in order to run an executable .war with a self contained Jetty server???
Reply With Quote
  #10  
Old 01-04-2012, 14:16
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,123
Default

Dear ahart,

No, there is no such way. You should not include app servers in .WAR files. That makes no sense at all. Here is what it looks like to me:


Remove Jetty from the WAR file and deploy the servlets into a servlet container of your choice, Jetty or Tomcat will both do fine.

Kees Jan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump