Error while deploying on glassfish server

2

Project failed on server after deploy. glassfish 4.1

Project cdi, jsf, primefaces, jpa

  WELD-000335: Context is already active at org.jboss.weld.context.AbstractConversationContext.activate (AbstractConversationContext.java:233) at org .jboss.weld.jsf.WeldPhaseListener.activateConversations (WeldPhaseListener.java:108) at org.jboss.weld.jsf.WeldPhaseListener.beforePhase (WeldPhaseListener.java:85) at com.sun.faces.lifecycle.Phase.handleBeforePhase (Phase .java: 228) at com.sun.faces.lifecycle.Phase.doPhase (Phase.java:99) at com.sun.faces.lifecycle.RestoreViewPhase.doPhase (RestoreViewPhase.java:121) at com.sun.faces. lifecycle.LifecycleImpl.execute (LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service (FacesServlet.java:646) at org.apache.catalina.core.StandardWrapper.service (StandardWrapper.java:1682) at org .apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:344) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterC hain.java:214) at org.springframework.security.web.FilterChainProxy.doFilterInternal (FilterChainProxy.java:186) at org.springframework.security.web.FilterChainProxy.doFilter (FilterChainProxy.java:160) at org.springframework.web .filter.DelegatingFilterProxy.invokeDelegate (DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter (DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:256 ) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:316) at org.apache.catalina.core.StandardContextValve. invoke (StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:673) at com.sun .enterprise.web.WebPipeline.invoke (WebPipeline.java:99) at or g.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService (CoyoteAdapter.java:415) at org.apache.catalina.connector.CoyoteAdapter.service ( CoyoteAdapter.java:282) at com.sun.enterprise.v3.services.impl.ContainerMapper $ HttpHandlerCallable.call (ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service (ContainerMapper. java: 167) at org.glassfish.grizzly.http.server.HttpHandler.runService (HttpHandler.java:201) at org.glassfish.grizzly.http.server.HttpHandler.doHandle (HttpHandler.java:175) at org.glassfish .grizzly.http.server.HttpServerFilter.handleRead (HttpServerFilter.java:235) at org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute (ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter ( DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart (DefaultFilterChain.java:201) at org.glassfish.grizzl y.filterchain.DefaultFilterChain.execute (DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process (DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute (ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent (TCPNIOTransport.java:561) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent (AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy .run0 (WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100 (WorkerThreadIOStrategy.java:56) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run (WorkerThreadIOStrategy.java:137) at org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork (AbstractThreadPool.java:565) at org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run (AbstractThreadPool.java:545) at java.lang.Thread.run (Thread.java:745)

<dependency>
    <groupId>org.jboss.weld.servlet</groupId>
    <artifactId>weld-servlet</artifactId>
    <version>1.1.10.Final</version>
    <scope>compile</scope>
</dependency>
    
asked by anonymous 04.09.2016 / 16:38

1 answer

4

When we use full javaEE servers we do not need to explicitly declare the weld (compile) lib, because the server already implements one of the JavaEE versions, these servers are different from the container servlets, they already have the native CDI, solution is:

Remove this dependency:

<dependency> 
    <groupId>org.jboss.weld.servlet</groupId> 
    <artifactId>weld-servlet</artifactId> 
    <version>1.1.10.Final</version> 
    <scope>compile</scope> 
</dependency>

and add the CDI API as provided, eg:

<dependency> 
    <groupId>javax.enterprise</groupId> 
    <artifactId>cdi-api</artifactId> 
    <scope>provided</scope> 
</dependency>
    
04.09.2016 / 19:31