wood burning stoves 2.0*
The moose likes Tomcat and the fly likes can connect to localhost but not domain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "can connect to localhost but not domain" Watch "can connect to localhost but not domain" New topic
Author

can connect to localhost but not domain

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

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 ]

SCJP
Visit my download page
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

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

Joined: Oct 21, 2000
Posts: 4340
    
    2

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

Joined: Oct 21, 2000
Posts: 4340
    
    2

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

Joined: Oct 21, 2000
Posts: 4340
    
    2

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can connect to localhost but not domain
 
Similar Threads
Tomcat6 and Java Beans
simple question
Apache2 conf
getting set up apache/tomcat
Tomcat 5.0.0 installation