浏览 9991 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2014-09-24
最后再做用nginx对tomcat分发。 问题一:我想的这个顺序,合理吗??? 如果合理, 工具说明:我用的是tomcat 7.0.55 版本,java version 1.7.0_25 相关的配置说明: 一、修改server.xml 1.我的第一个tomcat 的 server.xml 中,三种端口我都保持默认(8080,8005,8009) 2.然后在 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat3"> (红色是我添加的部分) 3.再后,<Host name="localhost" appBase="/var/www/test" unpackWARs="true" autoDeploy="true"> (红色是我的修改的部分) 修改context.xml 在<Context> </Context>中间,我加上了这样一段: <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" sticky="false" lockingMode="auto" sessionBackupAsync="false" sessionBackupTimeout="1000" transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"/> 我新建了这两个目录 /var/www/test/ROOT /var/www/test/ROOT/WEB-INF 1.我在/var/www/test/ROOT这个目录下面新建一个index.jsp文件 它的内容是这样的 <%@ page contentType="text/html; charset=GBK" %> <%@ page import="java.util.*" %> <html><head><title>Cluster Test</title></head> <body> 172.16.0.5 <% //HttpSession session = request.getSession(true); System.out.println(session.getId()); out.println("<br> SESSION ID:" + session.getId()+"<br>"); %> </body> </html> 我在/var/www/test/ROOT/WEB-INF下面新建一个web.xml文件,它的内容是这样的: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>TomcatDemo</display-name> <distributable/> </web-app> 包的说明 我也加了很多包,因为我看了好几个示例了,包的数量应该是只多不少的 我把这些包都放在了我的tomcat 目录下面的lib目录下 我的包都有: asm-3.2.jar commons-codec-1.5.jar couchbase-client-1.2.2.jar httpcore-4.0.1.jar.zip javolution-5.4.3.1.jar jettison-1.0.1.jar kryo-1.04.jar kryo-serializers-0.8.jar memcached-session-manager-1.6.3.jar memcached-session-manager-tc7-1.6.3.jar minlog-1.2.jar msm-javolution-serializer-1.6.3.jar msm-kryo-serializer-1.6.3.jar msm-xstream-serializer-1.6.3.jar netty-3.5.5.Final.jar reflectasm-0.9.jar spymemcached-2.8.4.jar 最后的问题: 一、如果我把context.xml中的<Manager>节点注释掉,我的tomcat启动不会报错:页面显示也正常 二、如果我把context.xml中的<Manager>节点加上 启动会报错误,如图所示: INFO: Starting with initialBufferSize 102400 and maxBufferSize 2048000 九月 25, 2014 12:27:39 上午 org.apache.catalina.core.StandardContext startInternal SEVERE: Error manager.start() org.apache.catalina.LifecycleException: Failed to start component [de.javakaffee.web.msm.MemcachedBackupSessionManager[]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5499) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.NoClassDefFoundError: de/javakaffee/kryoserializers/DateSerializer at de.javakaffee.web.msm.serializer.kryo.KryoTranscoder.createKryo(KryoTranscoder.java:128) at de.javakaffee.web.msm.serializer.kryo.KryoTranscoder.<init>(KryoTranscoder.java:117) at de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory.getTranscoder(KryoTranscoderFactory.java:62) at de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory.createTranscoder(KryoTranscoderFactory.java:47) at de.javakaffee.web.msm.MemcachedSessionService.createTranscoderService(MemcachedSessionService.java:459) at de.javakaffee.web.msm.MemcachedSessionService.startInternal(MemcachedSessionService.java:435) at de.javakaffee.web.msm.MemcachedBackupSessionManager.startInternal(MemcachedBackupSessionManager.java:509) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |