Quintin,
Thanks for the response.
I'm using openejb-api-3.1.1.jar and openejb-client-3.1.1.jar. I am not using
Maven.
This is what I got after running
System.out.println(System.getProperty("java.class.path"));
/home/faizbash/NetBeansProjects/CASE_management_sys/CASE_management_sys-ejb/build/jar:
/home/faizbash/netbeans-6.7/java2/modules/ext/junit-3.8.2.jar:
/home/faizbash/netbeans-6.7/platform10/modules/ext/junit-4.5.jar:
/home/faizbash/lib/openejb-3.1.1/lib/openejb-api-3.1.1.jar:
/home/faizbash/lib/openejb-3.1.1/lib/openejb-client-3.1.1.jar
...
and lots more.
Sorry I forgot to include my code in the previous post:
@Before
public void bootContainer() throws Exception{
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
Context context = new InitialContext(props);
crudService = (CrudService) context.lookup("CrudServiceBean");
}
Quintin Beukes-2 wrote:
>
> Two questions:
>
> 1. Which jars are you including in your classpath. Can you do a
> System.out.println(System.getProperty("java.class.path"));
> 2. If you are using maven, can you please paste your <dependencies>
> element of the POM.
>
> Quintin Beukes
>
>
>
> On Sat, Oct 17, 2009 at 10:23 AM, faizbash <[email protected]> wrote:
>>
>> Hello,
>>
>> I ve been trying to launch OpenEJB as an embeddable container for JUnit
>> tests, but I keep getting the following error:
>>
>> Cannot instantiate class:
>> org.apache.openejb.client.LocalInitialContextFactory
>> javax.naming.NoInitialContextException
>> at
>> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
>> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
>> at javax.naming.InitialContext.init(InitialContext.java:223)
>> at javax.naming.InitialContext.<init>(InitialContext.java:197)
>> ...
>>
>>
>> I am using OpenEJB 3.1, and when I checked the library, the
>> "LocalInitialContextFactory" class
>> is missing but the "RemoteInitialContextFactory" is available and I could
>> run the tests remotely,
>> but not locally.
>>
>> I ve been searching forums but could find solution to this problem.
>> Can anyone please tell me what is the problem?
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/OpenEJB-3.1-as-embeddable-container-tp25936338p25936338.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/OpenEJB-3.1-as-embeddable-container-tp25936338p25938290.html
Sent from the OpenEJB User mailing list archive at Nabble.com.