I'm new using JSF and I noticed that the JSF doesn't provide some useful annotations, like @ViewAccessScoped (CODI). For use the CODI, I need to use the CDI dependency, so I configured my project with Weld.
Then, JSF + Weld + Tomcat 7 works fine, changing annotations scope to Weld annotations, @ManagedBean to @Named and @NamedProperty to @Inject.
Otherwise, When I try to deploy my Tomcat server now with CODI, I have the following stack trace (using the CODI library like @ViewAccessScoped annotation or not) and the server shutdown:
Mai 22, 2014 12:03:28 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
Mai 22, 2014 12:03:28 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:BioRequestWeld' did not find a matching property.
Mai 22, 2014 12:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mai 22, 2014 12:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mai 22, 2014 12:03:28 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 469 ms
Mai 22, 2014 12:03:28 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mai 22, 2014 12:03:28 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.53
Mai 22, 2014 12:03:30 AM org.jboss.weld.environment.servlet.EnhancedListener onStartup
INFO: Initialize Weld using ServletContainerInitializer
Mai 22, 2014 12:03:30 AM org.jboss.weld.bootstrap.WeldStartup <clinit>
INFO: WELD-000900: 2.2.1 (Final)
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.WeldStartup startContainer
INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
Mai 22, 2014 12:03:31 AM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>
WARN: WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled
Mai 22, 2014 12:03:31 AM org.jboss.weld.interceptor.util.InterceptionTypeRegistry <clinit>
WARN: WELD-001700: Interceptor annotation class javax.ejb.PrePassivate not found, interception based on it is not enabled
Mai 22, 2014 12:03:31 AM org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase.PhaseListenerExtension.filterJsfPhaseListeners(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Mai 22, 2014 12:03:31 AM org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.apache.myfaces.extensions.cdi.jsf.impl.config.view.ViewConfigExtension.processPageDefinitions(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Mai 22, 2014 12:03:31 AM org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] protected org.apache.myfaces.extensions.cdi.core.impl.activation.ActivationExtension.vetoAlternativeTypes(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Mai 22, 2014 12:03:31 AM org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] protected org.apache.myfaces.extensions.cdi.jsf2.impl.scope.mapped.MappedJsf2ScopeExtension.convertJsf2Scopes(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Mai 22, 2014 12:03:31 AM org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations
WARN: WELD-000411: Observer method [BackedAnnotatedMethod] public org.apache.myfaces.extensions.cdi.core.impl.CodiDeactivatorExtension.filter(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Mai 22, 2014 12:03:31 AM org.apache.myfaces.extensions.cdi.core.api.provider.ServiceProvider <clinit>
INFO: org.apache.myfaces.extensions.cdi.core.impl.provider.DefaultServiceProvider installed successfully.
Mai 22, 2014 12:03:31 AM org.apache.myfaces.extensions.cdi.core.api.provider.ServiceProvider <clinit>
INFO: org.apache.myfaces.extensions.cdi.core.impl.provider.DefaultServiceProviderContext installed successfully.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.InjectableValidator because of underlying class loading error: Type javax.validation.Validator not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.InjectableValidatorFactory because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.InjectableMessageInterpolator because of underlying class loading error: Type javax.validation.MessageInterpolator not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorContext because of underlying class loading error: Type javax.validation.ValidatorContext not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.JsfValidatorFactoryProducer because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.CdiAwareValidatorFactory$1 because of underlying class loading error: Type javax.validation.ConstraintValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jpa.impl.EntityManagerEntry because of underlying class loading error: Type javax.persistence.EntityManager not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.ValidatorFactoryStorage because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.CdiAwareBeanValidationProducer because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jsf.impl.bv.InvalidValueAwareMessageInterpolator because of underlying class loading error: Type javax.validation.MessageInterpolator not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.api.ClassLevelConstraintValidator because of underlying class loading error: Type javax.validation.ConstraintValidator not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.SerializableValidatorFactory because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jpa.impl.LegacyTransactionalInterceptorStrategy because of underlying class loading error: Type javax.persistence.EntityManager not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.InjectableConstraintValidatorFactory because of underlying class loading error: Type javax.validation.ConstraintValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.InjectionAwareConstraintValidatorFactory because of underlying class loading error: Type javax.validation.ConstraintValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.SerializableValidatorFactory because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.AdvancedValidatorContext because of underlying class loading error: Type javax.validation.ValidatorContext not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.ValidatorFactoryResolver because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jpa.impl.transaction.TransactionalInterceptorStrategy because of underlying class loading error: Type javax.persistence.EntityManager not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.jpa.impl.PersistenceHelper because of underlying class loading error: Type javax.persistence.EntityManager not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.apache.myfaces.extensions.cdi.bv.impl.CdiAwareValidatorFactory because of underlying class loading error: Type javax.validation.ValidatorFactory not found. If this is unexpected, enable DEBUG logging to see the full error.
Mai 22, 2014 12:03:31 AM org.apache.myfaces.extensions.cdi.core.impl.projectstage.ProjectStageProducer initProjectStage
INFO: Computed the following CODI ProjectStage: Production
Mai 22, 2014 12:03:31 AM org.jboss.weld.environment.tomcat.TomcatContainer initialize
INFO: Tomcat 7+ detected, CDI injection will be available in Servlets, Filters and Listeners.
Mai 22, 2014 12:03:32 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BioRequest]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/BioRequest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type PersistenceStrategy with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private org.apache.myfaces.extensions.cdi.jpa.impl.transaction.TransactionalInterceptor.persistenceStrategy
at org.apache.myfaces.extensions.cdi.jpa.impl.transaction.TransactionalInterceptor.persistenceStrategy(TransactionalInterceptor.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:370)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:291)
at org.jboss.weld.bootstrap.Validator.validateInterceptor(Validator.java:567)
at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:85)
at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:83)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
... 5 more
Mai 22, 2014 12:03:32 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Mai 22, 2014 12:03:32 AM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Mai 22, 2014 12:03:32 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Mai 22, 2014 12:03:32 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Mai 22, 2014 12:03:32 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Mai 22, 2014 12:03:32 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Mai 22, 2014 12:03:32 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-1] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-2] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-3] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-4] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-5] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-6] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-7] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-worker-8] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-1] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-2] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-3] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-4] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-5] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-6] but has failed to stop it. This is very likely to create a memory leak.
Mai 22, 2014 12:03:32 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/BioRequest] appears to have started a thread named [weld-preloader-7] but has failed to stop it. This is very likely to create a memory leak.
It's a very strange error log.
The main point is: What can I do to use CODI with JSF under Tomcat 7? I want to use the annotation @ViewAccessScoped provided by CODI.
Is CODI compatible with Weld? It's a really strange stack trace, because without CODI, everything works fine.
When I try to Deploy my project with JSF + CODI + Tomcat 7, it's expected that I will have some error, because CODI works over some CDI library (but my project works, without using CODI). Then, the main piece of the stacktrace reproduced is:
Mai 22, 2014 1:18:18 AM com.sun.faces.config.AnnotationScanner processClassList
SEVERE: Unable to load annotated class: org.apache.myfaces.extensions.cdi.jsf2.impl.scope.mapped.MappedJsf2ScopeExtension, reason: java.lang.NoClassDefFoundError: javax/enterprise/inject/spi/Extension
Mai 22, 2014 1:18:18 AM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: Factory'javax.faces.context.FacesContextFactory' was not configured properly.
The libraries that I'm using are listed bellow:
Weld: weld-servlet-2.2.1.Final.jar
CODI: myfaces-extcdi-bundle-jsf20-1.0.6.jar
JSF: javax.faces-2.2.6.jar
Tomcat: apache-tomcat-7.0.53
I tried using TomEE and the only library that I needed was myfaces-extcdi-bundle-jsf20-1.0.6.jar and after everything worked fine.
Otherwise I can't use JSF v2.2+. The currently configured JSF version with TomEE is 2.1. So, I don't want to migrate to TomEE, because the tag can be accessed only in the versions 2.2+.
I solved my problem changing MyFaces CODI to Apache DeltaSpike.
I don't know yet why I'm having problem using MyFaces CODI with Weld container, but it works fine using Apache DeltaSpike instead of MyFaces CODI.
As I'm using maven, here is my dependencies used in the pom.xml:
<properties>
<deltaspike.version>0.7</deltaspike.version>
<myfaces2.version>2.2.3</myfaces2.version>
<weld.version>2.2.1.Final</weld.version>
<jsf.version>2.2.6</jsf.version>
</properties>
<dependencies>
<!-- <dependency> -->
<!-- <groupId>javax.servlet</groupId> -->
<!-- <artifactId>jstl</artifactId> -->
<!-- <version>1.2</version> -->
<!-- </dependency> -->
<!-- Mojarra JSF 2.2.6 -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>${jsf.version}</version>
</dependency>
<!-- DeltaSpike modules -->
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-api</artifactId>
<version>${deltaspike.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-impl</artifactId>
<version>${deltaspike.version}</version>
<scope>compile</scope>
<!-- compile since we extends DefaultMessageResolver -->
</dependency>
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-jsf-module-api</artifactId>
<version>${deltaspike.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-jsf-module-impl</artifactId>
<version>${deltaspike.version}</version>
<scope>runtime</scope>
</dependency>
<!-- weld -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>${weld.version}</version>
</dependency>
</dependencies>
in WEB-INF I have the following:
----beans.xml (empty)
----faces-config.xml (I included the FacesMessage from deltaspike - not necessary)
----web.xml (Set servlet listener for listen to Weld Servlet Container - that has CDI)
beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
faces-config.xml:
<application>
<message-bundle>org.apache.deltaspike.example.message.FacesMessages</message-bundle>
</application>
web.xml:
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
Now, with this configuration, I can use the CDI extension @ViewAccessScoped that I wanted as other extensions.
If you deploy your JSF application using DeltaSpike CDI extension to Weld CDI on Apache Tomcat 7.0.53, everything will works fine.
Hope it helps everyone who wants to use CDI extension in JSF using tomcat 7.