You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "nadir amra (JIRA)" <ji...@apache.org> on 2012/09/18 01:31:07 UTC

[jira] [Commented] (AXIS2-5356) Axis2 does not handle java.sql's Date, Time, and TimeStamp

    [ https://issues.apache.org/jira/browse/AXIS2-5356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457470#comment-13457470 ] 

nadir amra commented on AXIS2-5356:
-----------------------------------

Currently, one can specify java.util.Data in POJO and it will get mapped to XSD date.  One can also specify java.util.Calendar and it will get mapped to XSD dateTime.  

Question is if there is a way to specify some Java class that will get mapped to XSD time?  And if the answer is no, then this may be a good reason to support ava.sql.Date, java.sql.Time, java.sql.Timestamp.

                
> Axis2 does not handle java.sql's  Date, Time, and TimeStamp
> -----------------------------------------------------------
>
>                 Key: AXIS2-5356
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5356
>             Project: Axis2
>          Issue Type: Bug
>    Affects Versions: 1.6.2
>         Environment: Windows XP, Axis2 1.6.2
>            Reporter: nadir amra
>
> Axis2 blows up with the stack trace below when a Java class that has any of the following classes as parameters in a method, or as a return value:
> java.sql.Date, java.sql.Time, java.sql.Timestamp.
> Here is the stack trace:
> [WARN] Unable to locate a BeanInfo cache for class java.sql.Date (stopClass=null). This will negatively affect performance!
> [ERROR] Exception occurred while trying to invoke service method getSQLDate
> org.apache.axis2.AxisFault: java.sql.Date
> 	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
> 	at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:47)
> 	at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:412)
> 	at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:818)
> 	at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:737)
> 	at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:646)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:206)
> 	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
> 	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
> 	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> 	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
> 	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
> 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.InstantiationException: java.sql.Date
> 	at java.lang.Class.newInstance0(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:42)
> 	... 30 more
> And here is the simple class that I used:
> package sample;
> public class ServiceDateTime
> {
>     public java.util.Date getUtilDate(java.util.Date date)
>     {
>         return new java.util.Date();
>     }
>     public java.util.Calendar getUtilCalendar(java.util.Calendar dateTime)
>     {
>         return java.util.Calendar.getInstance();
>     }
>     
>     public java.sql.Date getSQLDate(java.sql.Date date)
>     {
>         return new java.sql.Date(2000);
>     }
>     public java.sql.Time getSQLTime(java.sql.Time time)
>     {
>         return new java.sql.Time(3000);
>     }    
>     public java.sql.Timestamp getSQLTimestamp(java.sql.Timestamp dateTime)
>     {
>         return new java.sql.Timestamp(4000);
>     }   
> }
> The generated WSDL file I suppose looks OK.  It maps the java.sql types Date, Time, and Timestamp to date, or time. or dateTime. 
> If that is the case, then we should handle the conversion of the java.sql types.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


what components handle wsdl generation given POJO?

Posted by Nadir Amra <am...@us.ibm.com>.
Trying to figure out all the components involved in generating WSDL from a 
POJO.  My main goal is trying to determine how type names and parameters 
are generated (I have an idea, but want to look at the code). 

Can anyone point me to where to look?  I have been to 
org.apache.axis2.description.java2wsdl package in kernel module, but still 
struggling to find where the type names and parameters names are 
generated.

Thanks in advance.