Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002998 [Hessian] crash always 10-09-08 06:59 09-05-23 01:37
Reporter gritstone View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.2.0
  Product Build
Summary 0002998: Hessian deserialization crashes on on multi java.util.TimeZone responses
Description A hessian client crashes deserializing the response if the response contains two java.util.TimeZone objects representing different timezones. This fails on Java SE 6u2 and Java SE 6u7.

The client crashes with the following exception:
com.caucho.hessian.client.HessianRuntimeException: com.caucho.hessian.io.HessianFieldException: sun.util.calendar.ZoneInfo.transitions: [J cannot be assigned from null
    at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:232)
    at $Proxy0.echoTimeZoneList(Unknown Source)
    at ZonedDateTimeTest.main(ZonedDateTimeTest.java:49)
Caused by: com.caucho.hessian.io.HessianFieldException: sun.util.calendar.ZoneInfo.transitions: [J cannot be assigned from null
    at com.caucho.hessian.io.JavaDeserializer.logDeserializeError(JavaDeserializer.java:677)
    at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:400)
    at com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:233)
    at com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:157)
    at com.caucho.hessian.io.SerializerFactory.readObject(SerializerFactory.java:378)
    at com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2051)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1977)
    at com.caucho.hessian.io.CollectionDeserializer.readList(CollectionDeserializer.java:78)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1700)
    at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:220)
    ... 2 more
Caused by: java.lang.UnsupportedOperationException: com.caucho.hessian.io.BasicDeserializer@6754d6
    at com.caucho.hessian.io.BasicDeserializer.readLengthList(BasicDeserializer.java:598)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1714)
    at com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:396)
    ... 10 more
com.caucho.hessian.io.HessianFieldException: sun.util.calendar.ZoneInfo.transitions: [J cannot be assigned from null
Steps To Reproduce
Additional Information Sample server:

public interface ZonedDateTimeServer {

    public List<TimeZone> echoTimeZoneList(List<TimeZone> times);
}


Sample implementation:
public class ZonedDateTimeServerImpl implements ZonedDateTimeServer {
    @Override
    public List<TimeZone> echoTimeZoneList(List<TimeZone> times) {
        List<TimeZone> list = new ArrayList<TimeZone>();
        for (TimeZone time : times) {
            System.out.println("Adding TimeZone: " + time.toString());
            list.add(time);
        }
        return list;
    }
}

Sample client:
public class ZonedDateTimeTest {

    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            String url = "http://localhost:8080/date-time-server/hello"; [^]
    
            HessianProxyFactory factory = new HessianProxyFactory();
            factory.setDebug(true);
            ZonedDateTimeServer dtServer = (ZonedDateTimeServer) factory.create(ZonedDateTimeServer.class, url);
    
            /* Works */
            TimeZone la = TimeZone.getTimeZone("America/Los_Angeles");
            List<TimeZone> responseList = dtServer.echoTimeZoneList(Collections.singletonList(la));
            System.out.println("LA Response: " + responseList);
  
            /* Works */
            TimeZone london = TimeZone.getTimeZone("Europe/London");
            responseList = dtServer.echoTimeZoneList(Collections.singletonList(london));
            System.out.println("London Response: " + responseList);

            /* Fails */
            List<TimeZone> tzList = new ArrayList<TimeZone>();
            tzList.add(la);
            tzList.add(london);
            responseList = dtServer.echoTimeZoneList(tzList);
            System.out.println("LA + London: " + responseList);
        } catch (final Exception e ) {
            e.printStackTrace();
            System.err.println(e.getLocalizedMessage());
        }
    }
}
Attached Files

- Relationships

- Notes
(0003528)
valysivec27
10-01-08 17:52

I'm having the same issue :(
 

- Issue History
Date Modified Username Field Change
10-09-08 06:59 gritstone New Issue
10-01-08 17:52 valysivec27 Note Added: 0003528
07-18-23 02:06 WilliamThompson Note Added: 0007216
08-02-23 03:34 chickenplusone Note Added: 0007222
09-05-23 01:37 exceedmare Note Added: 0007250
11-14-23 17:41 ferg Note Deleted: 0007216
11-14-23 17:41 ferg Note Deleted: 0007222
11-14-23 17:41 ferg Note Deleted: 0007250


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
39 total queries executed.
30 unique queries executed.
Powered by Mantis Bugtracker