createEJBContainer throws java.lang.IllegalStateException

88 Views Asked by At

on a Linux machine the container runs inside an exception which I don't understand.

With ejbContainer = EJBContainer.createEJBContainer(); the embaddable container will be started.

In the log file I see an exception:

Caused by: org.apache.webbeans.exception.WebBeansException: java.lang.IllegalStateException: Could not find beans for Type=class org.apache.deltaspike.core.impl.scope.window.WindowBeanHolder and qualifiers:[]
    at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:377)
    at org.apache.webbeans.event.NotificationManager.invokeObserverMethod(NotificationManager.java:1146)
    at org.apache.webbeans.event.NotificationManager.doFireSync(NotificationManager.java:1009)
    ... 84 common frames omitted
Caused by: java.lang.IllegalStateException: Could not find beans for Type=class org.apache.deltaspike.core.impl.scope.window.WindowBeanHolder and qualifiers:[]
    at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:154)
    at org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension.initializeDeltaSpikeContexts(DeltaSpikeContextExtension.java:86)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.apache.webbeans.event.ObserverMethodImpl.invoke(ObserverMethodImpl.java:410)
    at org.apache.webbeans.event.ContainerEventObserverMethodImpl.invoke(ContainerEventObserverMethodImpl.java:86)
    at org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:371)
    ... 86 common frames omitted
ERROR javax.enterprise.inject.spi.DeploymentException: couldn't start owb context

Honestly I have no idea what's going on.

Before I found this line:

System.setProperty("openejb.deployments.classpath.include",
            ".*deltaspike-cdictrl-owb-.*.jar|.*deltaspike-servlet-module-impl-.*.jar|.*deltaspike-servlet-module-api-.*.jar|.*deltaspike-core-api-.*.jar|.*deltaspike-core-impl-.*.jar");

Does anybody have an idea how I can fix this issue?

Thanks, Markus

1

There are 1 best solutions below

0
On

One of my colleagues was able to find out the reason.

The regex expression seems to be different between Tomee 7.1.4 and Tomee 8.0.13.

This regex find the libs and solves the probelem.

    System.setProperty("openejb.deployments.classpath.include",".*deltaspike.*");