[ 
https://jira.codehaus.org/browse/SUREFIRE-1132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=360590#comment-360590
 ] 

Alexander Ashitkin edited comment on SUREFIRE-1132 at 1/3/15 2:54 PM:
----------------------------------------------------------------------

Jdk 8u25 build runs for 24h, 2 class not found happened so far:
{code}
17:02:02 [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on 
project some-server: Execution default-test of goal 
org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an 
error in the forked process
17:02:02 [ERROR] java.lang.NoClassDefFoundError: 
org/junit/runner/notification/RunListener
17:02:02 [ERROR] at java.lang.Class.getDeclaredConstructors0(Native Method)
17:02:02 [ERROR] at 
java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
17:02:02 [ERROR] at java.lang.Class.getConstructor0(Class.java:3067)
17:02:02 [ERROR] at java.lang.Class.getConstructor(Class.java:1817)
17:02:02 [ERROR] at 
org.apache.maven.surefire.util.ReflectionUtils.getConstructor(ReflectionUtils.java:76)
17:02:02 [ERROR] at 
org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:129)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.createProviderInCurrentClassloader(ForkedBooter.java:230)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:199)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
17:02:02 [ERROR] Caused by: java.lang.ClassNotFoundException: 
org.junit.runner.notification.RunListener
17:02:02 [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
17:02:02 [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
17:02:02 [ERROR] at java.security.AccessController.doPrivileged(Native Method)
17:02:02 [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
17:02:02 [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
17:02:02 [ERROR] at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
17:02:02 [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
17:02:02 [ERROR] ... 10 more
17:02:02 [ERROR] -> [Help 1]
{code}

In this sporadic failures 'java.lang.NoClassDefFoundError: 
org/junit/runner/notification/RunListener' is almost determenistic. I need to 
implement some classloading debug facilities to trace this down. Atthe moment 
it looks like some class which accepts RunListener as ctr arg is loaded itself, 
but failed to load junit:
{code}
    public static Object instantiateOneArg( ClassLoader classLoader, String 
className, Class param1Class,
                                            Object param1 )
    {

        try
        {
            Class aClass = loadClass( classLoader, className ); //ok
            Constructor constructor = ReflectionUtils.getConstructor( aClass, 
new Class[]{ param1Class } ); //exception
            return constructor.newInstance( param1 );
        }
        catch ( InvocationTargetException e )
        {
            throw new SurefireReflectionException( e.getTargetException() );
        }
        catch ( InstantiationException e )
        {
            throw new SurefireReflectionException( e );
        }
        catch ( IllegalAccessException e )
        {
            throw new SurefireReflectionException( e );
        }
    }
{code}


Please help with 2 questions:
* is there any built in debugging for classloading in surefire?
* forked booter trying to find ctr with parameter ProviderParameters.class 
which results in junit exception. Could you please give some insight on waht is 
happenening here?

thanks in advance


was (Author: alex_ashitkin):
Jdk 8u25 build runs for 24h, 2 class not found happened so far:
{code}
17:02:02 [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on 
project streaming-bb-server: Execution default-test of goal 
org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an 
error in the forked process
17:02:02 [ERROR] java.lang.NoClassDefFoundError: 
org/junit/runner/notification/RunListener
17:02:02 [ERROR] at java.lang.Class.getDeclaredConstructors0(Native Method)
17:02:02 [ERROR] at 
java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
17:02:02 [ERROR] at java.lang.Class.getConstructor0(Class.java:3067)
17:02:02 [ERROR] at java.lang.Class.getConstructor(Class.java:1817)
17:02:02 [ERROR] at 
org.apache.maven.surefire.util.ReflectionUtils.getConstructor(ReflectionUtils.java:76)
17:02:02 [ERROR] at 
org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg(ReflectionUtils.java:129)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.createProviderInCurrentClassloader(ForkedBooter.java:230)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:199)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
17:02:02 [ERROR] at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
17:02:02 [ERROR] Caused by: java.lang.ClassNotFoundException: 
org.junit.runner.notification.RunListener
17:02:02 [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
17:02:02 [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
17:02:02 [ERROR] at java.security.AccessController.doPrivileged(Native Method)
17:02:02 [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
17:02:02 [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
17:02:02 [ERROR] at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
17:02:02 [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
17:02:02 [ERROR] ... 10 more
17:02:02 [ERROR] -> [Help 1]
{code}

In this sporadic failures 'java.lang.NoClassDefFoundError: 
org/junit/runner/notification/RunListener' is almost determenistic. I need to 
implement some classloading debug facilities to trace this down. Atthe moment 
it looks like some class which accepts RunListener as ctr arg is loaded itself, 
but failed to load junit:
{code}
    public static Object instantiateOneArg( ClassLoader classLoader, String 
className, Class param1Class,
                                            Object param1 )
    {

        try
        {
            Class aClass = loadClass( classLoader, className ); //ok
            Constructor constructor = ReflectionUtils.getConstructor( aClass, 
new Class[]{ param1Class } ); //exception
            return constructor.newInstance( param1 );
        }
        catch ( InvocationTargetException e )
        {
            throw new SurefireReflectionException( e.getTargetException() );
        }
        catch ( InstantiationException e )
        {
            throw new SurefireReflectionException( e );
        }
        catch ( IllegalAccessException e )
        {
            throw new SurefireReflectionException( e );
        }
    }
{code}


Please help with 2 questions:
* is there any built in debugging for classloading in surefire?
* forked booter trying to find ctr with parameter ProviderParameters.class 
which results in junit exception. Could you please give some insight on waht is 
happenening here?

thanks in advance

> Surefire: regular isolated classloader failures in parallelbuild
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-1132
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-1132
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading
>    Affects Versions: 2.17
>         Environment: SLES 3.0.80-0.7-default SMP x86_64 GNU/Linux
> windows server 2008 x64
> Maven 3.2.2, 3.2.3, 3.2.5
> Oracle HotSpot JDK 7u25
>            Reporter: Alexander Ashitkin
>         Attachments: consoleText-1.txt, consoleText-2.txt, consoleText-3.txt
>
>
> We have a large project of 300+ modules which regularly fails with different 
> kind of classloading issues in different places in surefire plugin. The issue 
> is reproduced only with parallel build and is not reproduced in single 
> threaded. This is a main contributor in build instability for us. All the not 
> loaded dependnecies are actually present in dependency tree. I attached 3 
> different samples of how build fails.
> Surefire config:
> {code}
>                     <configuration>
>                         <forkCount>0</forkCount>
>                         <!--doesnt work in parrallel build. Causes build 
> failures with error java.io.IOException: Stream Closed-->                     
>  <redirectTestOutputToFile>false</redirectTestOutputToFile>
>                         <useManifestOnlyJar>false</useManifestOnlyJar>
>                     </configuration>
> {code}
> maven cmd is like install -T 10
>  Please advise how to sort this out - ready to run any provided diagnostic 
> and evaluate any options.
> Thanks in advance, Alexander



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to