You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (JIRA)" <ji...@apache.org> on 2017/11/19 10:58:01 UTC

[jira] [Assigned] (SUREFIRE-1446) Isolated Classloader cant resolve JVM class w/o null constructor

     [ https://issues.apache.org/jira/browse/SUREFIRE-1446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tibor Digana reassigned SUREFIRE-1446:
--------------------------------------

    Assignee: Tibor Digana

> Isolated Classloader cant resolve JVM class w/o null constructor
> ----------------------------------------------------------------
>
>                 Key: SUREFIRE-1446
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1446
>             Project: Maven Surefire
>          Issue Type: Test
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.20.1
>         Environment: mvn -version
> maven=3.3.3
> JAVA_HOME=JDK_1.8
>            Reporter: Martin Gainty
>            Assignee: Tibor Digana
>            Priority: Blocker
>         Attachments: RuntimeExceptionsAsyncMepTest.java
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> //i need to load com.sun.xml.internal.ws.api.SOAPVersion which doesnt have null constructor
> //surefire-plugin reflection methods cannot resolve the class e.g.
> //LOAD in com.sun.xml.internal.ws.api.SOAPVersion into maven-surefire-plugin @Test
> java.lang.Class<?>	 soapVersionClazz=null;
> ClassLoader soapVersionClassloader = com.sun.xml.internal.ws.api.SOAPVersion.class.getClassLoader();
> //always the case
> if(soapVersionClassloader==null) soapVersionClassloader=Thread.currentThread().getContextClassLoader();
> String soapVersionString="com.sun.xml.internal.ws.api.SOAPVersion";
> System.out.println("RuntimeExceptionsAsyncMepTest::getPort LNE 566 soapVersionClassloader="+soapVersionClassloader);
> try {				soapVersionClazz=soapVersionClassloader.loadClass(soapVersionString);
> }
> catch(ClassNotFoundException cnfe) { System.out.println("RuntimeExceptionsAsyncMepTest::getPort LINE 561 throws ClassNotFoundException message="+cnfe.getMessage()); }
> System.out.println("RuntimeExceptionsAsyncMepTest::getPort LINE 564 soapVersionClazz="+soapVersionClazz);
> com.sun.xml.internal.ws.api.SOAPVersion soapVersion =null;
> try
> {
> 	soapVersion=(com.sun.xml.internal.ws.api.SOAPVersion)soapVersionClazz.newInstance();
>   }
>  catch(InstantiationException iae) { System.out.println("RuntimeExceptionsAsyncMepTest::getPort LINE 572 throws InstantiationException message="+iae.getMessage()); }
> catch(IllegalAccessException illegal) { System.out.println("RuntimeExceptionsAsyncMepTest::getPort LINE 573 throws IllegalAccessException message="+illegal.getMessage()); }
> System.out.println("RuntimeExceptionsAsyncMepTest::getPort LINE 574 soapVersion="+soapVersion);



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)