You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matthew Wheaton (JIRA)" <ji...@codehaus.org> on 2006/04/14 00:11:49 UTC

[jira] Created: (MSUREFIRE-91) maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider

maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider
------------------------------------------------------------------------------------------------------------------------------

         Key: MSUREFIRE-91
         URL: http://jira.codehaus.org/browse/MSUREFIRE-91
     Project: Maven 2.x Surefire Plugin
        Type: Bug

 Environment: All
    Reporter: Matthew Wheaton
 Assigned to: Brett Porter 
    Priority: Blocker


maven-surefire-plugin cannot run a jUnit test for a custom charset provider specified in the jar file's META-INF/services/java.nio.charset.spi.CharsetProvider file. Class java.nio.charset.Charset performs a lookup using ClassLoader.getSystemClassLoader(); which does not have the jar file in its classpath and thus fails with e.g. junit.framework.AssertionFailedError: java.io.UnsupportedEncodingException: DIN_66003 although the jar file itself is correct. I think this is due to the plugin using its own classloader and the JDK using the system classloader but I may be totally wrong and everything is fine with the plugin.

The method from java.nio.charset.Charset performing the lookup beings with

private static Iterator providers() {
	return new Iterator() {

		Class c = java.nio.charset.spi.CharsetProvider.class;
		ClassLoader cl = ClassLoader.getSystemClassLoader();
		Iterator i = Service.providers(c, cl);
		Object next = null;

As it seems org.codehaus.surefire.SurefireBooter does not promote the jar files to the classpath of the system classloader.


-- 
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] Moved: (SUREFIRE-225) maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider

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

Brett Porter moved MSUREFIRE-91 to SUREFIRE-225:
------------------------------------------------

        Key: SUREFIRE-225  (was: MSUREFIRE-91)
    Project: Maven Surefire  (was: Maven 2.x Surefire Plugin)

> maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-225
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-225
>             Project: Maven Surefire
>          Issue Type: Bug
>         Environment: All
>            Reporter: Matthew Wheaton
>         Assigned To: Brett Porter
>            Priority: Blocker
>
> maven-surefire-plugin cannot run a jUnit test for a custom charset provider specified in the jar file's META-INF/services/java.nio.charset.spi.CharsetProvider file. Class java.nio.charset.Charset performs a lookup using ClassLoader.getSystemClassLoader(); which does not have the jar file in its classpath and thus fails with e.g. junit.framework.AssertionFailedError: java.io.UnsupportedEncodingException: DIN_66003 although the jar file itself is correct. I think this is due to the plugin using its own classloader and the JDK using the system classloader but I may be totally wrong and everything is fine with the plugin.
> The method from java.nio.charset.Charset performing the lookup beings with
> private static Iterator providers() {
> 	return new Iterator() {
> 		Class c = java.nio.charset.spi.CharsetProvider.class;
> 		ClassLoader cl = ClassLoader.getSystemClassLoader();
> 		Iterator i = Service.providers(c, cl);
> 		Object next = null;
> As it seems org.codehaus.surefire.SurefireBooter does not promote the jar files to the classpath of the system classloader.

-- 
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: (MSUREFIRE-91) maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider

Posted by "Matthew Wheaton (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-91?page=comments#action_63526 ] 

Matthew Wheaton commented on MSUREFIRE-91:
------------------------------------------

The original task for this was http://jira.codehaus.org/browse/MSUREFIRE-16 which was deemed a duplicate issue.
I do not believe it is. I have the exact same problem as the original reporter. Standalone ANT/Junit with fork ON works just fine. Inside surefire it FAILS.
This means that surefire is NOT promoting the JAR contents to the boot classpath where CharsetProviders are resolved.
The same unit test works fine in Eclipse, as Eclipse essentially forks a new process to run as well.
Running under surefire/maven even with the fork option turned on in surefire still results in a failure.

> maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider
> ------------------------------------------------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-91
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-91
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: All
>     Reporter: Matthew Wheaton
>     Assignee: Brett Porter
>     Priority: Blocker

>
>
> maven-surefire-plugin cannot run a jUnit test for a custom charset provider specified in the jar file's META-INF/services/java.nio.charset.spi.CharsetProvider file. Class java.nio.charset.Charset performs a lookup using ClassLoader.getSystemClassLoader(); which does not have the jar file in its classpath and thus fails with e.g. junit.framework.AssertionFailedError: java.io.UnsupportedEncodingException: DIN_66003 although the jar file itself is correct. I think this is due to the plugin using its own classloader and the JDK using the system classloader but I may be totally wrong and everything is fine with the plugin.
> The method from java.nio.charset.Charset performing the lookup beings with
> private static Iterator providers() {
> 	return new Iterator() {
> 		Class c = java.nio.charset.spi.CharsetProvider.class;
> 		ClassLoader cl = ClassLoader.getSystemClassLoader();
> 		Iterator i = Service.providers(c, cl);
> 		Object next = null;
> As it seems org.codehaus.surefire.SurefireBooter does not promote the jar files to the classpath of the system classloader.

-- 
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: (MSUREFIRE-91) maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-91?page=all ]
     
Brett Porter closed MSUREFIRE-91:
---------------------------------

    Resolution: Duplicate

> maven-surefire-plugin cannot test custom charset providers specified in META-INF/services/java.nio.charset.spi.CharsetProvider
> ------------------------------------------------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-91
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-91
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: All
>     Reporter: Matthew Wheaton
>     Assignee: Brett Porter
>     Priority: Blocker

>
>
> maven-surefire-plugin cannot run a jUnit test for a custom charset provider specified in the jar file's META-INF/services/java.nio.charset.spi.CharsetProvider file. Class java.nio.charset.Charset performs a lookup using ClassLoader.getSystemClassLoader(); which does not have the jar file in its classpath and thus fails with e.g. junit.framework.AssertionFailedError: java.io.UnsupportedEncodingException: DIN_66003 although the jar file itself is correct. I think this is due to the plugin using its own classloader and the JDK using the system classloader but I may be totally wrong and everything is fine with the plugin.
> The method from java.nio.charset.Charset performing the lookup beings with
> private static Iterator providers() {
> 	return new Iterator() {
> 		Class c = java.nio.charset.spi.CharsetProvider.class;
> 		ClassLoader cl = ClassLoader.getSystemClassLoader();
> 		Iterator i = Service.providers(c, cl);
> 		Object next = null;
> As it seems org.codehaus.surefire.SurefireBooter does not promote the jar files to the classpath of the system classloader.

-- 
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