macos - mac上我的tomcat 成功部署,能访问首页,但是访问项目404

【字号: 日期:2023-08-18浏览:24作者:雯心

问题描述

使用的是eclipse,控制台没有报错

HTTP Status 404 - /test0/

type Status report

message /test0/

description The requested resource is not available.

Apache Tomcat/7.0.64

地址是 http://localhost:8080/test0/test0所在的目录是 /Applications/apache-tomcat-7.0.64/webapps

应该不是访问权限的问题 ,我同一个地方一个test目录下的helloworld能成功访问,控制台报错

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Applications/apache-tomcat-7.0.64/webapps/project01/WEB-INF/classes/com/qs/yzaj/service/business/client/ClientSvc.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn’t supported yet: file [/Applications/apache-tomcat-7.0.64/webapps/project01/WEB-INF/classes/com/qs/yzaj/service/business/client/ClientSvc.class]; nested exception is java.lang.IllegalArgumentException

at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)

Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn’t supported yet: file [/Applications/apache-tomcat-7.0.64/webapps/project01/WEB-INF/classes/com/qs/yzaj/service/business/client/ClientSvc.class]; nested exception is java.lang.IllegalArgumentException

at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:266)... 32 more

Caused by: java.lang.IllegalArgumentException

at org.springframework.asm.ClassReader.<init>(Unknown Source)at org.springframework.asm.ClassReader.<init>(Unknown Source)at org.springframework.asm.ClassReader.<init>(Unknown Source)at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:53)... 35 more

九月 24, 2015 10:29:00 上午 org.apache.catalina.core.StandardContext startInternal严重: One or more listeners failed to start. Full details will be found in the appropriate container log file九月 24, 2015 10:29:00 上午 org.apache.catalina.core.StandardContext startInternal严重: Context [/project01] startup failed due to previous errors九月 24, 2015 10:29:00 上午 org.apache.catalina.core.ApplicationContext log信息: Closing Spring root WebApplicationContext九月 24, 2015 10:29:00 上午 org.apache.catalina.core.StandardContext listenerStop严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListenerjava.lang.IllegalStateException: BeanFactory not initialized or already closed - call ’refresh’ before accessing beans via the ApplicationContext

at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1090)at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1064)at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:559)at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5050)at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5712)at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread.java:745)

问题解答

回答1:

映射的路径不对,看看你的server.xml和web.xml吧~

回答2:

看看test0的访问权限

回答3:

终于搞定了, 是jre的问题。一开始用的jre1.8,换成1.7 ,可能启动的东西比较多,会超时,再把时间从45秒改成450秒就搞定了。谢谢大家的帮助。

相关文章: