This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes tomcat is saying request resource is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat is saying request resource is not available" Watch "tomcat is saying request resource is not available" New topic
Author

tomcat is saying request resource is not available

kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

this is my application present in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\hello_app
and my .class file is present in C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\hello_app\WEB-INF\classes folder
when i called my servlet using http://localhost:8080/hello_app/callmyservlet it is saying that request resource is not available, i checked it my side but invain. did i go wrong any where?

here is my web.xml file
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Have you followed the steps outlined in the ServletsFaq to deal with this issue?

(Hint: especially the one about putting all classes in a package?)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

Bear Bibeault wrote:Have you followed the steps outlined in the ServletsFaq to deal with this issue?

(Hint: especially the one about putting all classes in a package?)

i tried but same result it is not working
yes thank you for you reply and yes i have created a package named krn.servlets, and i put it in my source file and i re-ran java file and i copied the class file in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\hello_app\WEB-INF\classes\krn\servlets folder
and i changed servlet-class tag and web.xml is as shown below

but still i am getting same error it is not running. and yes i restarted the server before running it.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

What about the other steps? Have you checked the logs? Have you used the Manager application to see if the context has even started?
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

Bear Bibeault wrote:What about the other steps? Have you checked the logs? Have you used the Manager application to see if the context has even started?

you mean the log folder present in this path C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs right? if yes
there are many files under this folder how can check? and actually what information can i get from those files? and what actually is Manager application? yes i am just a starter of servlet topic so these many questions
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

The main Tomcat log file is catalina.out (that info is in the FAQ entry).

tomcat manager application
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

Bear Bibeault wrote:The main Tomcat log file is catalina.out (that info is in the FAQ entry).

tomcat manager application

yes i found them under tomcat manager application i have different applications one of them is my hello_app under that there is no display name and running status is false and when i click start it says

"FAIL - Application at context path /hello_app could not be started"

and under catalina log i have the following information

Jul 4, 2013 2:42:42 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Jul 4, 2013 2:42:42 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 4, 2013 2:42:42 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 343 ms
Jul 4, 2013 2:42:42 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 4, 2013 2:42:42 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.28
Jul 4, 2013 2:42:42 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 4, 2013 2:42:42 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 9 column 4: The element type "servlet-name" must be terminated by the matching end-tag "</servlet-name>".
org.xml.sax.SAXParseException: The element type "servlet-name" must be terminated by the matching end-tag "</servlet-name>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:348)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1048)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4184)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Jul 4, 2013 2:42:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/hello_app/WEB-INF/web.xml
org.xml.sax.SAXParseException: The element type "servlet-name" must be terminated by the matching end-tag "</servlet-name>".
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:348)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1048)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4184)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Jul 4, 2013 2:42:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 9 column 4
Jul 4, 2013 2:42:42 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
Jul 4, 2013 2:42:42 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Jul 4, 2013 2:42:42 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/hello_app] startup failed due to previous errors
Jul 4, 2013 2:42:43 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 4, 2013 2:42:43 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 4, 2013 2:42:43 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/78 config=null
Jul 4, 2013 2:42:43 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jul 4, 2013 2:42:43 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 719 ms
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 138

There is no / in the end tag of <servlet-name>


Regards,
Prajakta
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

Prajakta Acharya wrote:There is no / in the end tag of <servlet-name>

it is there, check it once go back to my previous reply i copied my web.xml file there
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 138

I dont see it at line 7 of your web.xml
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

@all
i don't know the why it ran very successfully i will say i did, i found it amusing.
i just went to web.xml file C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF i just copied entire things in to my current web.xml and i just changed the corresponding things like servlet name,servletclass,url pattern. and when i ran it i was successful. don't know what exactly i did wrong previously. it went fine. guys if you have any idea what mistake did i do previously please tell me. previously i hard coded web.xml and while running it was a failure but when i copied web.xml contents and just by changing corresponding things i got it right.
kiran kumar reddy
Ranch Hand

Joined: Jun 28, 2012
Posts: 94

Prajakta Acharya wrote:I dont see it at line 7 of your web.xml

yes you are correct and thank you it ran successfully.
 
Consider Paul's rocket mass heater.
 
subject: tomcat is saying request resource is not available
 
Similar Threads
Unable to run servlet on my machine
servlet beginner confused
Configuring Tomcat...
Problem: requested resource not available
Unable to load servlet in Tomcat 5.5