[
http://jira.jboss.com/jira/browse/JBSEAM-1583?page=comments#action_12367440 ]
Magnus Heino commented on JBSEAM-1583:
--------------------------------------
This is the stack from when the empty constructor is being called.
WsProcessRepository_$$_javassist_0(WsProcessRepository).<init>() line: 24
WsProcessRepository_$$_javassist_0.<init>() line: not available
NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available
[native method]
NativeConstructorAccessorImpl.newInstance(Object[]) line: 39
DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27
Constructor<T>.newInstance(Object...) line: 513
Class<T>.newInstance0() line: 355
Class<T>.newInstance() line: 308
ProxyUtils.enhance(Object, Set<Class>, IoCComponent) line: 71
SpringComponent(IoCComponent).instantiateJavaBean() line: 94
SpringComponent(Component).instantiate() line: 1154
SpringComponent(Component).newInstance() line: 1849
Component.getInstance(String, boolean, Object) line: 1756
Component.getInstance(String, ScopeType, boolean) line: 1735
Component.getInstance(String, ScopeType) line: 1729
SeamComponentPostProcessor.postProcessAfterInitialization(Object, String) line: 49
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).applyBeanPostProcessorsAfterInitialization(Object,
String) line: 314
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).initializeBean(String,
Object, RootBeanDefinition) line: 1184
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String,
RootBeanDefinition, Object[]) line: 407
AbstractBeanFactory$1.getObject() line: 255
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String,
ObjectFactory) line: 156
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String, Class, Object[]) line:
252
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String) line: 164
DefaultListableBeanFactory.preInstantiateSingletons() line: 287
XmlWebApplicationContext(AbstractApplicationContext).finishBeanFactoryInitialization(ConfigurableListableBeanFactory)
line: 689
XmlWebApplicationContext(AbstractApplicationContext).refresh() line: 358
ContextLoader.startupContextLoader(WebApplicationContext) line: 64
ContextLoader.create() line: 43
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native
method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
Reflections.invoke(Method, Object, Object...) line: 21
Reflections.invokeAndWrap(Method, Object, Object...) line: 124
Component.callComponentMethod(Object, Method, Object...) line: 1957
Component.callCreateMethod(Object) line: 1880
Component.newInstance() line: 1859
Contexts.startup(Component) line: 304
Contexts.startup(ScopeType) line: 278
ServletLifecycle.endInitialization() line: 98
Initialization.init() line: 508
seam:component intercept uses Seam standard rules by default
------------------------------------------------------------
Key: JBSEAM-1583
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1583
Project: JBoss Seam
Issue Type: Bug
Components: Spring
Affects Versions: 2.0.0.BETA1
Reporter: Magnus Heino
Assigned To: Michael Youngstrom
From spring-seam-2.0.xsd, intercept:
Determines whether Seam interceptors should be wrapped around a bean, by overriding
Seam's default rules.
Seldom do you want the seam interceptors wrapped around a sprig singleton. Auto will use
choose no
interception for a singleton and use Seam standard rules otherwise.
Looking at the code, I can't find anything about this "no interception for a
singleton" default.
This bean
<bean id="processRepository"
class="se.lantmateriet.wfl.dataaccess.WsProcessRepository">
<constructor-arg value="http://localhost/avtal/avtalservice.asmx"/>
<seam:component/>
</bean>
fails like this:
12:45:35,203 DEBUG [ProxyUtils] Creating proxy for Spring Seam component
'processRepository' using class:
se.lantmateriet.wfl.dataaccess.WsProcessRepository
12:45:35,282 INFO [DefaultListableBeanFactory] Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@8c2d94: defining
beans [org.jboss.seam.ioc.spring.seamComponentPostProcessor,processRepository]; root of
factory hierarchy
12:45:35,297 ERROR [[/wfl-seam]] Exception sending context initialized event to listener
instance of class org.jboss.seam.servlet.SeamListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'processRepository' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is
org.jboss.seam.InstantiationException: Could not instantiate Seam component:
processRepository
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:430)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:689)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:358)
at org.jboss.seam.ioc.spring.ContextLoader.startupContextLoader(ContextLoader.java:64)
at org.jboss.seam.ioc.spring.ContextLoader.create(ContextLoader.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
at org.jboss.seam.Component.callCreateMethod(Component.java:1880)
at org.jboss.seam.Component.newInstance(Component.java:1859)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:98)
at org.jboss.seam.init.Initialization.init(Initialization.java:508)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component:
processRepository
at org.jboss.seam.Component.newInstance(Component.java:1853)
at org.jboss.seam.Component.getInstance(Component.java:1756)
at org.jboss.seam.Component.getInstance(Component.java:1735)
at org.jboss.seam.Component.getInstance(Component.java:1729)
at
org.jboss.seam.ioc.spring.SeamComponentPostProcessor.postProcessAfterInitialization(SeamComponentPostProcessor.java:49)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:314)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1184)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:689)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:358)
at org.jboss.seam.ioc.spring.ContextLoader.startupContextLoader(ContextLoader.java:64)
at org.jboss.seam.ioc.spring.ContextLoader.create(ContextLoader.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
at org.jboss.seam.Component.callCreateMethod(Component.java:1880)
at org.jboss.seam.Component.newInstance(Component.java:1859)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:98)
at org.jboss.seam.init.Initialization.init(Initialization.java:508)
Caused by: java.lang.InstantiationException:
se.lantmateriet.wfl.dataaccess.WsProcessRepository_$$_javassist_0
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.jboss.seam.ioc.ProxyUtils.enhance(ProxyUtils.java:71)
at org.jboss.seam.ioc.IoCComponent.instantiateJavaBean(IoCComponent.java:94)
at org.jboss.seam.Component.instantiate(Component.java:1154)
at org.jboss.seam.Component.newInstance(Component.java:1849)
at org.jboss.seam.Component.getInstance(Component.java:1756)
at org.jboss.seam.Component.getInstance(Component.java:1735)
at org.jboss.seam.Component.getInstance(Component.java:1729)
at
org.jboss.seam.ioc.spring.SeamComponentPostProcessor.postProcessAfterInitialization(SeamComponentPostProcessor.java:49)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:314)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1184)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:689)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:358)
at org.jboss.seam.ioc.spring.ContextLoader.startupContextLoader(ContextLoader.java:64)
at org.jboss.seam.ioc.spring.ContextLoader.create(ContextLoader.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
at org.jboss.seam.Component.callCreateMethod(Component.java:1880)
If I change <seam:component/> to <seam:component
intercept="false"/> everything works.
1. Default for stateless spring beans seems to be true since seam standard rules are
applied if intercept is null, that is not defined. bug?
2. Why would I want to use intercept="true" anyway? What interceptors will be
added?
3. Why is it failing with intercept="true"?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira