You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/12/12 16:51:40 UTC

[Bug 54284] New: Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

            Bug ID: 54284
           Summary: Util.objectNameValueNeedsQuote throws NPE for
                    anonymous Filters
           Product: Tomcat 7
           Version: 7.0.26
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: benjamin.gehrels_external@immobilienscout24.de
    Classification: Unclassified

How to reproduce?

>From inside the contextInitialized-Method of an ServletContextListener
instance, call

context.addFilter(null,
      new ArbitraryFilter(pathPrefix)).addMappingForUrlPatterns(null, false,
pathPrefix);

What happens?

Dec 12, 2012 3:59:03 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter null
java.lang.NullPointerException
        at
org.apache.tomcat.util.modeler.Util.objectNameValueNeedsQuote(Util.java:26)
        at
org.apache.catalina.core.ApplicationFilterConfig.registerJMX(ApplicationFilterConfig.java:421)
        at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:282)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
        at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

Dec 12, 2012 3:59:03 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Dec 12, 2012 3:59:03 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors


What should happen?
Either - if null is not an allowed filter name, throw a
IllegalArgumentException on context.addFilter(...)
Or, if it is an allowed filter name, handle null-values gracefully

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

--- Comment #4 from Violeta Georgieva <vi...@apache.org> ---
Created attachment 29817
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29817&action=edit
Patch proposal

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Mark Thomas <ma...@apache.org> ---
Thanks for the patch and for working with the EG to obtain the clarification.

The patch has been applied to trunk and 7.0.x and will be included in 7.0.35
onwards.

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

benjamin.gehrels_external@immobilienscout24.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|7.0.26                      |7.0.34

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

--- Comment #2 from Violeta Georgieva <vi...@apache.org> ---
Hi,

I'm going to work on this.

Regards
Violeta

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #6 from Violeta Georgieva <vi...@apache.org> ---
Hi,

As per clarification provided by Servlet Specification expert group -
IllegalArgumentException should be thrown when filter name is NULL or empty
string.

Patch proposal and test case are attached.

Any comments will be appreciated.

Regards
Violeta

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

--- Comment #1 from benjamin.gehrels_external@immobilienscout24.de ---
I just recognized that i created the bug with a wrong affected version number.
The bug happens in Rel. 7.0.34, probably as a result of fixing #54170

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

benjamin.gehrels_external@immobilienscout24.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |benjamin.gehrels_external@i
                   |                            |mmobilienscout24.de
                 OS|                            |All

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

--- Comment #5 from Violeta Georgieva <vi...@apache.org> ---
Created attachment 29818
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29818&action=edit
Test case

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29817|0                           |1
        is obsolete|                            |

--- Comment #7 from Violeta Georgieva <vi...@apache.org> ---
Created attachment 29822
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29822&action=edit
patch proposal

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


[Bug 54284] Util.objectNameValueNeedsQuote throws NPE for anonymous Filters

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54284

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Servlet 3.0 javadoc does not specify what should be the behavior when
filterName is NULL.
I requested a clarification [1] from the Servlet Specification expert group.
I'm changing the status to NEEDINFO.

Regards
Violeta

[1] http://java.net/jira/browse/SERVLET_SPEC-51

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