<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=nydi" rel="nofollow">Daniel Nydegger</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7854?redirect=false" rel="nofollow">SPR-7854</a></strong> and commented</p>
<p dir="auto">If a bean is annotated with <code class="notranslate">@Primary</code> or the attribute primary is set on the &lt;bean&gt; element, then the injection mechanism choose the primary configured bean as first choice if more than one candidate are qualified. This works fine with usage of <code class="notranslate">@Autowired</code> or <code class="notranslate">@Inject</code>.</p>
<p dir="auto">By resolve the bean over the application context, I expected the same behaviour. Because the DefaultListableBeanFactory implementation of &lt;T&gt; T getBean(Class&lt;T&gt; requiredType) method doesn't check the the primary attribute of BeanDefinition, a NoSuchBeanDefinitionException is thrown in case of multiple qualified bean candidates regardless the the primary qualification.</p>
<p dir="auto">I posted a workaround solution in my blog: <a href="http://develop.nydi.ch/2010/12/spring-primary-bean-injection/" rel="nofollow">http://develop.nydi.ch/2010/12/spring-primary-bean-injection/</a></p>
<p dir="auto">To reproduce this behavior you can run the following JUnit test case.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { TestSupport.SPRING_CONFIG_FILE_PATH })
public class PrimarySupportTest implements ApplicationContextAware {

	private SingleService singleService;
	private ApplicationContext applicationContext;
	
	@Inject
    public void setSingleService(SingleService singleService) {
		this.singleService = singleService;
	}
	
	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		this.applicationContext = applicationContext;
	}
    
    @Test
    public void testInjectedService() {
        Assert.assertNotNull(&quot;contextSingleService is null&quot;, singleService);
        Assert.assertEquals(&quot;wrong instance&quot;, SingleServiceImpl_1.class.getName(), singleService.getClass().getName());
    }
    
    @Test
    public void testServiceWithGetBean() {
    	SingleService contextSingleService = applicationContext.getBean(&quot;singleServiceImpl_1&quot;, SingleService.class);
        Assert.assertNotNull(&quot;contextSingleService is null&quot;, contextSingleService);
        Assert.assertEquals(&quot;wrong instance&quot;, SingleServiceImpl_1.class.getName(), contextSingleService.getClass().getName());

    	contextSingleService = applicationContext.getBean(&quot;singleServiceImpl_2&quot;, SingleService.class);
        Assert.assertNotNull(&quot;contextSingleService is null&quot;, contextSingleService);
        Assert.assertEquals(&quot;wrong instance&quot;, SingleServiceImpl_2.class.getName(), contextSingleService.getClass().getName());

        // SingleServiceImpl_1 is annotated with @Primary so SingleServiceImpl_1 instance should returned here, but 
    	contextSingleService = applicationContext.getBean(SingleService.class);
        Assert.assertNotNull(&quot;contextSingleService is null&quot;, contextSingleService);
        Assert.assertEquals(&quot;wrong instance&quot;, SingleServiceImpl_1.class.getName(), contextSingleService.getClass().getName());
    }
}"><pre class="notranslate"><code class="notranslate">@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { TestSupport.SPRING_CONFIG_FILE_PATH })
public class PrimarySupportTest implements ApplicationContextAware {

	private SingleService singleService;
	private ApplicationContext applicationContext;
	
