Error deploying to glassfish server

Asked

Viewed 188 times

2

Project not Rada on server after deploy. glassfish 4.1

Project cdi, jsf, primefaces, jpa

System error: WELD-000335: Context is already active java.lang.Illegalstateexception: 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(ApplicationFilterChain.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 org.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.grizzly.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>
  • The Weld you use is glassfish right? provided? has some Phaselistener in the application running some procedure at startup?

  • Dilnei, I can’t say. I didn’t know there was a version for glassfish. I am using this dependency: ' <dependency> <groupid>org.jboss.Weld.Servlet</groupid> <artifactId>Weld-Servlet</artifactId> <version>1.1.10.Final</version> <Scope>Compile</Scope> </dependency>''

  • It’s like brother, the server is full javaEE so it implements a version of Javaee spec which is Javaee 7, these servers are different from container Servlets, they already have the native CDI, so remove this dependency and declare the CDI API, like this: <dependency>&#xA; <groupId>javax.enterprise</groupId>&#xA; <artifactId>cdi-api</artifactId>&#xA; <scope>provided</scope>&#xA;</dependency>

  • Thanks Dilnei! I’ll do it. Put the result

  • Dilnei, it worked. Thanks again!!

  • You’re welcome Sidnei, congratulations on making it, hugging.

  • @Dilneicunha is cool to include an answer to the question, the OP can accept it, helping others who may have the same problem :)

  • Ok @Bruno César, added as response, when there is no reply the post would be deleted? Have any doc on the use of markdown here in the comments? because many commands do not work, the other day also tried a post issue 5 min. and was not possible, I found bad this part, overall I really liked this forum, I come there from the GUJ, but I confess that you are light years ahead of them, I like the seriousness of the stack, of the answers that many veses are very scientific and without that lot of useless discussion that has no technical basis at all, anyway, Congratulations to all.

Show 3 more comments

1 answer

4


When we use full javaEE servers we don’t need to explicitly declare the Weld lib (Compile), because the server already implements one of the versions of Javaee, these servers are different from container Servlets, they already have the native CDI, so the 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, ex:

<dependency> 
    <groupId>javax.enterprise</groupId> 
    <artifactId>cdi-api</artifactId> 
    <scope>provided</scope> 
</dependency>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.