Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-2649

SOAPMessage implementation bug

XMLWordPrintable

      Relating to JBWS-1439 issue, I've found the root of the problem:

      When you get the exception mentioned:

      java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
      at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:424)
      at org.jboss.ws.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:83)
      at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:161)

      I found that the jbossws-native-saaj.jar library has an OVERWRITTEN class javax.xml.soap.SOAPMessage which has overrided the method setProperty():

      public void setProperty(String property, Object value) throws SOAPException

      { properties.put(property, value); }

      This class is an ABSTRACT class and the specification clearly indicates: setProperty must be overridden by ALL SUBCLASSES of SOAPMessage.
      All the javax.xml.soap stuff has been included in the runtime library (rt.jar) in jre 1.6 so, Jboss gives priority to this class and the original one has the next code (as an abstract class) instead of the jbossws-native-saaj.jar one:

      public void setProperty(String s, Object obj)
      throws SOAPException

      { throw new UnsupportedOperationException("setProperty must be overridden by all subclasses of SOAPMessage"); }

      There is an implementation of SOAPMessage in /client/jbossws-native-core.jar, called org.jboss.ws.core.soap.SOAPMessageImpl which extends the SOAPMessage abstract class but, in this case, the rt.jar is the one that has been loaded in the classpath.
      This implementation just calls the setProperty() method from his parent... but the parent code is throwing the UnsupporteOperationException!!!

      As the specification indicates, the method setProperty that has been overwritten in the jbossws-native-saaj.jar (SOAPMessage class) must be in the implementation (SOAPMessageImpl subclass), not in the abstract class.

            Unassigned Unassigned
            mprado_jira Marcos Prado (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: