Message4484
envoirement:
-define a python class
-attach to self a instance of a normal Java class
-serialize the defined class object using ObjectOutputStream
-deserialize using PythonObjectInputStream
result:
when you try to deserialize u will get an exception telling you that the
simple Java class can not be found in the 'javapackage'.
my quick fix:
I have rewrite the PyJavaType and added the content:
@Override
protected Object writeReplace() {
if("__builtin__".equals(this.getModule().toString()))
return super.writeReplace();
return new TypeJavaResolver((Class<?>) javaProxy);
}
static class TypeJavaResolver implements Serializable {
private static final long serialVersionUID = 1L;
private Class<?> java_class;
TypeJavaResolver(Class<?> java_class) {
this.java_class = java_class;
}
private Object readResolve() {
return PyType.fromClass(java_class);
}
} |
|
Date |
User |
Action |
Args |
2009-04-08 12:29:58 | chupym | set | recipients:
+ chupym |
2009-04-08 12:29:58 | chupym | set | messageid: <1239193798.4.0.217948400711.issue1310@psf.upfronthosting.co.za> |
2009-04-08 12:29:58 | chupym | link | issue1310 messages |
2009-04-08 12:29:57 | chupym | create | |
|