axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Created: (AXIS-1528) WSDL2Java emitter creating Date data types which throw java.text.ParseExceptions
Date Wed, 25 Aug 2004 02:59:26 GMT

  A new issue has been created in JIRA.

View the issue:

Here is an overview of the issue:
        Key: AXIS-1528
    Summary: WSDL2Java emitter creating Date data types which throw java.text.ParseExceptions
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
             WSDL processing
             1.2 Beta

   Reporter: Christopher Bartling

    Created: Tue, 24 Aug 2004 7:58 PM
    Updated: Tue, 24 Aug 2004 7:58 PM
Environment: JDK 1.4.2_04, Windows XP

The wsdl2java emitter creates a constructor for Date data types which does not correctly parse
the default String representation of java.util.Date.  Below is a snippet of code from the
generated class, which the offending line commented out and a potential fix inserted.


import java.text.SimpleDateFormat;

public class Date implements, org.apache.axis.encoding.SimpleType {
    private java.util.Date value;

    public Date() {

    // Simple Types must have a String constructor
    public Date(java.util.Date value) {
        this.value = value;

    public Date(java.lang.String value) {
        try {
            // The following code does not work properly.  Throws a
            // ParseException.  SimpleDateFormat usage works.
            //this.value = (java.text.DateFormat.getDateTimeInstance()).parse(value);
            this.value = new SimpleDateFormat("EEE MMM dd hh:mm:ss z yyyy").parse(value);
        } catch (java.text.ParseException e) {
            throw new java.lang.RuntimeException(e.toString());

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message