• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.text.ParseException in Web service

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my project i am pulling data from people soft application using people soft web services but when i am creating the response i am getting java.text.ParseException, please help



The full exception is



xisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.oracle.xmlns.Enterprise.Tools.services.CI_CI_PERSONAL_DATA_1.CI_CI_PERSONAL_DATA_BindingStub.CI_CI_PERSONAL_DATA_G(CI_CI_PERSONAL_DATA_BindingStub.java:2832)
at com.ustri.OrionWebService.ProcessMain.main(ProcessMain.java:37)

{http://xml.apache.org/axis/}hostname:C124USS

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2451)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.oracle.xmlns.Enterprise.Tools.services.CI_CI_PERSONAL_DATA_1.CI_CI_PERSONAL_DATA_BindingStub.CI_CI_PERSONAL_DATA_G(CI_CI_PERSONAL_DATA_BindingStub.java:2832)
at com.ustri.OrionWebService.ProcessMain.main(ProcessMain.java:37)
Caused by: java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
... 4 more
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is that date passed to the WS call (i.e., in what format)? If it's a string, have you tried other formats?
 
Santosh Raveendran
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf

i am not passing any dates i am pulling the data from the people soft application by passing a unique string id and when creating the response object i am getting this error, i checked in the data base and application every where date is in the correct format.

Thanks
santhosh
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by santosh raveendran:
In my project i am pulling data from people soft application using people soft web services but when i am creating the response i am getting java.text.ParseException, please help



You are not being clear here. If you are using PeopleSoft web services to obtain this information you are the "client" and you should be creating a request - not a response.

java.text.ParseException: Unparseable date: "1981-01-01"



This suggests that the (PeopleSoft?) web service was unable to parse the date-string that you provided.

i checked in the data base and application every where date is in the correct format


The formats used in the application/database are not necessarily relevant. Apparently some logic is expecting a certain date format and the one that you are using isn't it.
 
Santosh Raveendran
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peer

I am sending a request to the web service as a SOAP request and

the web service returns me a SOAP response which is received as a object in

my deployed code from which i need to extract my required information,

exception is getting thrown while creating the out put or response object

i am having a doubt wheather its the axis client thats causing the issue as

one of my coworkers successfully deployed the same wsdl in .NET without issues .

Thanks
santhosh
 
Peer Reynders
Bartender
Posts: 2968
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by santosh raveendran:
I am sending a request to the web service as a SOAP request and the web service returns me a SOAP response which is received as a object in my deployed code from which i need to extract my required information, exception is getting thrown while creating the out put or response object



Your original post shows a SOAPFault which clearly lists:


According to the SOAP standard


The Server class of errors indicate that the message could not be processed for reasons not directly attributable to the contents of the message itself but rather to the processing of the message. For example, processing could include communicating with an upstream processor, which didn't respond. The message may succeed at a later point in time. See also section 4.4 for a description of the SOAP Fault detail sub-element.



This would then mean that your request was ultimately responsible for the failure. The contents of "1981-01-01" in the request message was OK because the message treats it as a String. It's only later in the service logic (processing) that conversion of the String to a Date fails - hence the Server.userException code.

So technically your aren't receiving a SOAP response but a SOAP Fault which is thrown as an AxisFault.

Otherwise you are telling me that "1981-01-01" is nowhere in the SOAP request but is actually in your SOAP response and that the client stub is failing and throwing an AxisFault - setting the faultCode to "Server.userException" even though the problem is occurring locally, not on the server.

one of my coworkers successfully deployed the same wsdl in .NET without issues.[/QB]



Do you mean that your co-worker has successfully accessed the PeopleSoft web service with a .NET based client?

At this point I would capture the SOAP requests and responses from both clients with Apache TCPMon (Tutorial) or java.net tcpmon and compare the sets - that might give you a clue as to what is going wrong.

If after that you still need help, please refer to How to Get Help with SOAP web services.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check the java code where the response is getting formed.
may be some code like Date dt = DateFormat.getDateTimeInstance().parse(value); is getting used

the DateFormat.getDateTimeInstance gets the default formatter based on the locale.
so it may not match with the date time format in response.

may can try to use SimpleDateFormat API, by specifying the date format as per the response
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic