FW: [Mx4j-user] RE: Hessian connector
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <3DBB246A773D8A4DAF28AAEB59EC827CD65331@BEAVIS.daxtechnologies.com> |
Hi Bordet,
I followed your advice and I put Hessian 3.0.8 and it worked, but now I
found a problem in Hessin in ArrayDeserializer and it is fixed in
Hessian 3.0.13.
After I switched again to Hessian 3.0.13 and I looked at that error I
realized why occur. They change Deserializer from abstract class to
interface :-)
The bug in Hessian is very annoying and occurs because they the
deserializer doesn't take count of the class types from array
instantance and recreate an array based on the field array type(see
bellow the relevant fragment from Hessian ArrayDeserializer class). The
result is a ClassCastException when you deserialize arrays.
It is possible to switch to this version of Hessian? I will try to
compile locally mx4j with Hessian 3.0.13 and to resolve the changes, I
hope there are not to much changes.
Thanks.
Hessian 3.0.13, ArrayDeserializer.java :
public Class getType()
{
if (_componentType == null || _componentType.getName() == null) {
return Object[].class;
}
try {
return Class.forName("[" + getArrayClassName(_componentType));
} catch (ClassNotFoundException e) {
return Object[].class;
}
}
Hessian 3.0.8, ArrayDeserializer.java :
public Class getType()
{
return Object[].class;
}
java.lang.IncompatibleClassChangeError: class
mx4j.tools.remote.caucho.serialization.JMXSerializer has interface
com.caucho.hessian.io.Serializer as super class
at
mx4j.tools.remote.caucho.serialization.JMXSerializerFactory.getDefaultSe
rializer(JMXSerializerFactory.java:23)
at
com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.
java)
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Bordet,
Simone
Sent: Tuesday, May 31, 2005 2:25 AM
To: Adrian Tarau; [email protected]
Subject: [Mx4j-user] RE: Hessian connector
Adrian,
which version of Hessian are you using ?
MX4J works with Hessian 3.0.8.
Simon
_____
From: [email protected]
[mailto:[email protected]] On Behalf Of Adrian Tarau
Sent: Monday, May 30, 2005 20:23
To: [email protected]
Subject: Hessian connector
I tried to use hessian connector and all the time I get this exception.
java.lang.IncompatibleClassChangeError: class
mx4j.tools.remote.caucho.serialization.JMXSerializer has interface
com.caucho.hessian.io.Serializer as super class
at
mx4j.tools.remote.caucho.serialization.JMXSerializerFactory.getDefaultSe
rializer(JMXSerializerFactory.java:23)
at
com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.
java)
at
com.caucho.hessian.io.HessianOutput.writeObject(HessianOutput.java:305)
at
mx4j.tools.remote.caucho.hessian.HessianCauchoOutput.writeObject(Hessian
CauchoOutput.java:82)
at
mx4j.tools.remote.caucho.CauchoClientInvoker$CauchoServiceProxy.writeArg
uments(CauchoClientInvoker.java:120)
at
mx4j.tools.remote.caucho.CauchoClientInvoker$CauchoServiceProxy.invoke(C
auchoClientInvoker.java:66)
at $Proxy0.invoke(Unknown Source)
at
mx4j.tools.remote.http.HTTPClientInvoker.invoke(HTTPClientInvoker.java:1
17)
at
mx4j.tools.remote.JMXConnectionMBeanServerConnection.invoke(JMXConnectio
nMBeanServerConnection.java:130)
JMXSerializer is defined below:
class JMXSerializer extends Serializer
{
public void writeObject(Object obj, AbstractHessianOutput out) throws
IOException
{
out.writeMapBegin(obj.getClass().getName());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(obj);
oos.close();
out.writeBytes(baos.toByteArray());
}
}
but Serializer is and interface com.caucho.hessian.io.Serializer so no
wander why JVM throws that error.
I use MX4J 3.0.1
Kind regards,
Adrian Tarau
Software Engineer
DAX Technologies Corp.
Matawan, New Jersey, 07747, U.S.
Tel: (732) - 203 - 1784 x 125
Mobile: (848) - 218 - 0804
Fax: (732) - 203 - 1786
E-Mail: <mailto:[email protected]> [email protected]