	@Inject
    public void setSingleService(SingleService singleService) {
		this.singleService = singleService;
	}
	
	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		this.applicationContext = applicationContext;
	}
    
    @Test
    public void testInjectedService() {
        Assert.assertNotNull("contextSingleService is null", singleService);
        Assert.assertEquals("wrong instance", SingleServiceImpl_1.class.getName(), singleService.getClass().getName());
    }
    
    @Test
    public void testServiceWithGetBean() {
    	SingleService contextSingleService = applicationContext.getBean("singleServiceImpl_1", SingleService.class);
        Assert.assertNotNull("contextSingleService is null", contextSingleService);
        Assert.assertEquals("wrong instance", SingleServiceImpl_1.class.getName(), contextSingleService.getClass().getName());

    	contextSingleService = applicationContext.getBean("singleServiceImpl_2", SingleService.class);
        Assert.assertNotNull("contextSingleService is null", contextSingleService);
        Assert.assertEquals("wrong instance", SingleServiceImpl_2.class.getName(), contextSingleService.getClass().getName());

        // SingleServiceImpl_1 is annotated with @Primary so SingleServiceImpl_1 instance should returned here, but 
    	contextSingleService = applicationContext.getBean(SingleService.class);
        Assert.assertNotNull("contextSingleService is null", contextSingleService);
        Assert.assertEquals("wrong instance", SingleServiceImpl_1.class.getName(), contextSingleService.getClass().getName());
    }
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public interface BaseService {
	void callBase();
}"><pre class="notranslate"><code class="notranslate">public interface BaseService {
	void callBase();
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Service
@Named
@Primary
public class SingleServiceImpl_1 implements SingleService {
	@Override
	public void callMe() {
	}
}"><pre class="notranslate"><code class="notranslate">@Service
@Named
@Primary
public class SingleServiceImpl_1 implements SingleService {
	@Override
	public void callMe() {
	}
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Service
@Named
public class SingleServiceImpl_2 implements SingleService {
	@Override
	public void callMe() {
	}
}"><pre class="notranslate"><code class="notranslate">@Service
@Named
public class SingleServiceImpl_2 implements SingleService {
	@Override
	public void callMe() {
	}
}
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398113244" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13135" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13135/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13135">#13135</a> Make BeanFactoryLocator aware of autowiring (and primary flag) (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109970" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12590" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12590/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12590">#12590</a> Add support for type-based RuntimeBeanReference</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/7e74fd2b7fb30e6206d40bb7235d82433682386a/hovercard" href="https://github.com/spring-projects/spring-framework/commit/7e74fd2b7fb30e6206d40bb7235d82433682386a"><tt>7e74fd2</tt></a></p>
<p dir="auto">12 votes, 13 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=aappddeevv" rel="nofollow">aappddeevv</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8557?redirect=false" rel="nofollow">SPR-8557</a></strong> and commented</p>
<p dir="auto">The SpringServletContainerInitializer seems to think that a number of classes implement WebApplicationInitializer and tries to initialize them. However, the classes do not implement that interface. In my case, it tries to "initialize" classes belonging to the richfaces JSF implementation.</p>
<p dir="auto">web.xml has a context listener and a requestcontext listener defined in them. My applicationContext is blank.</p>
<p dir="auto">Here's the log:</p>
<p dir="auto">Jul 23, 2011 1:32:14 PM com.springsource.tcserver.security.PropertyDecoder &lt;init&gt;<br>
INFO: tc Runtime property decoder using memory-based key<br>
Jul 23, 2011 1:32:15 PM com.springsource.tcserver.security.PropertyDecoder &lt;init&gt;<br>
INFO: tcServer Runtime property decoder has been initialized in 917 ms<br>
Jul 23, 2011 1:32:15 PM org.apache.coyote.AbstractProtocolHandler init<br>
INFO: Initializing ProtocolHandler ["http-bio-8080"]<br>
Jul 23, 2011 1:32:16 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init<br>
INFO: Started up JMX registry on 127.0.0.1:6969 in 203 ms<br>
Jul 23, 2011 1:32:16 PM org.apache.catalina.startup.Catalina load<br>
INFO: Initialization processed in 2067 ms<br>
Jul 23, 2011 1:32:16 PM org.apache.catalina.core.StandardService startInternal<br>
INFO: Starting service Catalina<br>
Jul 23, 2011 1:32:16 PM org.apache.catalina.core.StandardEngine startInternal<br>
INFO: Starting Servlet Engine: SpringSource tc Runtime 2.5.0.RELEASE/7.0.12.A.RELEASE<br>
Jul 23, 2011 1:32:16 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:32:16 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:32:28 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class org.ajax4jsf.renderkit.AjaxBehaviorRenderer is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)<br>
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324)<br>
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)<br>
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)<br>
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
at java.lang.reflect.Method.invoke(Method.java:613)<br>
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)<br>
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)<br>
Jul 23, 2011 1:32:28 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
INFO: Deploying web application directory manager<br>
Jul 23, 2011 1:32:29 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
INFO: Deploying web application directory ROOT<br>
Jul 23, 2011 1:32:29 PM org.apache.coyote.AbstractProtocolHandler start<br>
INFO: Starting ProtocolHandler ["http-bio-8080"]<br>
Jul 23, 2011 1:32:29 PM org.apache.catalina.startup.Catalina start<br>
INFO: Server startup in 12818 ms<br>
Jul 23, 2011 1:32:39 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:32:39 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:32:47 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:32:47 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class com.sun.faces.renderkit.html_basic.CompositeRenderer is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:32:57 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:32:57 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:33:04 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:33:04 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class javax.faces.component.UIViewParameter is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:33:14 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:33:14 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:33:20 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:33:20 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class org.richfaces.renderkit.html.HtmlMessagesRenderer is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:33:30 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:33:30 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:33:37 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:33:37 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class org.richfaces.renderkit.CollapsibleSubTableRenderer is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:33:47 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:33:47 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:33:53 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:33:53 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class javax.faces.component.UISelectBoolean is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:34:03 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:34:03 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:34:10 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:34:10 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class com.sun.faces.facelets.tag.ui.UIDebug is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:34:20 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:34:20 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Jul 23, 2011 1:34:27 PM org.apache.catalina.core.NamingContextListener lifecycleEvent<br>
SEVERE: Creation of the naming context failed: javax.naming.NamingException: Context is read only<br>
Jul 23, 2011 1:34:27 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
SEVERE: Error deploying configuration descriptor testprimefaces.xml<br>
java.lang.IllegalArgumentException: class com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer is not assignable to interface org.springframework.web.WebApplicationInitializer<br>
at org.springframework.util.Assert.isAssignable(Assert.java:368)<br>
at org.springframework.util.Assert.isAssignable(Assert.java:351)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:128)<br>
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:145)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)<br>
at java.lang.Thread.run(Thread.java:722)<br>
Jul 23, 2011 1:34:37 PM org.apache.catalina.startup.HostConfig deployDescriptor<br>
INFO: Deploying configuration descriptor testprimefaces.xml from C:\tmp\eclipse\springsource-tool-suite-2.7.0-e3.62-win32-x86_64\vfabric-tc-server-developer-2.5.0.RELEASE\dev\conf\Catalina\localhost<br>
Jul 23, 2011 1:34:37 PM org.apache.catalina.startup.SetContextPropertiesRule begin<br>
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testprimefaces' did not find a matching property.<br>
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space<br>
at java.lang.ClassLoader.defineClass1(Native Method)<br>
at java.lang.ClassLoader.defineClass(ClassLoader.java:794)<br>
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:144)<br>
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)<br>
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)<br>
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)<br>
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)<br>
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1956)<br>
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1919)<br>
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)<br>
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)<br>
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)<br>
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)<br>
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)<br>
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)<br>
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)<br>
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)<br>
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)<br>
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)<br>
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)<br>
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)<br>
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)<br>
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)<br>
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br>
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)<br>
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)<br>
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)<br>
Exception in thread "RMI RenewClean-[127.0.0.1:6969]" java.lang.OutOfMemoryError: PermGen space<br>
at sun.misc.Unsafe.defineClass(Native Method)<br>
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)<br>
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)<br>
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)<br>
at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:113)<br>
at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:331)<br>
at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1343)<br>
at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:69)<br>
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:454)<br>
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:430)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at java.io.ObjectStreamClass.&lt;init&gt;(ObjectStreamClass.java:430)<br>
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:327)<br>
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1130)<br>
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)<br>
at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown Source)<br>
at sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:360)<br>
at sun.rmi.transport.DGCClient$EndpointEntry.access$1600(DGCClient.java:171)<br>
at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:574)<br>
at java.lang.Thread.run(Thread.java:722)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 M2</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?112139-is-not-assignable-to-WebApplicationInitializer" rel="nofollow">http://forum.springsource.org/showthread.php?112139-is-not-assignable-to-WebApplicationInitializer</a></p>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/179dad8c249dc7debb55aa181710af8e437d9807/hovercard" href="https://github.com/spring-projects/spring-framework/commit/179dad8c249dc7debb55aa181710af8e437d9807"><tt>179dad8</tt></a></p>