You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ivan Mikushin (JIRA)" <ji...@codehaus.org> on 2007/03/24 18:17:35 UTC

[jira] Created: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

build fails with ClassNotFoundException, BUT the class IS there!
----------------------------------------------------------------

                 Key: SUREFIRE-313
                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
             Project: Maven Surefire
          Issue Type: Bug
          Components: classloading
    Affects Versions: 2.3
         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
            Reporter: Ivan Mikushin
         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml

JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.

Also attached are the outputs from the command lines for JUnit4 and POJO test cases
{{mvn -X clean test > mvn.log}}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Ivan Mikushin (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98426 ] 

Ivan Mikushin commented on SUREFIRE-313:
----------------------------------------

Yeah, you are right.
Great thanks!
IMO, it's a bug anyway

> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106885 ] 

Anders Hammar commented on SUREFIRE-313:
----------------------------------------

My bad. When reading the documentation more carefully  I see that pre-1.4 JDKs should be supported. My fix above includes JDK 1.4+ stuff.

> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated SUREFIRE-313:
----------------------------------

    Fix Version/s: 2.4
      Component/s: Junit 4.x support

> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich closed SUREFIRE-313.
---------------------------------

    Resolution: Fixed

Fixed revision 597766

> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106885 ] 

Anders Hammar edited comment on SUREFIRE-313 at 9/9/07 2:44 PM:
----------------------------------------------------------------

My bad. When reading the documentation more carefully  I see that pre-1.4 JDKs should be supported. My fix above includes JDK 1.4+ stuff.

EDIT: Why do we need to be compatible with JDK 1.3? Maven 2 requires JDK 1.4 to execute, so I don't see the need for this plugin to support JDK 1.3. Or am I missing something?


 was:
My bad. When reading the documentation more carefully  I see that pre-1.4 JDKs should be supported. My fix above includes JDK 1.4+ stuff.

> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106860 ] 

Anders Hammar commented on SUREFIRE-313:
----------------------------------------

The problem is how the URLs for the class loader are being encoded. This is done in {{org.apache.maven.surefire.util.UrlUtils.getURL(File)}}.

If that method is changed into the one below it works for me (using a path for my maven project that includes non plain English chars):

{code:title=UrlUtils.java|borderStyle=solid}
    ...
    public static URL getURL( File file )
        throws MalformedURLException
    {
        // encode any characters that do not comply with RFC 2396
        // this is primarily to handle Windows where the user's home directory contains spaces,
    	// but also to handle non plain English characters
        URI uri = file.toURI();
        return uri.toURL();
    }
{code}

I'm not familiar with creating patch files. Anyone who can help me?
Also, a complete list of other plugins with the same problem would be great so that the same fix could be submitted for those.


> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-313) build fails with ClassNotFoundException, BUT the class IS there!

Posted by "Jose CHILLAN (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98414 ] 

Jose CHILLAN commented on SUREFIRE-313:
---------------------------------------

Hi, 

I had the same issue but I solve it easily : surefire simply doesn't work if the full path or the directory where your artifacts 
are contains non plain english chars. This is the case in your logs so just move your code in a simple path (no space, only
standard ASCII char) and it will work.
Some other plugins have the same problem, such as docbook, and so on...


> build fails with ClassNotFoundException, BUT the class IS there!
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-313
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-313
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, Junit 4.x support
>    Affects Versions: 2.3
>         Environment: Windows XP SP2, Java SE 6,  Maven 2.0.5
>            Reporter: Ivan Mikushin
>             Fix For: 2.4
>
>         Attachments: mvn-junit4.log, mvn-pojo-test.log, pom.xml
>
>
> JUnit 4 and POJO tests give ClassNotFoundException exceptions in *test* phase of the build (pom.xml is attached). 
> The console output gives a hint: JUnit 3.8.1 is appended to the surefire-booter forked JVM classpath instead of JUnit 4 (I tried it with junit-4.0, 4.1 and 4.2). When I try a POJO test case I get the same error.
> Also attached are the outputs from the command lines for JUnit4 and POJO test cases
> {{mvn -X clean test > mvn.log}}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira