This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
description: The requested resource (Servlet Login is not available) is not available.
I am using J2ME as my Frontend,Apache Tomcat 5.5 and Oracle 9i as my Backends.
Thanks, Sravanthi.
[ May 25, 2008: Message edited by: sravanthi yendluri ]
[ May 25, 2008: Message edited by: sravanthi yendluri ] [ May 28, 2008: Message edited by: Ben Souther ]
Rajat Bhatnagar
Greenhorn
Joined: Mar 11, 2008
Posts: 22
posted
0
Your problem could be basically related to 3 things: 1. Wrong Entry in url-pattern/servlet-name/servlet-class tags in web.xml 2. Missing class files 3. Wrong Url in browser
The best way to find out is to check the tomcat logs .
Tomcat logs will clearly give an indication where you might be going wrong. In case you are still not able to find the problem paste the Error log message here ..
My servlets are in "C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes"
My web.xml is as follows,
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
This is the error that I found in localhost.2008-05-25 in the logs folder is.
May 25, 2008 9:27:18 PM org.apache.catalina.core.ApplicationContext log INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: ,]http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: ,]http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: ]]http://jakarta.apache.org]] May 25, 2008 9:27:18 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() May 25, 2008 9:27:18 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 25, 2008 9:27:18 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() May 25, 2008 9:27:18 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() May 25, 2008 9:27:54 PM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet Login as unavailable May 25, 2008 9:27:54 PM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@10a3b24 LoginServlet java.lang.ClassNotFoundException: LoginServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) May 25, 2008 9:27:54 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet Login java.lang.ClassNotFoundException: LoginServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source)
[ May 25, 2008: Message edited by: sravanthi yendluri ]
[BSouther: Added UBB CODE tags] [ May 26, 2008: Message edited by: Ben Souther ]
Did you compile your servlet? If so, where did you put your servlet class file?
A word of caution, this isn't related to your current problem but will cause a similar problem later when you start using JSP and beans. All Java classes in a Java web application should be in packages. There are cases where the JVM will not be able to find your Java classes if they are in the default package (no package).
I would fix that before continuing to debug this issue.
One more thing that isn't relative to your issue: Don't use directories with spaces in its names...
cortin flaneir
Greenhorn
Joined: May 26, 2008
Posts: 13
posted
0
check out your web.xml file . i am sure that url pattern is does not match. or your classfile missing.check out
sravanthi yendluri
Greenhorn
Joined: May 25, 2008
Posts: 23
posted
0
Where can I find my class file for the Java file so that I can put it in web-inf\classes folder.
I found it in the C:\ drive because I complied it from there and I kept it in the web-inf\classes folder and I compiled it again but I got the same error that there is no source file.
I tried again typing in the correct cases but I am getting the same error. I am not knowing what to do. [ May 27, 2008: Message edited by: sravanthi yendluri ]
Baseet Ahmed
Ranch Hand
Joined: Dec 18, 2006
Posts: 223
posted
0
Originally posted by sravanthi: I compiled the program as follows:
javac -classpath="C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\ROOT\WEB-INF\classes\LoginServlet.java" I am doing it in the right way?
sravanthi, If it is giving error then,try with this: Put your Java file(LoginServlet.java) in C drive 1- Go to C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\ROOT\WEB-INF\classes directory using cd command(on Windows) 2- cd C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\ROOT\WEB-INF\classes 3- Then compile it using C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\ROOT\WEB-INF\classes>javac C:\LoginServlet.java 4- Give the restart to your application server(tomcat etc). 5- Test the application.
Regards Baseet Ahmed **************** Say Salaam before starting communication(verbal+nonverbal),even before Hi/Hello. Salaam : Assalam Alekum (Peace may upon you.) ****************
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35248
7
posted
0
Originally posted by sravanthi yendluri: javac -classpath="C:\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5\ROOT\WEB-INF\classes\LoginServlet.java"
I am doing it in the right way?
No. The classpath -as the name implies- is for class files, not source files. The command should be something like
sravanthi, If it is giving error then,try with this: Put your Java file(LoginServlet.java) in C drive
I kept the file in the C Drive directly and compiled it directly and it worked fine. But when I tried to follow the steps given I am getting the error "System cannot find the path specified".
When I tried compiling the way "Ulf Dittmer" told me I am getting the error "no source code".
Using javac and setting up classpaths are not servlet issues. I'm moving this thread to Java In General (beginner).
It's a common mistake to jump right into servlets without spending a little time learning core Java. Now might be a good time to step back from this project and follow a couple tutorials on the basics of Java. You'll save yourself a lot of time and trouble if you do.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Compiling servlet [was: HTTP Status 404 - Servlet Login is not available]