Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 7 in Eclipse Indigo: javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found

Tags:

eclipse

tomcat

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"]
like image 606
user1206754 Avatar asked Dec 28 '22 06:12

user1206754


1 Answers

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:

enter image description here

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 /:

enter image description here

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:

  • Tomcat started in Eclipse but unable to connect to http://localhost:8085/
like image 131
BalusC Avatar answered Apr 07 '23 00:04

BalusC