Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

[ sisc-Bugs-1434594 ] deserialisation does not respect current-class-path: msg#00009

Subject: [ sisc-Bugs-1434594 ] deserialisation does not respect current-class-path
Bugs item #1434594, was opened at 2006-02-19 13:51
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1434594&group_id=23735

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 7
Submitted By: Matthias Radestock (mradestock)
Assigned to: Nobody/Anonymous (nobody)
Summary: deserialisation does not respect current-class-path

Initial Comment:
Step #1: compile the following Java program and place the resulting class file 
in a directory where the standard SISC class path *cannot* see it:

import java.io.IOException;
import sisc.io.ValueWriter;
import sisc.data.Value;

public class Foo extends Value {

    public Foo() {}

    public void display(ValueWriter w) throws IOException {
        w.append("#!Foo");
    }

}

Step #2: Run the following SISC program

(define tmp-path "/dir-of-Foo-class/")
(define ser-file (string-append tmp-path "foo.ser"))

(import serial-io)
(define (sisc-ser-deser x)
  (call-with-serial-output-file ser-file
    (lambda (port) (serialize x port)))
  (call-with-serial-input-file ser-file deserialize))

(current-class-path `(,tmp-path))

(import s2j)
(import* type-system make-type)
(define x-java-class (java-class '|Foo|))
(define x-java-value (java-new x-java-class))
(define x-type (make-type '|Foo|))
(define x-value (java-unwrap x-java-value))
(sisc-ser-deser x-java-class)
(sisc-ser-deser x-java-value)
(sisc-ser-deser x-type)
(sisc-ser-deser x-value)


The four serialisations fail with the following errors:

#;> Error in deserialize: error reading from port '#<native-input-port>': 
java.lang.ClassNotFoundException: Foo 
?:?:?: <from call to @serial-io-native::deserialize>
?:?:?: <indeterminate call>
#;> Error in deserialize: <java.lang.RuntimeException>: cannot deserialize java 
object
?:?:?: <from call to @serial-io-native::deserialize>
?:?:?: <indeterminate call>
#;> Error in deserialize: error reading from port '#<native-input-port>': 
java.lang.ClassNotFoundException: Foo 
?:?:?: <from call to @serial-io-native::deserialize>
?:?:?: <indeterminate call>
#;> Error in deserialize: error reading from port '#<native-input-port>': 
java.lang.ClassNotFoundException: Foo 
?:?:?: <from call to @serial-io-native::deserialize>
?:?:?: <indeterminate call>
#;> 


NB: These four cases are actually all handled by different sections of code, 
though the cause for the failure is always the same, i.e. a class name gets 
resolved in a class loader that does not contain the paths in 
|current-class-path|.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1434594&group_id=23735


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642


<Prev in Thread] Current Thread [Next in Thread>