Note that the exception logged says:

2012-01-23 09:13:01,010 ERROR [pool-8-thread-1] 
org.apache.catalina.startup.ContextConfig  - 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.deployDescriptor(HostConfig.java:649)
        at 
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Clearly the lack of /WEB-INF/classes is not worthy of an exception, nor an error.

On 1/23/2012 2:15 PM, Jess Holle wrote:
If one's web-app does not contain WEB-INF/classes, Tomcat 7.0.25 logs an error.

This has never been considered an error in any Tomcat to date that I am aware of -- nor any other servlet engine I've tried.

This appears to be an accident as ContextConfig had:

webinfClasses = context.getServletContext().getResource(
                                "/WEB-INF/classes");
                        processAnnotationsUrl(webinfClasses, webXml);

and now has

                        NamingEnumeration<Binding>  listBindings =
context.getResources().listBindings("/WEB-INF/classes");
                        while (listBindings.hasMoreElements()) {
                            Binding binding = listBindings.nextElement();
if (binding.getObject() instanceof FileDirContext) {
                                File webInfCLassDir =
                                    new File(
((FileDirContext) binding.getObject()).getDocBase()); processAnnotationsFile(webInfCLassDir, webXml);
                            }
                        }

which is all well and good except for the differences in behavior when /WEB-INF/classes is not found.

Is there a bug and/or patch for this?

If not I can file a bug -- and hack my own patch, I suppose, though I'd appreciate a stab at a patch by someone who is actually familiar with this code (which I am not).

--
Jess Holle

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to