Hi Guys,

Thanks for your replies. I've come to the conclusion that I am entering
the realm of integration testing and I have started deploying a test war
into the container. 

Thanks again for your suggestions.

Cheers,
Matt.

-----Original Message-----
From: Brice Lambi [mailto:[EMAIL PROTECTED] 
Sent: Friday, 1 February 2008 12:32 PM
To: Maven Users List
Subject: Re: FW: surefire and initial context

You can put a sleep statement in your test so that you can pause the
process
long enough to run ps and see the java command being executed.  That
output
will have the full classpath the jvm is getting.  You could then compare
the
output from eclipse and maven.  Or just use 'jar tvf' to find which jar
file
that class is in and make sure you find it in the corresponding artifact
in
your local repository.

Also make sure you don't have a scope on one of those dependencies that
would cause it to not show up in tests.  Eclipse and maven might handle
scopes differently.



On Jan 31, 2008 5:49 PM, Matthew Shaw <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
________________________________________________________________________
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to