Eclipse Indigo中的Tomcat 7:javax.naming.NameNotFoundException:未找到资源/ WEB-INF / classes [英] Tomcat 7 in Eclipse Indigo: javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found

查看:95
本文介绍了Eclipse Indigo中的Tomcat 7:javax.naming.NameNotFoundException:未找到资源/ WEB-INF / classes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Eclipse Indigo中配置Tomcat 7,我从

I am trying to configure Tomcat 7 in Eclipse Indigo, i added the Tomcat plugin from http://www.eclipsetotale.com/tomcatPlugin.html#A3 into eclipse\plugins folder. Now when i start tomcat i am getting the below error:

    Feb 13, 2012 4:23:35 PM org.apache.catalina.startup.ContextConfig webConfig
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
    at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
    at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Feb 13, 2012 4:23:35 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]

解决方案

SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found

This is actually a bug in Tomcat 7.0.25 and fixed in Tomcat 7.0.26. See also issue 52511. Please note that you can just continue using your web application! This log is purely informal and does not block Tomcat from starting and functioning. It's caused by a change in the way how Tomcat scans annotated classes. This stacktrace will be printed when you don't have any classes in your Eclipse project and hence the /WEB-INF/classes remains empty.

Upgrading to Tomcat 7.0.26 will hide this log. You can also just ignore it altogether and continue using Tomcat as usual.

As per the comments,

i Installed Eclipse for Java EE, in that in the server tab i added the server , when i run the server and try to open the localhost:8080 in the browser, it did not give me the welcome page, therefore i added the plugin in the eclipse plugins, now it gives me the welcome page in browser but adding to that it gives above error in console.

What did it give instead? A server-specific 404 error page or a browser specific "Connection timeout" page? If 404, then the server runs perfectly fine, it's just the URL which did not point anything. Note that Eclipse does by default not deploy Tomcat's own homepage, simply because that's not useful at all while developing. It will only deploy Tomcat's own homepage when you configure Eclipse to take over Tomcat installation instead of using its engine:

You need to let the URL point to the real URL of the deployed web project. It defaults to the project name which is configureable in project's properties. If the project name is for example "Playground", then you need to open http://localhost:8080/Playground instead. If you want to have it on domain root, then you need to change the Context root in Web Project Settings to /:

Last but not least, I recommend to remove that Sysdeo plugin which you installed without any necessary reason. It is not in any way better than the Eclipse-builtin plugin.

See also:

这篇关于Eclipse Indigo中的Tomcat 7:javax.naming.NameNotFoundException:未找到资源/ WEB-INF / classes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