Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Web Programming

Posted on 2006-04-24
5
Medium Priority
?
228 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:latimercm4
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:avinthm
ID: 16531755
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
 

Author Comment

by:latimercm4
ID: 16534666
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
 

Author Comment

by:latimercm4
ID: 16537388
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
 
LVL 6

Accepted Solution

by:
avinthm earned 750 total points
ID: 16541499
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
 

Author Comment

by:latimercm4
ID: 16542928
this is the location where I have placed it.  Although first I had it underneath the webapps folder.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question