Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please look at my Server.xml and let me know if it looks ok

Status
Not open for further replies.

hugstable

Programmer
Feb 20, 2006
65
US
here is the file
Code:
<Server port="8005" shutdown="SHUTDOWN">

  <GlobalNamingResources>
    <!-- Used by Manager webapp -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" />

    <!-- This is here for compatibility only, not required -->
    <Connector port="8009" protocol="AJP/1.3" />

    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase" />
      <Host name="localhost" appBase="webapps" />

<Host name="skunkjava.loc" debug="0" appBase="webapps" unpackWARs="true">
<Alias>[URL unfurl="true"]www.skunkjava.loc</Alias>[/URL]
<Context path="" docBase="/usr/lib/apache-tomcat/webapps/myApp" debug="0" reloadable="true"/>
</Host>

    </Engine>

  </Service>
</Server>

web.xml is:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

  <!DOCTYPE web-app 
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
	"[URL unfurl="true"]http://java.sun.com/dtd/web-app_2_3.dtd">[/URL]
	
<web-app>
	<servlet>
		<servlet-name>Testing</servlet-name>
		<servlet-class>TestingServlet</servlet-class>
	</servlet>
</web-app>


i can hit the jsp page using:
but i cannot test my servlet via:
everything compiled fine... the java code is in the WEB-INF folder, same level as index.jsp...

thanks in advance
 
the last 2 log entries are:
Code:
Dec 1, 2006 7:11:22 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet org.apache.catalina.INVOKER.Testing as unavailable
Dec 1, 2006 7:11:22 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading WebappClassLoader^M
  delegate: false^M
  repositories:^M
    /WEB-INF/classes/^M
----------> Parent Classloader:^M
org.apache.catalina.loader.StandardClassLoader@1125127^M
 Testing
java.lang.ClassNotFoundException: Testing
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1034)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
        at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
        at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

Dec 1, 2006 7:11:22 PM org.apache.catalina.core.ApplicationContext log
SEVERE: invoker: Cannot allocate servlet instance for path /servlet/Testing
javax.servlet.ServletException: Wrapper cannot find servlet class Testing or a class it depends on
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1042)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
        at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
        at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

once again - thanks again....
 
I'd say your main problem is this :

Code:
java.lang.ClassNotFoundException: Testing
        at org.apache.catalina.loader.WebappClassLoader.loadClass

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
the class is in the WEB-INF folder and the web.xml points to it - shouldnt that be enough for the server to find it?
 
All classes should be jar'ed up and put int WEB-INF/lib, or the .class files be put in WEB-INF/classes.

There used to be an issue with tomcat not allowing classes that were not in a package - this could also be a problem.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
that web.xml was the problem - i pulled it out of the picture and it worked...upon removing my web.xml the server used the defualt one in the conf folder.... i would love to know what was wrong with mine though
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top