Buggy code:
public class WicketFilter implements Filter { public static final String APP_FACT_PARAM = "applicationFactoryClassName" ; public static final String FILTER_MAPPING_PARAM = "filterMappingUrlPattern" ; private static final Log log = LogFactory . getLog ( WicketFilter . class ) ; static final String SERVLET_PATH_HOLDER = "<servlet>" ; private FilterConfig filterConfig ; private String filterPath ; private WebApplication webApplication ; private boolean servletMode = false ; public void destroy ( ) { } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } public final void doGet ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { } public FilterConfig getFilterConfig ( ) { } public String getRelativePath ( HttpServletRequest request ) { } public void init ( FilterConfig filterConfig ) throws ServletException { this . filterConfig = filterConfig ; if ( WicketFilter . SERVLET_PATH_HOLDER . equals ( filterConfig . getInitParameter ( WicketFilter . FILTER_MAPPING_PARAM ) ) ) { servletMode = true ; } final ClassLoader previousClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Thread . currentThread ( ) . setContextClassLoader ( getClassLoader ( ) ) ; if ( ( filterConfig . getInitParameter ( WicketFilter . FILTER_MAPPING_PARAM ) ) == null ) { InputStream is = filterConfig . getServletContext ( ) . getResourceAsStream ( "//WEB-INF//web.xml" ) ; if ( is != null ) { try { filterPath = getFilterPath ( filterConfig . getFilterName ( ) , is ) ; } catch ( Exception e ) { WicketFilter . log . debug ( "Error<seq2seq4repair_space>parsing<seq2seq4repair_space>web.xml" , e ) ; } } if ( ( filterPath ) == null ) { WicketFilter . log . info ( ( ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>filter<seq2seq4repair_space>mapping<seq2seq4repair_space>web.xml<seq2seq4repair_space>for<seq2seq4repair_space>" + ( filterConfig . getFilterName ( ) ) ) + ".<seq2seq4repair_space>" ) + "Configure<seq2seq4repair_space>with<seq2seq4repair_space>init-param<seq2seq4repair_space>" ) + ( WicketFilter . FILTER_MAPPING_PARAM ) ) + "<seq2seq4repair_space>if<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>\"//*\"." ) ) ; } } IWebApplicationFactory factory = getApplicationFactory ( ) ; this . webApplication = factory . createApplication ( this ) ; this . webApplication . setWicketFilter ( this ) ; <START_BUG> String contextKey = "org.apache.wicket:" + ( filterConfig . getFilterName ( ) ) ; <END_BUG> filterConfig . getServletContext ( ) . setAttribute ( contextKey , this . webApplication ) ; Application . set ( webApplication ) ; this . webApplication . internalInit ( ) ; this . webApplication . init ( ) ; this . webApplication . initializeComponents ( ) ; this . webApplication . logStarted ( ) ; } finally { Application . unset ( ) ; Thread . currentThread ( ) . setContextClassLoader ( previousClassLoader ) ; } } private String getFilterPath ( String filterName , InputStream is ) throws ServletException { } private boolean isWicketRequest ( String relativePath ) { } private void maybeSetLastModified ( final HttpServletResponse resp , final long lastModified ) { } protected IWebApplicationFactory getApplicationFactory ( ) { } protected ClassLoader getClassLoader ( ) { } protected String getFilterPath ( HttpServletRequest request ) { } long getLastModified ( final HttpServletRequest request ) { } }

Fix:
String contextKey = "wicket:" + ( filterConfig . getFilterName ( ) ) ;