Eclipse sometimes does "stuff" for users that makes things work when
they really "shouldn't". Can you try running from the command line
without using Maven by calling java directly or perhaps using Ant? I
believe it won't work either - you're probably doing something just
slightly wrong.
Also, open up those JAR files (I guess you installed them into your
local repo cache?) and make sure the class
weblogic/jndi/spi/EnvironmentManager exists in one of them.
Wayne
On 1/31/08, Matthew Shaw <Matthew.Shaw@citec.com.au> wrote:
> Thought I'd try again with this one. I am totally stuck. Any help would
> be greatly appreciated.
>
> -----Original Message-----
> From: Matthew Shaw [mailto:Matthew.Shaw@citec.com.au]
> Sent: Thursday, 31 January 2008 1:53 PM
> To: users@maven.apache.org
> Subject: surefire and initial context
>
> Hi there,
>
>
>
> I am running maven2 and surefire plugin 2.4 to execute junit4 style
> tests.
>
>
>
> I am using spring2.5 and creating a jndiTemplate bean with the following
> properties to talk to a weblogic 10 server message queue.
>
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>
> <property name="environment">
>
> <props>
>
> <prop key="java.naming.factory.initial">
>
> weblogic.jndi.WLInitialContextFactory
>
> </prop>
>
> <prop key="java.naming.provider.url">
>
> t3://localhost:7001
>
> </prop>
>
> </props>
>
> </property>
>
> </bean>
>
>
>
> When I run my test using eclipse it creates the bean no problem. If I
> try to run it using maven I get the following trace:
>
>
>
> Caused by: java.lang.NoClassDefFoundError:
> weblogic/jndi/spi/EnvironmentManager
>
> at weblogic.jndi.Environment.getContext(Environment.java:307)
>
> at weblogic.jndi.Environment.getContext(Environment.java:277)
>
> at
> weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContext
> Factory.java:117)
>
> at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>
> at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
>
> at javax.naming.InitialContext.init(InitialContext.java:223)
>
> at javax.naming.InitialContext.<init>(InitialContext.java:197)
>
> at
> org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.
> java:105)
>
> at
> org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:83)
>
> at
> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
>
> at
> org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
>
> at
> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.ja
> va:93)
>
> at
> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java
> :105)
>
> at
> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiOb
> jectFactoryBean.java:197)
>
> at
> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiOb
> jectFactoryBean.java:184)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
>
>
>
> I am including the following dependencies for weblogic:
>
> <dependency>
>
> <groupId>weblogic-server</groupId>
>
> <artifactId>api</artifactId>
>
> <version>10.0.0.0</version>
>
> </dependency>
>
> <dependency>
>
> <groupId>weblogic-server</groupId>
>
> <artifactId>wls-api</artifactId>
>
> <version>10.0.0.0</version>
>
> </dependency>
>
> <dependency>
>
> <groupId>weblogic-server</groupId>
>
> <artifactId>wlclient</artifactId>
>
> <version>10.0.0.0</version>
>
> </dependency>
>
> <dependency>
>
> <groupId>weblogic-server</groupId>
>
> <artifactId>wljmsclient</artifactId>
>
> <version>10.0.0.0</version>
>
> </dependency>
>
>
>
> Has anyone come across a similar issue? I can only assume it is a
> problem with the surefire plugin as it works fine in eclipse and the
> eclipse classpath is being built from my maven dependencies.
>
>
>
> I am stumped on this.
>
>
>
> Cheers,
>
> Matt.
>
> --------------------------------------------------------
>
> This email and associated attachments may contain confidential and
> privileged CITEC information that is provided solely for the use of the
> intended addressee. Views and opinions expressed in this email are those
> of the individual sender and are not necessarily the views and opinions
> of CITEC unless the sender expressly states that such views and opinions
> are those of CITEC. The privilege and confidentiality associated with
> this email and attachments will not be waived, lost or rescinded by
> reason of mistaken delivery. Should you receive this email by mistake,
> please notify the sender by return email then delete the email from your
> computer system. You must not use, copy, modify, print, or distribute
> the email or the information and attachments contained within same to
> any third party. CITEC does not accept any liability in respect of
> viruses or computer problems experienced by the recipient through access
> gained to this email and its attachments.
> --------------------------------------------------------
> ________________________________________________________________________
> This email has been scanned for viruses by the CITEC Email Anti-Virus
> service powered by IronPort(r)
>
> --------------------------------------------------------
>
> This email and associated attachments may contain confidential and privileged CITEC information
that is provided solely for the use of the intended addressee. Views and opinions expressed
in this email are those of the individual sender and are not necessarily the views and opinions
of CITEC unless the sender expressly states that such views and opinions are those of CITEC.
The privilege and confidentiality associated with this email and attachments will not be waived,
lost or rescinded by reason of mistaken delivery. Should you receive this email by mistake,
please notify the sender by return email then delete the email from your computer system.
You must not use, copy, modify, print, or distribute the email or the information and attachments
contained within same to any third party. CITEC does not accept any liability in respect of
viruses or computer problems experienced by the recipient through access gained to this email
and its attachments.
> --------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
|