首页 新闻 会员 周边 捐助

tomcat安装成功,localhost:8080打得开*.jsp打不开

0
悬赏园豆:30 [已解决问题] 解决于 2017-02-09 10:11

求助。如图,一个最简单的代码。出现404错误,可是我觉得路径并没有错,大家帮帮忙看看哪里错了。

晴空梦暖的主页 晴空梦暖 | 初学一级 | 园豆:177
提问于:2017-02-08 17:14
< >
分享
最佳答案
1

1:tomcat启动了么? -->把8080后边的删掉看一下apache出来否;

2:项目加载到tomcat了么?

收获园豆:30
Ctrl` | 老鸟四级 |园豆:3317 | 2017-02-08 17:26

能出来Apache,启动了。

而且项目加载到tomcat了

晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 17:34

@晴空梦暖: web.xml贴出来看看

Ctrl` | 园豆:3317 (老鸟四级) | 2017-02-08 17:37

@g皓皓: 

晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 17:39

@晴空梦暖: console有没有什么别的异常信息?或者有否页面建立后删除、更换目录再建的情况。clean下重启下都试试

Ctrl` | 园豆:3317 (老鸟四级) | 2017-02-08 17:44

@g皓皓: 

二月 08, 2017 6:04:23 下午 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.2.10.
二月 08, 2017 6:04:23 下午 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
二月 08, 2017 6:04:24 下午 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["http-apr-8080"]
二月 08, 2017 6:04:24 下午 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
二月 08, 2017 6:04:24 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1942 ms
二月 08, 2017 6:04:24 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 08, 2017 6:04:24 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.8
二月 08, 2017 6:04:24 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor First.xml from D:\Tomcat\conf\Catalina\localhost
二月 08, 2017 6:04:24 下午 org.apache.catalina.startup.HostConfig deployDescriptor
警告: A docBase D:\Tomcat\webapps\First inside the host appBase has been specified, and will be ignored
二月 08, 2017 6:04:24 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:First' did not find a matching property.
二月 08, 2017 6:04:25 下午 org.apache.catalina.startup.HostConfig deployDescriptor
严重: Error deploying configuration descriptor First.xml
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1908)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1797)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1756)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1742)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1245)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:874)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1302)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:343)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:323)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1043)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)

二月 08, 2017 6:04:25 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
二月 08, 2017 6:04:26 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory First
二月 08, 2017 6:04:26 下午 org.apache.catalina.startup.HostConfig deployDirectory
严重: Error deploying web application directory First
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1908)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1797)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1756)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1742)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1245)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:874)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1044)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:967)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1302)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:343)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:323)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1043)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)

二月 08, 2017 6:04:26 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory manager
二月 08, 2017 6:04:26 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
二月 08, 2017 6:04:27 下午 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["http-apr-8080"]
二月 08, 2017 6:04:27 下午 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
二月 08, 2017 6:04:27 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2327 ms

晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 18:07

@晴空梦暖: 

web.xml <webapp>里有metadata-complete="true"这句么?没有加上试试

Ctrl` | 园豆:3317 (老鸟四级) | 2017-02-08 18:19

@g皓皓: 好了,能出结果了。但是要每个项目都加这句话吗?

晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 18:25

@晴空梦暖: 官方解释:web.xml文件中使用<metadata-complete元素通知Web容器是否要寻找注解,如果你将<metadata-complete设为false,或者在文件中不指定<metadata-complete元素,那么在部署期间,容器必须扫描注解和Web分片,为Web应用程序构建有效的元数据。如果将<metadata-complete设为true,将由部署描述符为Web应用程序提供所有的配置信息。

个人理解:也不一定。不过具体什么因素会加上我也忘记了(建议百度去学习了解下)。我只是根据你的错误log找出问题所在。若有用请记得结账。谢谢~

Ctrl` | 园豆:3317 (老鸟四级) | 2017-02-09 09:49

@g皓皓: 谢谢~

晴空梦暖 | 园豆:177 (初学一级) | 2017-02-09 10:08
其他回答(2)
0

Server中映射的路径是First吗? 8080/First这个地址是和你的这个对应的

2012 | 园豆:21237 (高人七级) | 2017-02-08 17:36

支持(0) 反对(0) 晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 17:37
0

肯定是url问题啊

 

让我发会呆 | 园豆:2929 (老鸟四级) | 2017-02-08 17:37

但是我的是哪里错了呢?http://localhost:8080/First/New.jsp,first是工程。

支持(0) 反对(0) 晴空梦暖 | 园豆:177 (初学一级) | 2017-02-08 17:42

@晴空梦暖: 在写一个index.jsp

支持(0) 反对(0) 让我发会呆 | 园豆:2929 (老鸟四级) | 2017-02-08 17:43

@晴空梦暖: 你这个<welcome-file-list> 要有对应,或者加一个New.jsp

支持(0) 反对(0) 让我发会呆 | 园豆:2929 (老鸟四级) | 2017-02-08 17:43
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册