Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2260

Mixed Servlet & SE CDIProvider

    Details

      Description

      I use Weld SE and Weld Servlet together. While upgrading, I see this error:

      Nov 26, 2016 8:52:50 AM org.jboss.weld.bootstrap.WeldStartup <clinit>
      INFO: WELD-000900: 2.4.1 (Final)
      Nov 26, 2016 8:52:50 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.
      Nov 26, 2016 8:52:51 AM org.apache.deltaspike.core.impl.config.EnvironmentPropertyConfigSourceProvider <init>
      INFO: Custom config found by DeltaSpike. Name: 'hammock.properties', URL: 'file:/Users/johnament/src/hammock/web-spi/target/classes/hammock.properties'
      Nov 26, 2016 8:52:51 AM org.apache.deltaspike.core.util.ProjectStageProducer initProjectStage
      INFO: Computed the following DeltaSpike ProjectStage: Production
      Nov 26, 2016 8:52:51 AM org.jboss.weld.environment.se.WeldContainer complete
      INFO: WELD-ENV-002003: Weld SE container 8df36750-78b6-45d8-bc2c-b549e8b525de initialized
      Nov 26, 2016 8:52:52 AM org.jboss.weld.environment.servlet.Listener contextInitialized
      INFO: WELD-ENV-001007: Initialize Weld using ServletContextListener
      Nov 26, 2016 8:52:52 AM org.jboss.weld.environment.undertow.UndertowContainer initialize
      INFO: WELD-ENV-001302: Undertow detected, CDI injection will be available in Servlets, Filters and Listeners.
      Nov 26, 2016 8:52:52 AM org.jboss.weld.environment.se.WeldContainer shutdown
      INFO: WELD-ENV-002001: Weld SE container 8df36750-78b6-45d8-bc2c-b549e8b525de shut down
       
      java.lang.RuntimeException: java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE => [8df36750-78b6-45d8-bc2c-b549e8b525de]
       
      	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
      	at ws.ament.hammock.web.undertow.UndertowWebServer.start(UndertowWebServer.java:112)
      	at ws.ament.hammock.web.undertow.UndertowWebServer$Proxy$_$$_WeldClientProxy.start(Unknown Source)
      	at ws.ament.hammock.web.undertow.UndertowBootTest.shouldBootWebServer(UndertowBootTest.java:48)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      Caused by: java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE => [8df36750-78b6-45d8-bc2c-b549e8b525de]
      	at org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider$RegistrySingleton.get(RegistrySingletonProvider.java:28)
      	at org.jboss.weld.Container.instance(Container.java:53)
      	at org.jboss.weld.SimpleCDI.<init>(SimpleCDI.java:76)
      	at org.jboss.weld.environment.WeldProvider$EnvironmentCDI.<init>(WeldProvider.java:45)
      	at org.jboss.weld.environment.WeldProvider.getCDI(WeldProvider.java:61)
      	at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
      	at org.jboss.weld.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:94)
      	at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
      	at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:122)
      	at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
      	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
      	at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
      	... 30 more
      
      

      To replicate, git clone git@github.com:hammock-project/hammock.git && cd hammock && ./mvnw clean install -Dweld.version=2.4.1.Final

      it seems like the container is shutting down before it tries starting the servlet.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  meetoblivion John Ament
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: