Web Programming

I am  a newbie.  This is a new installation of Tomcat 5.0.19, Eclipse 3.1.1 in a windows environment.  I can run the Tomcat icon.  I cannot see my own JSPs.  I placed my class in the classes subdirectory under webapps.  My web.xml file is enclosed as well as the Tomcat Console.

Tomcat console:
Apr 24, 2006 1:21:04 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Apr 24, 2006 1:21:04 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1882 ms
Apr 24, 2006 1:21:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 24, 2006 1:21:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.19
Apr 24, 2006 1:21:05 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 24, 2006 1:21:05 PM org.apache.catalina.startup.ContextConfig applicationConfig
INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DeployApp]
Apr 24, 2006 1:21:05 PM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
Apr 24, 2006 1:21:05 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\admin.xml
Apr 24, 2006 1:21:06 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
Apr 24, 2006 1:21:06 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
Apr 24, 2006 1:21:07 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
Apr 24, 2006 1:21:09 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\balancer.xml
Apr 24, 2006 1:21:09 PM org.apache.commons.beanutils.MethodUtils getMatchingAccessibleMethod
WARNING: Cannot use JVM pre-1.4 access bug workaround die to restrictive security manager.
Apr 24, 2006 1:21:09 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\manager.xml
Apr 24, 2006 1:21:09 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /jsp-examples from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jsp-examples
Apr 24, 2006 1:21:09 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path  from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT
Apr 24, 2006 1:21:30 PM org.apache.catalina.startup.ContextConfig applicationConfig
SEVERE: Parse error in application web.xml
java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
      at sun.net.www.http.HttpClient.New(HttpClient.java:339)
      at sun.net.www.http.HttpClient.New(HttpClient.java:320)
      at sun.net.www.http.HttpClient.New(HttpClient.java:315)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
      at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
      at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
      at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
      at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1548)
      at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:300)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:641)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:253)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:164)
      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:186)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:848)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
      at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
      at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:727)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Apr 24, 2006 1:21:30 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
Apr 24, 2006 1:21:30 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Apr 24, 2006 1:21:30 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Apr 24, 2006 1:21:30 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /servlets-examples from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\servlets-examples
Apr 24, 2006 1:21:31 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /tomcat-docs from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs
Apr 24, 2006 1:21:31 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /webdav from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\webdav
Apr 24, 2006 1:21:31 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Apr 24, 2006 1:21:31 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Apr 24, 2006 1:21:31 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/40  config=C:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\jk2.properties
Apr 24, 2006 1:21:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 27230 ms


web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc. //DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <display-name>Example Application</display-name>
 
<!-- JSPC servlet mappings start -->

    <servlet>
        <servlet-name>Servlet1</servlet-name>
        <servlet-class>/org.cookbook.Ch11.Servlet1</servlet-class>
    </servlet>
      
<servlet>
        <servlet-name>ServletInPlace</servlet-name>
        <servlet-class>org.cookbook.Ch11.ServletInPlace</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Servlet1</servlet-name>
        <url-pattern>org.cookbook.Ch11.Servlet1</url-pattern>
    </servlet-mapping>
      
      <servlet-mapping>
        <servlet-name>ServletInPlace</servlet-name>
        <url-pattern>org.cookbook.Ch11.ServletInPlace</url-pattern>
    </servlet-mapping>

<!-- JSPC servlet mappings end -->

</web-app>

I get the http 404 message.  I created the web.xml file within eclipse.  Is this OK?  In the address bar:

http://localhost:8080/org.cookbook.Ch11.Servlet1 (then I press enter).  I view the source on the page and the xml look fine.   Thank you for your help.
latimercm4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

avinthmCommented:
Hi ,
>         <servlet-class>/org.cookbook.Ch11.Servle<wbr/>t1</servle<wbr/>t-class>

remove "/" in the above tag

<servlet-class>org.cookbook.Ch11.Servlet1</servlet-class> (try this one)

cheers
0
latimercm4Author Commented:
INFO: Installing web application at context path /jsp-examples from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jsp-examples
Apr 25, 2006 10:28:24 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path  from URL file:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT
Apr 25, 2006 10:28:45 AM org.apache.catalina.startup.ContextConfig applicationConfig
SEVERE: Parse error in application web.xml
java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)

I changed the web.xml and get the same result.  Am I not supposed to add the web.xml file to Eclipse or any project server?  I did not recompile after I made the change to web.xml ...does this matter?

<servlet-class>org.cookbook.Ch11.Servlet1</servlet-class> (try this one)

0
latimercm4Author Commented:
I see the following error in the console.  I have a web.xml file in webapps/WEB-INF.  Does it also belong somewhere else?
Where is Tomcat's web.xml file and when is it used?

This is the error I see in the console
Apr 25, 2006 2:40:20 PM org.apache.catalina.startup.ContextConfig applicationConfig
INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DeployApp]
Apr 25, 2006 2:40:21 PM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
0
avinthmCommented:
web.xml is supposed to be in the WEB-INF folder. The structure is something like this.

suppose app name is "Example Application"

webapps
--- Example Application
     ---- WEB-INF
           web.xml
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
latimercm4Author Commented:
this is the location where I have placed it.  Although first I had it underneath the webapps folder.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.