I think I have found the problem, if you add a test without anything on
classpath except the test, for example

@Test
public void testDb() {
    Properties p = new Properties();
    p.put("movieDatabase", "new://Resource?type=DataSource");
    p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
    p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

    Context context = EJBContainer.createEJBContainer(p).getContext();
}


Then it throws the exception. But if I run the same test adding for example
a @Stateless EJB in classpath, then everything works. So it seems that
there is a (bug)? in EJBContainer that in case don't find any class it
doesn't start and stop but throws an exception.



El dc., 27 maig 2015 a les 19:03, Alex Soto (<[email protected]>) va
escriure:

> No basically I copied the one in cipherdatabase test but for my algorithm
> El dc., 27 de maig, 2015 a les 16.53 Andy Gumbrecht <
> [email protected]> va escriure:
>
> Do you have a?:
>>
>> @Module
>> @Classes(value = { My.class }, cdi = true)
>> public EjbJar app() {
>> return new EjbJar();
>> }
>>
>> On 27 May 2015 at 16:41, Alex Soto <[email protected]> wrote:
>>
>> > Hi I am writing a very simple test using EJBContainer. Code is:
>> >
>> > EJBContainer container = EJBContainer.createEJBContainer(properties);
>> >
>> > Context context = container.getContext();
>> >
>> > context.bind("inject", this);
>> >
>> >
>> > And the dependency:
>> >
>> > <dependency>
>> >
>> >   <groupId>org.apache.openejb</groupId>
>> >
>> >   <artifactId>openejb-core</artifactId>
>> >
>> >   <version>4.7.1</version>
>> >
>> >   <scope>test</scope>
>> >
>> > </dependency>
>> >
>> >
>> > But when I run this simple test I get a
>> >
>> >
>> > org.apache.openejb.OpenEjbContainer$NoModulesFoundException: No modules
>> > found to deploy.
>> >
>> > 1)Maybe descriptors are placed in incorrect location.
>> >
>> > Descriptors could go under:
>> >
>> > <base-dir>/META-INF or <base-dir>/WEB-INF
>> >
>> > but not directly under <base-dir>
>> >
>> > Check 'Application Discovery via the Classpath' docs page for more info
>> >
>> > 2)Maybe no modules are present in the classpath.
>> >
>> > Is 'openejb.base' system property pointing to the intended location?
>> >
>> >   at
>> >
>> >
>> org.apache.openejb.util.Exceptions.newNoModulesFoundException(Exceptions.java:99)
>> >
>> >   at
>> >
>> >
>> org.apache.openejb.OpenEjbContainer$Provider.load(OpenEjbContainer.java:483)
>> >
>> >   at
>> >
>> >
>> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:272)
>> >
>> >   at
>> >
>> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
>> >
>> >   at
>> >
>> >
>> com.scytl.multitenant.CipherTest.shouldGetProtectedDataSource(CipherTest.java:54)
>> >
>> >   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:483)
>> >
>> >
>> > Any idea of what dependency am I missing? It seems like there is a
>> missing
>> > dependency.
>> >
>> >
>> > Thank you so much.
>> >
>>
>>
>>
>> --
>>   Andy Gumbrecht
>>   https://twitter.com/AndyGeeDe
>>   http://www.tomitribe.com
>>
>

Reply via email to