S
S
Stas_Telnov2010-12-21 11:07:46
Java
Stas_Telnov, 2010-12-21 11:07:46

Running tomcat under Windows 7 x64

Hello. So, problem. For the laboratory, a simple servlet, you need to run and test this case on tomcat.
Actually, I tried several different versions of the server:
Tomcat 5.5.x
Tomcat 6.0.29 64-bit Windows
Tomcat 6.0.29 64-bit Itanium Windows
Tomcat 6.0.29 32-bit/64-bit Windows Service Installer

Basically, tomcat itself starts and its welcome page hangs on port 80 of the localhost.
But the laboratory does not start by url - 500 error.
I suspect that something is wrong with my system, namely, Tomcat lacks the APR library.
All launches of various versions of tomcat start with the following error: Further, it seems that no errors are visible.
21.12.2010 10:52:57 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ant\bin\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\windows\system32
21.12.2010 10:52:57 org.apache.coyote.http11.Http11Protocol init


Poyandexiv this question, I realized that I need this same APR library.
But unfortunately where to get it, how to install it and where to connect it, to the tomcat itself, to system folders or somewhere else, there is no time to Yandex, the session is on the nose.

Please suggest a solution to this problem. Thank you very much in advance.

UPD
Actually, the tomcat itself is launched through the corresponding button on the eclipse panel.
Here are the logs at startup (what comes out in the eclipse console) Here is what it adds when it stops: The servlet project itself was created as a "Tomcat Project". Here is the code for the servlet itself:
21.12.2010 12:06:53 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ant\bin\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\windows\system32
21.12.2010 12:06:53 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
21.12.2010 12:06:53 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 617 ms
21.12.2010 12:06:53 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
21.12.2010 12:06:53 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
21.12.2010 12:06:53 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
21.12.2010 12:06:53 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
21.12.2010 12:06:53 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor serverApp.xml
21.12.2010 12:06:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
21.12.2010 12:06:54 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
21.12.2010 12:06:54 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
21.12.2010 12:06:54 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
21.12.2010 12:06:54 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
21.12.2010 12:06:54 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
21.12.2010 12:06:54 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
21.12.2010 12:06:54 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/42 config=null
21.12.2010 12:06:54 org.apache.catalina.startup.Catalina start
INFO: Server startup in 996 ms


21.12.2010 12:07:25 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
21.12.2010 12:07:26 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina


import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class servlet extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("\n");
out.println("
\n"+"Protocol: ");
out.println(request.getProtocol());
out.println("
\n"+"Request URI: ");
out.println(request.getRequestURI());
out.println("
\n"+"Request Method: ");
out.println(request.getMethod());
Enumeration headerNames = request.getHeaderNames();
out.println("

" +headerName);

out.println(" " + request.getHeader(headerName));
}
out.println("\n


При этом по адресу C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost находится файл serverApp.xml
со след содержанием:
/>

В папке с проектом по адресу D:\eclipse\labs\serverApp\WEB-INF лежит web.xml
со следующим содержанием:
<!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>
<servlet-name>serverApp</servlet-name>
<servlet-class>servlеt</servlet-class>

<servlet-mapping>
<servlet-name>serverApp</servlet-name>
<url-pattern>/servlet</url-pattern>
</servlet-mapping>
</web-app>


При этом, при попытке открытия localhost:8080/serverApp/servlet
появляется 500 error:
description: The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Wrapper cannot find servlet class servlеt or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)

root cause

java.lang.ClassNotFoundException: servlеt
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


В общем он не может найти сам класс, хотя само приложение и проект вроде находит.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Kostousov, 2010-12-21
@sandello

A simple servlet in the studio. And deployment logs too.

M
mambet, 2010-12-21
@mambet

As far as I know, APR has nothing to do with it. Did everyone look at the logs? There are several different ones. Plus, I came across the fact that tomcat sometimes does not dump an error into the log before closing (or filling the buffer) - try to make tomcat stop, and then look at the log.
Well, the level of logging can be set in more detail.
In general, it looks like you have unloaded the servlet incorrectly. Put directly in ROOT with your hands, for example. How was it added? Through the web admin?

S
Stas_Telnov, 2010-12-21
@Stas_Telnov

sandello and mambet thanks for participating and trying to help, but the problem somehow resolved itself, after some of my absence from home, probably restarting the computer helped.
Although nothing has changed since then, so it is not known what the problem was, everything remained as it was.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question