deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rudy De Busscher <rdebussc...@gmail.com>
Subject Issues with arquillian archives on WebLogic 12c -> wrong beans.xml file location
Date Mon, 20 Feb 2012 09:03:43 GMT
Hi all,

I'm trying to run the DeltaSpike integration tests on the Oracle WebLogic
12C server.

And i'm getting the following exceptions (related
to ExcludeIntegrationTest, the first test)

*Weblogic console*

*org.jboss.arquillian.testenricher.cdi.container.BeanManagerProducer lookup*
*INFO: BeanManager not found*

*test log file*

*simpleCheckOfBeansInPackage(org.apache.deltaspike.integration.core.api.exclude.ExcludeIntegrationTest)
 Time elapsed: 0.003 sec  <<< ERROR!*
*java.lang.IllegalStateException: No
org.apache.deltaspike.core.api.provider.BeanManagerProvider in place!
Please ensure that you configured the CDI implementation of your choice
properly. If your setup is correct, please clear all caches and compiled
artifacts.*
* at
org.apache.deltaspike.core.api.provider.BeanManagerProvider.getInstance(BeanManagerProvider.java:88)
*
* at
org.apache.deltaspike.core.api.provider.BeanProvider.getBeanManager(BeanProvider.java:258)
*
* at
org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:78)
*
* at
org.apache.deltaspike.integration.core.api.exclude.ExcludeIntegrationTest.simpleCheckOfBeansInPackage(ExcludeIntegrationTest.java:94)
*


However, a test application that uses the following code in a get method of
a property

*        AlwaysActiveBean testBean =
BeanProvider.getContextualReference(AlwaysActiveBean.class, true);*
*        BeanManager manager;*
*        try {*
*            InitialContext ic = new InitialContext();*
*            manager = (BeanManager) ic.lookup("java:comp/BeanManager");*
*        } catch (Exception e) {*
*            throw new RuntimeException(e);*
*        }*

succeed and I have a value for testBean and manager.

So there is nothing wrong with CDI (and deltaspike) on WLS.

By uncommenting the following in arquillian.xml
*    <engine>*
*        <property name="deploymentExportPath">target/</property>*
*    </engine>*

I see that the beans.xml file is located in a top-level META-INF directory
and not in WEB-INF or WEB-INF\classes\META-INF.

So probably WLS decides that the WAR has nothing to do with CDI and thus is
not available.

Replacing
*.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");*
by
*.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");*

the test works on WLS  (well I have other issues but CDI and deltaSpike is
correctly loaded) and JBoss/GlassFish

I'll create a *JIRA ticket *to change the deployment methods of the current
integration tests

Sorry for this long post, but it is important for the compatibility of
future integration tests .

Regards
Rudy


-- 
Rudy De Busscher
http://www.c4j.be

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message