This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can connect to localhost but not domain

 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i uninstalled and got tomcat 5.5.9

i can connect to http://localhost:8080/ and display logon page, but get connection refused from http://javaguy.kicks-ass.org/. i can connect to ftp server ok.

also still having problem with servlets. i uncommented the invoker servlet. here is new directory structure:
G:\Program Files\Tomcat\Tomcat 5.5\webapps\ROOT\main\WEB-INF\classes
i had two index.html in app is why i needed subdirectory(changing filename would involve rewriting app which i dont want to do).
i copied the web.xml file from ROOT\WEB-INF to new folder main\WEB-INF(perhaps that was a mistake).
the servlets are in the classes folder.
i call the first one like this:
<form action="/main/servlet/MyCookieServlet" method="get">
from index.html in ROOT folder.
i get this message:

HTTP Status 404 - /main/servlet/MyCookieServlet

type Status report

message /main/servlet/MyCookieServlet

description The requested resource (/main/servlet/MyCookieServlet) is not available.
[ June 17, 2005: Message edited by: Randall Twede ]
 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think i see the problem with the servlets but not sure how to fix it, other than finding where i call the second index.html and changing it so i can change that filename, im not even sure if i called it from a servlet or a static page. my directory structure is wrong, i should only have one WEB-INF under ROOT and classes folder should be under that.

yeah i found it and it is a static page i can just change the name and get everything in ROOT folder. that should fix the servlet problem.

i have no clue why i am getting the connection refused error though

this is ridiculous!!!
the invoker is uncommented
my directory now looks like this:
G:\Program Files\Tomcat\Tomcat 5.5\webapps\ROOT\WEB-INF\classes
all static pages and JSP's are in ROOT folder
all servlets are in classes folder
i call the first servlet like this
<form action="/servlet/MyCookieServlet" method="get">
and it still doesnt work!!!

and even if i finally get this working i still have to figure out where to put database file or rewrite that servlet
[ June 17, 2005: Message edited by: Randall Twede ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 5.5x requires jdk1.5.0 or higher unless you intall the compat packages.
If you have jdk1.5.0 or better and Tocmat is running, try dropping one of my war files in the webapps directory. Tomcat will unpack and deploy the application for you.

Once you've done that, you'll have a working app with a proper directory structure and a web.xml file that contains mappings for all the servlets.

http://simple.souther.us

Configuring your app will be easier if you have one to compare it with.
 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
apparently the invoker wont work even if you uncomment it.

i tried mapping that one servlet and it threw an exception because it tried to call ServletUtilities.class. i hadnt even copied that one to the folder because i didnt think it was part of my app(its been 5 years).
i guess ill have to map all of them.

i still have no clue why i cant connect through the domain
i have no problem connecting with my ftp server through the domain

and yes i just got 1.5 i think maybe that is why both my browsers suddenly cant find the jvm to run applets but im not sure

at least the servlet problem is resolved now

looks like i am going to have to edit and recompile some of my servlets after all because of changed directory structure
java.io.FileNotFoundException: ..\webapps\examples\ScreenNames.txt
of course you couldnt find it, it is now \webapps\ROOT\ScreenNames.txt



[ June 17, 2005: Message edited by: Randall Twede ]
[ June 17, 2005: Message edited by: Randall Twede ]
 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
strange...now im getting page cannot be displayed error from IE(maybe was just firefox saying connection refused)

http://localhost:8080/ works fine

and ftp server works fine through domain

there must be something i have to edit in one of the files
probly ServerName
in old Apache i edited that in httpd.conf
in new Apache it asked for it on install
[ June 18, 2005: Message edited by: Randall Twede ]
 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aha!
it works if i type
http://javaguy.kicks-ass.org:8080/
of course i dont want to have to include the port number
how do i fix this?
[ June 18, 2005: Message edited by: Randall Twede ]
 
Randall Twede
Ranch Hand
Posts: 4409
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found the answer, you have to change the port from 8080 to 80(duh! shows how long its been since i did web development):

To change the port, edit install_dir/conf/server.xml and change the port attribute of the Connector element from 8080 to 80, yielding a result similar to that below.

<Connector port="80" ...
maxThreads="150" minSpareThreads="25" ...

i found the answer here:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/
[ June 18, 2005: Message edited by: Randall Twede ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic