You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Sunny Ip (JIRA)" <tu...@ws.apache.org> on 2007/04/02 21:12:32 UTC

[jira] Created: (TUSCANY-1198) ClassCastException when getting back a type extended from anything besides a string

ClassCastException when getting back a type extended from anything besides a string
-----------------------------------------------------------------------------------

                 Key: TUSCANY-1198
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1198
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-M2
         Environment: Apache Tomcat 5.5.17
            Reporter: Sunny Ip


In my client code (calling from a JSP), whenever I am expecting a return type that extends anything but a string (tried so far with boolean, int, double, decimal, long), I get the following:

java.lang.ClassCastException: java.lang.String
	$Proxy34.getAccountBalance(Unknown Source)
	com.bns.references.account.client.AccountClientImpl.getAccountBalance(AccountClientImpl.java:14)
	org.apache.jsp.AccountClientTest_jsp._jspService(AccountClientTest_jsp.java:81)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.tuscany.runtime.webapp.TuscanyFilter.doFilter(TuscanyFilter.java:58)

Here is a snippet from a WSDL file that is being used:

<xs:schema xmlns:sample="http://sample" targetNamespace="http://sample">
  <xsd:element name="getAccountBalance">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="accountNumber" type="sample:AccountNumber" />
      </xs:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="getAccountBalanceResponse">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="return" type="sample:Dollars" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:simpleType name="Dollars">
    <xsd:restriction base="xsd:double">
      <xsd:minInclusive value="0" />
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>

with everything else exactly the same, changing the return type for getAccountBalanceResponse from "sample:Dollars" to "xsd:double" makes everything work fine.  However, I need to be able to handle these kinds of extensions.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Commented: (TUSCANY-1198) ClassCastException when getting back a type extended from anything besides a string

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486110 ] 

Frank Budinsky commented on TUSCANY-1198:
-----------------------------------------

Another thought ... getting String values is often an indication that the metadata isn't available at runtime, so it could be that the SDO metadata hasn't been registered in the application's context.

> ClassCastException when getting back a type extended from anything besides a string
> -----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1198
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1198
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Apache Tomcat 5.5.17
>            Reporter: Sunny Ip
>         Attachments: AccountHistoryService.wsdl
>
>
> In my client code (calling from a JSP), whenever I am expecting a return type that extends anything but a string (tried so far with boolean, int, double, decimal, long), I get the following:
> java.lang.ClassCastException: java.lang.String
> 	$Proxy34.getAccountBalance(Unknown Source)
> 	com.bns.references.account.client.AccountClientImpl.getAccountBalance(AccountClientImpl.java:14)
> 	org.apache.jsp.AccountClientTest_jsp._jspService(AccountClientTest_jsp.java:81)
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.tuscany.runtime.webapp.TuscanyFilter.doFilter(TuscanyFilter.java:58)
> Here is a snippet from a WSDL file that is being used:
> <xs:schema xmlns:sample="http://sample" targetNamespace="http://sample">
>   <xsd:element name="getAccountBalance">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="accountNumber" type="sample:AccountNumber" />
>       </xs:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:element name="getAccountBalanceResponse">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="return" type="sample:Dollars" />
>       </xsd:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:simpleType name="Dollars">
>     <xsd:restriction base="xsd:double">
>       <xsd:minInclusive value="0" />
>     </xsd:restriction>
>   </xsd:simpleType>
> </xsd:schema>
> with everything else exactly the same, changing the return type for getAccountBalanceResponse from "sample:Dollars" to "xsd:double" makes everything work fine.  However, I need to be able to handle these kinds of extensions.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-1198) ClassCastException when getting back a type extended from anything besides a string

Posted by "Sunny Ip (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sunny Ip updated TUSCANY-1198:
------------------------------

    Attachment: AccountHistoryService.wsdl

> ClassCastException when getting back a type extended from anything besides a string
> -----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1198
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1198
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Apache Tomcat 5.5.17
>            Reporter: Sunny Ip
>         Attachments: AccountHistoryService.wsdl
>
>
> In my client code (calling from a JSP), whenever I am expecting a return type that extends anything but a string (tried so far with boolean, int, double, decimal, long), I get the following:
> java.lang.ClassCastException: java.lang.String
> 	$Proxy34.getAccountBalance(Unknown Source)
> 	com.bns.references.account.client.AccountClientImpl.getAccountBalance(AccountClientImpl.java:14)
> 	org.apache.jsp.AccountClientTest_jsp._jspService(AccountClientTest_jsp.java:81)
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.tuscany.runtime.webapp.TuscanyFilter.doFilter(TuscanyFilter.java:58)
> Here is a snippet from a WSDL file that is being used:
> <xs:schema xmlns:sample="http://sample" targetNamespace="http://sample">
>   <xsd:element name="getAccountBalance">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="accountNumber" type="sample:AccountNumber" />
>       </xs:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:element name="getAccountBalanceResponse">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="return" type="sample:Dollars" />
>       </xsd:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:simpleType name="Dollars">
>     <xsd:restriction base="xsd:double">
>       <xsd:minInclusive value="0" />
>     </xsd:restriction>
>   </xsd:simpleType>
> </xsd:schema>
> with everything else exactly the same, changing the return type for getAccountBalanceResponse from "sample:Dollars" to "xsd:double" makes everything work fine.  However, I need to be able to handle these kinds of extensions.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Resolved: (TUSCANY-1198) ClassCastException when getting back a type extended from anything besides a string

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Budinsky resolved TUSCANY-1198.
-------------------------------------

    Resolution: Cannot Reproduce

I generated the SDO interfaces using the attached wsdl file, and the getAccountBalanceResponse interface contains:

  double getReturn();
  void setReturn(double value);

Exactly the same as if xs:double was used as the type, instead of sample:Dollars.

Since the SDO part is working as expected, perhaps this is some kind of SCA proxy problem?

> ClassCastException when getting back a type extended from anything besides a string
> -----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1198
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1198
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-M2
>         Environment: Apache Tomcat 5.5.17
>            Reporter: Sunny Ip
>         Attachments: AccountHistoryService.wsdl
>
>
> In my client code (calling from a JSP), whenever I am expecting a return type that extends anything but a string (tried so far with boolean, int, double, decimal, long), I get the following:
> java.lang.ClassCastException: java.lang.String
> 	$Proxy34.getAccountBalance(Unknown Source)
> 	com.bns.references.account.client.AccountClientImpl.getAccountBalance(AccountClientImpl.java:14)
> 	org.apache.jsp.AccountClientTest_jsp._jspService(AccountClientTest_jsp.java:81)
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	org.apache.tuscany.runtime.webapp.TuscanyFilter.doFilter(TuscanyFilter.java:58)
> Here is a snippet from a WSDL file that is being used:
> <xs:schema xmlns:sample="http://sample" targetNamespace="http://sample">
>   <xsd:element name="getAccountBalance">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="accountNumber" type="sample:AccountNumber" />
>       </xs:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:element name="getAccountBalanceResponse">
>     <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="return" type="sample:Dollars" />
>       </xsd:sequence>
>     </xsd:complexType>
>   </xsd:element>
>   <xsd:simpleType name="Dollars">
>     <xsd:restriction base="xsd:double">
>       <xsd:minInclusive value="0" />
>     </xsd:restriction>
>   </xsd:simpleType>
> </xsd:schema>
> with everything else exactly the same, changing the return type for getAccountBalanceResponse from "sample:Dollars" to "xsd:double" makes everything work fine.  However, I need to be able to handle these kinds of extensions.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org