[jbossws-users] Classloader problem in WSDLDefinitionsFactory

Richard Opalka ropalka at redhat.com
Fri Nov 14 10:13:49 EST 2008


Hi Paul,

   use user forum next time, please!
Just FYI I applied your suggested patch
so it will be available in next JBossWS release:

[/home/opalka][/home/opalka/svn/jbossws/stack/native/trunk]>svn diff -r 
8734:8735 
modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
Index: 
modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- 
modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java    
(revision 8734)
+++ 
modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java    
(revision 8735)
@@ -107,7 +107,7 @@
          String defaultNamespace = getDefaultNamespace(wsdlDoc);
          if (Constants.NS_WSDL11.equals(defaultNamespace))
          {
-            WSDLFactory wsdlFactory = 
WSDLFactory.newInstance(JBossWSDLFactoryImpl.class.getName());
+            WSDLFactory wsdlFactory = 
WSDLFactory.newInstance(JBossWSDLFactoryImpl.class.getName(), 
this.getClass().getClassLoader());
             WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
             wsdlReader.setFeature("javax.wsdl.verbose", false);

Richard

Paul.WOODWARD at rbs.com wrote:
> Hi Guys,
>
> I have a problem - org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse() has the following line:
>
> WSDLFactory wsdlFactory = WSDLFactory.newInstance(JBossWSDLFactoryImpl.class.getName();
>
> This makes it use the system classloader to search for the WSDL factory implementation which breaks when it is used inside a container which provides a different classloader. Is there a good reason for this or would it be possible to replace it with :
>
> WSDLFactory wsdlFactory = WSDLFactory.newInstance(JBossWSDLFactoryImpl.class.getName(), getClass().getClassLoader());
>
> Thanks, Paul
>
> ***********************************************************************************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
> Authorised and regulated by the Financial Services Authority 
>  
> This e-mail message is confidential and for use by the 
> addressee only. If the message is received by anyone other 
> than the addressee, please return the message to the sender 
> by replying to it and then delete the message from your 
> computer. Internet e-mails are not necessarily secure. The 
> Royal Bank of Scotland plc does not accept responsibility for 
> changes made to this message after it was sent. 
>
> Whilst all reasonable care has been taken to avoid the 
> transmission of viruses, it is the responsibility of the recipient to 
> ensure that the onward transmission, opening or use of this 
> message and any attachments will not adversely affect its 
> systems or data. No responsibility is accepted by The 
> Royal Bank of Scotland plc in this regard and the recipient should carry 
> out such virus and other checks as it considers appropriate. 
> Visit our websites at: 
> www.rbs.com
> www.rbs.com/gbm
> www.rbsgc.com
> ***********************************************************************************
>
>
> _______________________________________________
> jbossws-users mailing list
> jbossws-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbossws-users
>   


-- 
B.Sc. Richard Opalka
Senior Software Engineer
JBoss, a division of Red Hat

Mobile: +420 731 186 942
Mail: ropalka at redhat.com




More information about the jbossws-users mailing list