tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Davidson" <stephen.david...@etcc.com>
Subject RE: ClassNotFoundException LocalInitialContextFactory
Date Fri, 15 Jan 2010 21:28:12 GMT
Repost from thread: "Maven + Jetty:  Unknown JNDI name prefix" as this
was causing that problem as well.

Greetings.

Found out what was causing this, a conflict with Struts (v1.2.8 in this
case).  Specifically, this dependency;
 
        <dependency>
            <groupId>struts</groupId>
            <artifactId>struts</artifactId>
            <version>1.2.8</version>
        </dependency>

This was imported from a parent pom for this module, and (fortunately!)
can be readily refactored, so this is not a blocker.

Regards,
Steve

-----Original Message-----
From: Stephen Davidson [mailto:stephen.davidson@etcc.com] 
Sent: Friday, January 15, 2010 1:12 PM
To: users@openejb.apache.org
Subject: RE: ClassNotFoundException LocalInitialContextFactory

Hi Jonathan.

I am actually trying to run this from inside an embedded Jetty instance
in Maven (something that is not currently documented on your website,
Jetty yes, Jetty + Maven, no)

I had found the following link;
http://stackoverflow.com/questions/1186348/maven-ear-module-and-ejb-depe
ndencies-tests
and was also referred to this link;
http://old.nabble.com/Re%3A-Tomcat---Injection%3A-No-such-property-p1642
1933.html

Also, I am running mvn:jetty-runexploded.

Regards,
Steve

-----Original Message-----
From: Jonathan Gallimore [mailto:jonathan.gallimore@gmail.com] 
Sent: Friday, January 15, 2010 12:56 PM
To: users@openejb.apache.org
Subject: Re: ClassNotFoundException LocalInitialContextFactory

Hi Stephen

I'll dig around and see if I can help with this over the weekend. I  
don't know if you have already seen this, but I knocked up a sample  
app to do something similar a while back -
http://openejb.apache.org/functional-testing-with-openejb-jetty-and-sele
nium.html

If you haven't already seen it, the sample code might help your problem.

Jon

On 15 Jan 2010, at 17:55, "Stephen Davidson"  
<stephen.davidson@etcc.com> wrote:

> Greetings.
>
>
>
> I am attempting to get OpenEJB setup (with Jetty under Maven) for
> integration tests.  Unfortunately, I am getting a  
> ClassNotFoundException
> on the OpenEJB's LocalInitialContextFactory.  Any ideas?
>
>
>
> mvn -version
>
> Maven version: 2.0.10
>
> Java version: 1.5.0_22
>
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
>
>
>
> Pom excerpts:
>
> From the dependencies;
>        <dependency>
>            <groupId>org.apache.openejb</groupId>
>            <artifactId>openejb-core</artifactId>
>            <version>3.1.2</version>
>        </dependency>
>
> From the build plugins
>            <plugin>
>                <groupId>org.mortbay.jetty</groupId>
>                <artifactId>maven-jetty-plugin</artifactId>
>                <configuration>
>                    <scanIntervalSeconds>10</scanIntervalSeconds>
>                    <stopKey>foo</stopKey>
>                    <stopPort>9999</stopPort>
>                    <useTestClasspath>true</useTestClasspath>
>                    <contextPath>/ejb-test</contextPath>
>                    <systemProperties>
>                        <systemProperty>
>                            <name>java.naming.factory.initial</name>
> <value>org.apache.openejb.client.LocalInitialContextFactory</value>
>                        </systemProperty>
>                        <systemProperty>
>                            <name>java.naming.factory.url.pkgs</name>
>                            <value>org.mortbay.naming</value>
>                        </systemProperty>
>                    </systemProperties>
>                </configuration>
>            </plugin>
>
>
> Exception is;
> 2010-01-15 11:47:00.496:INFO::jetty-6.1.22
> 2010-01-15 11:47:00.574:WARN::Failed startup of context
> org.mortbay.jetty.plugin
>
> .Jetty6PluginWebAppContext@6aa95b{/ejb-test,C:\projects\UI_HCTRA 
> \OLCSCWe
> b\target
>
> \web-2.1-488-SNAPSHOT}
>
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.apache.openejb.client.LocalInitialContextFactory [Root exception  
> is
> java.lang.ClassNotFoundException:
> org.apache.openejb.client.LocalInitialContextFactory]
>        at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java: 
> 657)
>        at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>        at javax.naming.InitialContext.init(InitialContext.java:223)
>        at javax.naming.InitialContext.<init>(InitialContext.java:175)
>        at
> org.mortbay.jetty.plus.webapp.EnvConfiguration.createEnvContext 
> (EnvConfiguration.java:56)
>
>        at
> org.mortbay.jetty.plus.webapp.EnvConfiguration.configureDefaults 
> (EnvConfiguration.java:101)
>        at
> org.mortbay.jetty.webapp.WebAppContext.startContext 
> (WebAppContext.java:1
> 230)
>
>        at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java: 
> 517)
>
>        at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
>
>        at
> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart 
> (Jetty6PluginW
> ebAppContext.java:115)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerCollection.doStart 
> (HandlerCollection.ja
> va:152)
>
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.doStart 
> (ContextHandle
> rCollection.java:156)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerCollection.doStart 
> (HandlerCollection.ja
> va:152)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
> 130
> )
>
>        at org.mortbay.jetty.Server.doStart(Server.java:224)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.plugin.Jetty6PluginServer.start 
> (Jetty6PluginServer.jav
> a:132)
>
>        at
> org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo 
> \jo
> .java:441)
>
>        at
> org.mortbay.jetty.plugin.AbstractJettyMojo.execute 
> (AbstractJettyMojo.jav
> a:383)
>
>        at
> org.mortbay.jetty.plugin.Jetty6RunWarExploded.execute 
> (Jetty6RunWarExplod
> ed.java:170)
>
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo 
> (DefaultPluginMa
> nager.java:453)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals 
> (Default
> LifecycleExecutor.java:559)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
 

