JavaTomcat启动错误
关键错误日志如下:28-Jun-201907:54:44.034INFO[localhost-startStop-1]org.apache.jasper.servlet....
关键错误日志如下:
28-Jun-2019 07:54:44.034 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
28-Jun-2019 07:54:44.147 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\WebServer\apache-tomcat-8.0.35\webapps\DaysToDie]
28-Jun-2019 07:54:44.173 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DaysToDie]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@aaca5bc]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@77cfd824]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file
at
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at
放到远程之后无法启动,本地正常
1.看了报错之后,这边第一时间是去删tomcat-catalina缓存,然后进行开启
2.仔细检查过web.xml没有问题,甚至删除了后面添加的一部分进行测试,也就是之前这个在远程能正常访问的
3.继续看下面的日志,他说无法打开zip文件后面还报了一些jar资源文件错误
jar文件可以确保是没错误的,刚开始这些放到远程正常启动
我是直接把本地tomcat-webapps放到远程上面的tomcat-webapps的,远程的访问加载路径这些都在第一次使用时改过,后面一段时间也正常使用
后面改了一些代码,然后重新部署时出现该错误 展开
28-Jun-2019 07:54:44.034 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
28-Jun-2019 07:54:44.147 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\WebServer\apache-tomcat-8.0.35\webapps\DaysToDie]
28-Jun-2019 07:54:44.173 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DaysToDie]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@aaca5bc]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@77cfd824]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file
at
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at
放到远程之后无法启动,本地正常
1.看了报错之后,这边第一时间是去删tomcat-catalina缓存,然后进行开启
2.仔细检查过web.xml没有问题,甚至删除了后面添加的一部分进行测试,也就是之前这个在远程能正常访问的
3.继续看下面的日志,他说无法打开zip文件后面还报了一些jar资源文件错误
jar文件可以确保是没错误的,刚开始这些放到远程正常启动
我是直接把本地tomcat-webapps放到远程上面的tomcat-webapps的,远程的访问加载路径这些都在第一次使用时改过,后面一段时间也正常使用
后面改了一些代码,然后重新部署时出现该错误 展开
1个回答
展开全部
原因:这个是JDK版本不对造成的。
解决方法:
1、即你用某版本的JDK编译的class,放在另一版本JDK上去运行,就容易发生这种异常了(常常是高版本编译在低版本上运行时发生)。
2、这里显然你的Tomcat用的JDK与你编译用的JDK不一样,换成一致的版本就OK了。
方法二:
1、在对应DaoImpl中加入sessionfactory的set方法、get方法。
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;}继承JdbcDaoSupport。
UserDaoImpl extends JdbcDaoSupport
解决方法:
1、即你用某版本的JDK编译的class,放在另一版本JDK上去运行,就容易发生这种异常了(常常是高版本编译在低版本上运行时发生)。
2、这里显然你的Tomcat用的JDK与你编译用的JDK不一样,换成一致的版本就OK了。
方法二:
1、在对应DaoImpl中加入sessionfactory的set方法、get方法。
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;}继承JdbcDaoSupport。
UserDaoImpl extends JdbcDaoSupport
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询