axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26362] New: - not all exceptions marked throwable?
Date Thu, 22 Jan 2004 21:46:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26362>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26362

not all exceptions marked throwable?

           Summary: not all exceptions marked throwable?
           Product: Axis
           Version: 1.2 Alpha
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: spa5@sporty.org


I have two basic exeptions, DataSourceException and PrimaryKeyException which
are thrown by a class behind an axis web-service.  They are exactly the same
except for their class names....

---
package mypackage;

import java.io.*;
import java.rmi.*;

public class DataSourceException extends RemoteException implemetns Serializable
{
  public DataSourceException()
  {
     super();
  }
  public DataSourceException(String string)
  {
     super(string);
  }
}
---

When I deploy a service with the prototype...

   public class UserRemote implements UserDaoInterface

which implements this and this alone...

   public void insert(User user) throws PrimaryKeyException, DataSourceException;

I get a weird soap message after throwing PrimaryKeyException with the following
descriptor.

-- Deployment --
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

 <service name="allocations/User" provider="java:RPC">
  <namespace>allocations/User</namespace>
  <parameter name="className" value="mypackage.user.UserRemote"/>
  <parameter name="allowedMethods" value="insert"/>

     <beanMapping
       xmlns:ns="allocations/User"
       qname="ns:PrimaryKeyException"
       type="java:mypackage.PrimaryKeyException"
     />

     <beanMapping
       xmlns:ns="allocations/User"
       qname="ns:DataSourceException"
       type="java:mypackage.DataSourceException"
     />

     <beanMapping
       xmlns:ns="allocations/User"
       qname="ns:Company"
       type="java:mypackage.company.Company"
     />

     <beanMapping
       xmlns:ns="allocations/User"
       qname="ns:User"
       type="java:mypackage.user.User"
     />

 </service>
</deployment>

--- Soap response ---
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>mypackage.PrimaryKeyException</faultstring>
   <detail>
    <mypackage.PrimaryKeyException xsi:type="ns1:PrimaryKeyException"
xmlns:ns1="directory/User">
     <cause xsi:nil="true"/>
     <message xsi:type="xsd:string" xsi:nil="true"/>
    </mypackage.PrimaryKeyException>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
--

If I exclude the bean serialization, i get the following for a wsdl descriptor
which totally confuses axis, since Throwable can't be deserialized.

--- wsdl response sniplet ---
<complexType name="PrimaryKeyException">
-
	<sequence>
<element name="cause" nillable="true" type="xsd:anyType"/>
<element name="message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
-
	<complexType name="DataSourceException">
-
	<sequence>
<element name="cause" nillable="true" type="tns2:Throwable"/>
<element name="message" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
---

If I switch the declaration order of the method exceptions, the throwable and
anytype switch positions.

I saw the bug about throwable being replaced by anytype for exceptions.  It
seems to have resurfaced.  I tried 1.1, 1.2alpha and cvs versions.  ALso, if I
don't extend RemoteException, axis doesn't put it in the <detail/> element, as
the documentation said it should.  I thought it wasn't necessary as a prior bug
pointed out, but unless I extend, it becomes blank.  Hepl?

Mime
View raw message