> l(DefaultLifecycleExecutor.java:513)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal 
> (DefaultL
> ifecycleExecutor.java:483)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
 

> Failures(DefaultLifecycleExecutor.java:331)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:292)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute 
> (DefaultLifec
> ycleExecutor.java:142)
>
>        at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
>
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.jav
> a:39)
>
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessor
> Impl.java:25)
>
>        at java.lang.reflect.Method.invoke(Method.java:592)
>
>        at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>
>        at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
>
>
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
> 2010-01-15 11:47:00.605:WARN::Nested in
> javax.naming.NoInitialContextException:
>
> Cannot instantiate class:
> org.apache.openejb.client.LocalInitialContextFactory [
>
> Root exception is java.lang.ClassNotFoundException:
> org.apache.openejb.client.Lo
>
> calInitialContextFactory]:
>
> java.lang.ClassNotFoundException:
> org.apache.openejb.client.LocalInitialContextFactory
>
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>
>        at java.security.AccessController.doPrivileged(Native Method)
>
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>
>        at
> org.codehaus.classworlds.RealmClassLoader.loadClassDirect 
> (RealmClassLoad
> er.java:195)
>
>        at
> org.codehaus.classworlds.DefaultClassRealm.loadClass 
> (DefaultClassRealm.j
> ava:255)
>
>        at
> org.codehaus.classworlds.DefaultClassRealm.loadClass 
> (DefaultClassRealm.j
> ava:274)
>
>        at
> org.codehaus.classworlds.RealmClassLoader.loadClass 
> (RealmClassLoader.jav
> a:214)
>
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>
>        at
> org.mortbay.jetty.webapp.WebAppClassLoader.loadClass 
> (WebAppClassLoader.j
> ava:401)
>
>        at
> org.mortbay.jetty.webapp.WebAppClassLoader.loadClass 
> (WebAppClassLoader.j
> ava:363)
>
>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 
> 320)
>
>        at java.lang.Class.forName0(Native Method)
>
>        at java.lang.Class.forName(Class.java:242)
>
>        at
> com.sun.naming.internal.VersionHelper12.loadClass 
> (VersionHelper12.java:4
> 2)
>
>        at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java: 
> 654)
>
>        at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>
>        at javax.naming.InitialContext.init(InitialContext.java:223)
>
>        at javax.naming.InitialContext.<init>(InitialContext.java:175)
>
>        at
> org.mortbay.jetty.plus.webapp.EnvConfiguration.createEnvContext 
> (EnvConfi
> guration.java:56)
>
>        at
> org.mortbay.jetty.plus.webapp.EnvConfiguration.configureDefaults 
> (EnvConf
> iguration.java:101)
>
>        at
> org.mortbay.jetty.webapp.WebAppContext.startContext 
> (WebAppContext.java:1
> 230)
>
>        at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java: 
> 517
> )
>
>        at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
>
>        at
> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart 
> (Jetty6PluginW
> ebAppContext.java:115)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerCollection.doStart 
> (HandlerCollection.ja
> va:152)
>
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.doStart 
> (ContextHandle
> rCollection.java:156)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerCollection.doStart 
> (HandlerCollection.ja
> va:152)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
> 130
> )
>
>        at org.mortbay.jetty.Server.doStart(Server.java:224)
>
>        at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
> 50)
>
>        at
> org.mortbay.jetty.plugin.Jetty6PluginServer.start 
> (Jetty6PluginServer.jav
> a:132)
>
>        at
> org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty 
> (AbstractJettyMojo.
> java:441)
>
>        at
> org.mortbay.jetty.plugin.AbstractJettyMojo.execute 
> (AbstractJettyMojo.jav
> a:383)
>
>        at
> org.mortbay.jetty.plugin.Jetty6RunWarExploded.execute 
> (Jetty6RunWarExplod
> ed.java:170)
>
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo 
> (DefaultPluginMa
> nager.java:453)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals 
> (Default
> LifecycleExecutor.java:559)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
 

> l(DefaultLifecycleExecutor.java:513)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal 
> (DefaultL
> ifecycleExecutor.java:483)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
 

> Failures(DefaultLifecycleExecutor.java:331)
>
>        at
>
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:292)
>
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute 
> (DefaultLifec
> ycleExecutor.java:142)
>
>        at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
>
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.jav
> a:39)
>
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessor
> Impl.java:25)
>
>        at java.lang.reflect.Method.invoke(Method.java:592)
>
>        at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>
>        at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
> 2010-01-15 11:47:00.715:INFO::Started
> SelectChannelConnector@0.0.0.0:8080
>
> [INFO] Started Jetty Server
>

Mime
View raw message