tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52511] Exception thrown and logged for all web apps without /WEB-INF/classes
Date Mon, 23 Jan 2012 21:06:50 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52511

Jess Holle <jessh@ptc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Jess Holle <jessh@ptc.com> 2012-01-23 21:06:50 UTC ---
This appears to be due to a change in ContextConfig from:

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

to

                        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.  The old code did not consider this an error and
just moved on.  The new code considers this an error to be logged including an
exception trace.

I'd patch this myself, but I'm not familiar with the code.  This leaves open
questions like: should listBindings() throw an exception upon finding no
bindings -- or should it really just return an empty enumeration?  What other
side-effects will this have?  Or should this ContextConfig code be changed.

Overall this makes any perfectly fine web app without /WEB-INF/classes look
suspect/unreliable, which is not appropriate.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message