Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344513 - Attempting to set ConfigurationClasses in jetty-web.xml causes NPE
Summary: Attempting to set ConfigurationClasses in jetty-web.xml causes NPE
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Michael Gorovoy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-02 18:25 EDT by Michael Gorovoy CLA
Modified: 2011-05-25 20:00 EDT (History)
3 users (show)

See Also:


Attachments
Stack trace for situation in comment #3 (2.64 KB, text/plain)
2011-05-24 06:39 EDT, Andreas Kohn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gorovoy CLA 2011-05-02 18:25:36 EDT
Adding the following configuration to jetty-web.xml configuration file causes NPE to occur during WebAppContext start.

...
    <Array id="plusConfig" type="java.lang.String">
        <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
        <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
        <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
        <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
    </Array>

    <Set name="configurationClasses">
        <Ref id="plusConfig"/>
    </Set>
...
Comment 1 Michael Gorovoy CLA 2011-05-02 18:30:01 EDT
NPE is caused by JettyWebXmlConfiguation call to setConfigurationClasses that clears the array that holds configuration objects that causes an NPE during attempt to iterate to the next one.
Comment 2 Michael Gorovoy CLA 2011-05-02 19:21:30 EDT
Committed r3056.
Comment 3 Andreas Kohn CLA 2011-05-24 06:36:06 EDT
It seems that this change now leads to another problem: when running a webapp using the jetty-maven-plugin:run-war goal an IllegalStateException is thrown from JettyWebAppContext#setConfigurations() because isRunning() returns true (_state==_STARTING).
Comment 4 Andreas Kohn CLA 2011-05-24 06:39:20 EDT
Created attachment 196420 [details]
Stack trace for situation in comment #3