tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (TOMEE-1091) Cannot inject org.slf4j.Logger into passivation capable bean
Date Fri, 29 Nov 2013 17:37:35 GMT

     [ https://issues.apache.org/jira/browse/TOMEE-1091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Romain Manni-Bucau resolved TOMEE-1091.
---------------------------------------

    Resolution: Invalid

By spec (CDI 1.0) Logger is not serializable so it shouldn't be supported. CDI 1.1 will support
it normally.

> Cannot inject org.slf4j.Logger into passivation capable bean
> ------------------------------------------------------------
>
>                 Key: TOMEE-1091
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1091
>             Project: TomEE
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>         Environment: Windows 7 x64, jdk 1.6.0
>            Reporter: Donatas Ciuksys
>
> I have producer that creates org.slf4j.Logger instances by:
> {code}
> @Produces
>     public Logger produceLogger(InjectionPoint injectionPoint) {
>         return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass());
>     }
> {code}
> Trying to inject Logger into passivation capable bean:
> {code}
> @SessionScoped
> @Named
> public class TestLoggerInjection implements Serializable {
>     @Inject
>     private Logger logger;
> {code}
> gives:
> {code}
> SEVERE: CDI Beans module deployment failed
> org.apache.webbeans.exception.inject.DeploymentException: org.apache.webbeans.exception.WebBeansConfigurationException:
Passivation capable beans must satisfy passivation capable dependencies. Bean : TestLoggerInjection,
Name:testLoggerInjection, WebBeans Type:MANAGED, API Types:[java.io.Serializable,test.TestLoggerInjection,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
does not satisfy. Details about the Injection-point: Field Injection Point, field name : 
logger, Bean Owner : [TestLoggerInjection, Name:testLoggerInjection, WebBeans Type:MANAGED,
API Types:[java.io.Serializable,test.TestLoggerInjection,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]]
> 	at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:226)
> 	at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:187)
> 	at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:162)
> 	at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43)
> 	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:799)
> 	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
> 	at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1205)
> 	at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1051)
> 	at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:127)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> 	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
> 	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.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:622)
> 	at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:593)
> 	at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:44)
> 	at org.apache.openejb.assembler.DeployerEjb.deploy(DeployerEjb.java:168)
> 	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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:182)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:164)
> 	at org.apache.openejb.security.internal.InternalSecurityInterceptor.invoke(InternalSecurityInterceptor.java:34)
> 	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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:182)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:164)
> 	at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:180)
> 	at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:99)
> 	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.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:182)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:164)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:80)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:212)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:181)
> 	at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:370)
> 	at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:181)
> 	at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:344)
> 	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:240)
> 	at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:86)
> 	at org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:58)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> 	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
> 	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)
> 	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.webbeans.exception.WebBeansConfigurationException: Passivation
capable beans must satisfy passivation capable dependencies. Bean : TestLoggerInjection, Name:testLoggerInjection,
WebBeans Type:MANAGED, API Types:[java.io.Serializable,test.TestLoggerInjection,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
does not satisfy. Details about the Injection-point: Field Injection Point, field name : 
logger, Bean Owner : [TestLoggerInjection, Name:testLoggerInjection, WebBeans Type:MANAGED,
API Types:[java.io.Serializable,test.TestLoggerInjection,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]]
> 	at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapableDependencies(DeploymentValidationService.java:176)
> 	at org.apache.webbeans.config.DeploymentValidationService.validatePassivationCapable(DeploymentValidationService.java:127)
> 	at org.apache.webbeans.config.BeansDeployer.checkPassivationScope(BeansDeployer.java:840)
> 	at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:458)
> 	at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:420)
> 	at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:200)
> 	... 67 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message