Randall:
 
Surefire seems to have a number of issues because of it's dedicated Resource 
and Class loaders.
I believe the best practice here is to make an example project and submit a bug 
to codehaus.
I've had to do so.
 
http://jira.codehaus.org/browse/SUREFIRE-340
 
Barrett
 
::   
Barrett Nuzum
Consultant, Skill Development
Direct: 918.640.4414
Fax: 972.789.1340 

Valtech Technologies, Inc.
5080 Spectrum Drive
Suite 700 West
Addison, Texas 75001
www.valtech.com <http://www.valtech.com/>   
making IT business friendly


________________________________

From: Randall Fidler [mailto:[EMAIL PROTECTED]
Sent: Wed 6/20/2007 9:58 AM
To: users@maven.apache.org
Subject: Surefire classpath issues



Hello,



            Have an issue with trying to leverage Blowfish which ships
with Java 1.5 in relation to unit tests.  The test which I'm trying to
run is using JAXB and Blowfish impl which comes with Java 1.5, i.e.
what's in SunJCE.jar (jre/lib/ext).   



Before I was using a different impl of Blowfish, third party jar
(cryptix) and that was setup as a dependency in my pom so JAXB and the
blowfish impl were on the same "level" - no problems.  The fun begins
when I switch from the third party jar and try to use the java provided
impl.  Now, I can use JAXB and the Java impl together fine, say, when I
run the actual application which is being tested - problems only happen
when running the unit tests via Maven.



First problem:



java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

            Resolved this by enabling the childDelegation for the
surefire plugin.



                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-surefire-plugin</artifactId>

                <configuration>

                    <forkMode>always</forkMode>

                    <childDelegation>true</childDelegation>



Note - The surefire plugin describes the childDelegation option as:





When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when
forking (forkMode is not "none").



Setting it to false helps with some problems caused by conflicts between
xml parsers in the classpath and the Java 5 provider parser. Default
value is false.











Second problem:

           

            When I enable the childDelegation, the plugin then cannot
find the JAXB classes (setup as dependencies in the pom).  I've tried
test/compile scopes on the dependencies but to no avail.



Note: I tried the <useSystemClassLoader>true</useSystemClassLoader>
option, but that only seemed to make things worse.









Any help is greatly appreciated!



Regards,



Randall




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to