FYI: https://issues.apache.org/jira/browse/TOMEE-788

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/3/11 Romain Manni-Bucau <[email protected]>

> with tomee embedded you have to specify EJBContainer.MODULES. Accepted
> type are String, String[], File, File[]. Each value is a path to an
> application (war, jar,...)
>
> Note: you can simply the provider properties this way:
> p.put(EJBContainer.PROVIDER,
>       "tomee-embedded");
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/3/11 Antonio <[email protected]>
>
>> Map<String,Object> properties = new HashMap<String,Object>();
>> properties.put(EJBContainer.PROVIDER,
>>       "org.apache.tomee.embedded.EmbeddedTomEEContainer");
>> Properties p = new Properties();
>> p.put(EJBContainer.PROVIDER,
>>       "org.apache.tomee.embedded.EmbeddedTomEEContainer");
>> // -1 Means will start in  a random port
>> p.put("tomee.ejbcontainer.http.port", -1);
>> EJBContainer ec = EJBContainer.createEJBContainer(p);
>> userDao = (UserProfileDaoLocal) ec.getContext().lookup(
>>
>>
>> "java:global/omc-aomdb-model-ejb/UserProfileDaoLocal!com.altobridge.omc.orm.dao.UserProfileDaoLocal");
>>
>> But now the module is not found
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running com.altobridge.omc.orm.dao.UserDaoLocalTest
>> Starting TomEE from: /tmp/apache-tomee3506688560583661701-home
>> INFO - Initializing ProtocolHandler ["http-bio-51082"]
>> INFO - Starting service Tomcat
>> INFO - Starting Servlet Engine: Apache Tomcat/7.0.34
>> INFO - Starting ProtocolHandler ["http-bio-51082"]
>> INFO - Using
>>
>> 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxRsService
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxWsService
>> INFO -
>>
>> ********************************************************************************
>> INFO - OpenEJB http://openejb.apache.org/
>> INFO - Startup: Mon Mar 11 15:02:34 GMT 2013
>> INFO - Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights
>> Reserved.
>> INFO - Version: 4.5.1
>> INFO - Build date: 20121209
>> INFO - Build time: 08:47
>> INFO -
>>
>> ********************************************************************************
>> INFO - openejb.home = /tmp/apache-tomee3506688560583661701-home
>> INFO - openejb.base = /tmp/apache-tomee3506688560583661701-home
>> INFO - Created new singletonService
>> org.apache.openejb.cdi.ThreadSingletonServiceImpl@5cd989b2
>> INFO - Succeeded in installing singleton service
>> INFO - openejb configuration file is
>> '/tmp/apache-tomee3506688560583661701-home/conf/openejb.xml'
>> INFO - Configuring Service(id=Default Security Service,
>> type=SecurityService, provider-id=Default Security Service)
>> INFO - Configuring Service(id=Default Transaction Manager,
>> type=TransactionManager, provider-id=Default Transaction Manager)
>> INFO - Using 'openejb.deployments.classpath=false'
>> INFO - Creating TransactionManager(id=Default Transaction Manager)
>> INFO - Creating SecurityService(id=Default Security Service)
>> INFO - Using 'openejb.servicemanager.enabled=false'
>> INFO - Pausing ProtocolHandler ["http-bio-51082"]
>> INFO - Stopping service Tomcat
>> INFO - Stopping ProtocolHandler ["http-bio-51082"]
>> Starting TomEE from: /tmp/apache-tomee7807923851527497738-home
>> INFO - Initializing ProtocolHandler ["http-bio-43168"]
>> INFO - Starting service Tomcat
>> INFO - Starting Servlet Engine: Apache Tomcat/7.0.34
>> INFO - Starting ProtocolHandler ["http-bio-43168"]
>> INFO - Using
>>
>> 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxRsService
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxWsService
>> INFO -
>>
>> ********************************************************************************
>> INFO - OpenEJB http://openejb.apache.org/
>> INFO - Startup: Mon Mar 11 15:02:35 GMT 2013
>> INFO - Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights
>> Reserved.
>> INFO - Version: 4.5.1
>> INFO - Build date: 20121209
>> INFO - Build time: 08:47
>> INFO -
>>
>> ********************************************************************************
>> INFO - openejb.home = /tmp/apache-tomee7807923851527497738-home
>> INFO - openejb.base = /tmp/apache-tomee7807923851527497738-home
>> INFO - Created new singletonService
>> org.apache.openejb.cdi.ThreadSingletonServiceImpl@5cd989b2
>> INFO - Succeeded in installing singleton service
>> INFO - openejb configuration file is
>> '/tmp/apache-tomee7807923851527497738-home/conf/openejb.xml'
>> INFO - Configuring Service(id=Default Security Service,
>> type=SecurityService, provider-id=Default Security Service)
>> INFO - Configuring Service(id=Default Transaction Manager,
>> type=TransactionManager, provider-id=Default Transaction Manager)
>> INFO - Using 'openejb.deployments.classpath=false'
>> INFO - Creating TransactionManager(id=Default Transaction Manager)
>> INFO - Creating SecurityService(id=Default Security Service)
>> INFO - Using
>>
>> 'java.security.auth.login.config=file:/tmp/apache-tomee3506688560583661701-home/conf/login.config'
>> INFO - Using 'openejb.servicemanager.enabled=false'
>> INFO - Pausing ProtocolHandler ["http-bio-43168"]
>> INFO - Stopping service Tomcat
>> INFO - Stopping ProtocolHandler ["http-bio-43168"]
>> Starting TomEE from: /tmp/apache-tomee8508512223308274230-home
>> INFO - Initializing ProtocolHandler ["http-bio-40412"]
>> INFO - Starting service Tomcat
>> INFO - Starting Servlet Engine: Apache Tomcat/7.0.34
>> INFO - Starting ProtocolHandler ["http-bio-40412"]
>> INFO - Using
>>
>> 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxRsService
>> INFO - Optional service not installed:
>> org.apache.tomee.webservices.TomeeJaxWsService
>> INFO -
>>
>> ********************************************************************************
>> INFO - OpenEJB http://openejb.apache.org/
>> INFO - Startup: Mon Mar 11 15:02:35 GMT 2013
>> INFO - Copyright 1999-2012 (C) Apache OpenEJB Project, All Rights
>> Reserved.
>> INFO - Version: 4.5.1
>> INFO - Build date: 20121209
>> INFO - Build time: 08:47
>> INFO -
>>
>> ********************************************************************************
>> INFO - openejb.home = /tmp/apache-tomee8508512223308274230-home
>> INFO - openejb.base = /tmp/apache-tomee8508512223308274230-home
>> INFO - Created new singletonService
>> org.apache.openejb.cdi.ThreadSingletonServiceImpl@5cd989b2
>> INFO - Succeeded in installing singleton service
>> INFO - openejb configuration file is
>> '/tmp/apache-tomee8508512223308274230-home/conf/openejb.xml'
>> INFO - Configuring Service(id=Default Security Service,
>> type=SecurityService, provider-id=Default Security Service)
>> INFO - Configuring Service(id=Default Transaction Manager,
>> type=TransactionManager, provider-id=Default Transaction Manager)
>> INFO - Using 'openejb.deployments.classpath=false'
>> INFO - Creating TransactionManager(id=Default Transaction Manager)
>> INFO - Creating SecurityService(id=Default Security Service)
>> INFO - Using
>>
>> 'java.security.auth.login.config=file:/tmp/apache-tomee3506688560583661701-home/conf/login.config'
>> INFO - Using 'openejb.servicemanager.enabled=false'
>> INFO - Pausing ProtocolHandler ["http-bio-40412"]
>> INFO - Stopping service Tomcat
>> INFO - Stopping ProtocolHandler ["http-bio-40412"]
>> Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 2.95 sec
>> <<<
>> FAILURE!
>>
>> Results :
>>
>> Tests in error:
>>   testCreateUser(com.altobridge.omc.orm.dao.UserDaoLocalTest): No modules
>> found to deploy.
>>   testFindById(com.altobridge.omc.orm.dao.UserDaoLocalTest): No modules
>> found to deploy.
>>   testDeleteUser(com.altobridge.omc.orm.dao.UserDaoLocalTest): No modules
>> found to deploy.
>>
>> Tests run: 3, Failures: 0, Errors: 3, Skipped: 0
>>
>> Here is the specification of the module:
>>
>> <groupId>com.altobridge</groupId>
>> <artifactId>omc-aomdb-model-ejb</artifactId>
>> <version>1.0-snapshot</version>
>> <packaging>ejb</packaging>
>> <name>omc-aomdb-model-ejb</name>
>>
>> Should I specify the jar file? Or can it be taken straight away from the
>> project?
>>
>> Regards,
>> Antonio
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Impossible-to-instantiate-a-container-tp4660887p4661393.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Reply via email to