DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14534>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14534

java.io.StreamCorruptedException: InputStream does not contain a serialized object

           Summary: java.io.StreamCorruptedException: InputStream does not
                    contain a serialized object
           Product: XalanJ2
           Version: 2.4
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Got above error with xalan 2.4.1 when trying to use xslt class file (compiled 
using xsltc command line) to transform xml by calling xsltc using jax api.

---------------Commands to compile the xsl using xsltc command line-------------
set XALANBINPATH=C:\xalan-j_2_4_1\bin

set TRANSFORMPATH=%XALANBINPATH%\xsltc.jar;%XALANBINPATH%\xml-apis.jar;%
XALANBINPATH%\xercesImpl.jar

java -cp %TRANSFORMPATH% org.apache.xalan.xsltc.cmdline.Compile -o 
CWGetCartAdaplet.class -x CWGetCartAdaplet.xsl
--------------------------------------------------------------------------------


-----------Method to read compiled class file into a Templates object ----------

    private Templates readTemplates(String file) throws 
CxXsltTransformationException {
        
            Templates templates = null;
            
            try {
                FileInputStream ostream = new FileInputStream(file);
                ObjectInputStream p = new ObjectInputStream(ostream);
                templates = (Templates)p.readObject();
                ostream.close();
            }
            catch (FileNotFoundException fnfe) {
                /*
            System.err.println("FileNotFoundException: Reading Compiled 
Translet From \"" + file +
            "\" - " + fnfe); 
                fnfe.printStackTrace();
                */
                throw new CxXsltTransformationException("FileNotFoundException: 
Reading Compiled Translet From \"" + file +
            "\" - " + fnfe);
        }
            catch (StreamCorruptedException sce) {
            System.err.println("StreamCorruptedException (Stream control 
information wrong): Preparing Stream To Read Template Object From Translet File 
\"" 
            + file + "\" - " + sce); 
                sce.printStackTrace();
                throw new CxXsltTransformationException
("StreamCorruptedException (Stream control information wrong): Preparing Stream 
To Read Template Object From Translet File \"" 
            + file + "\" - " + sce);
        }
            catch (OptionalDataException ode) {
                /*
            System.err.println("OptionalDataException (Primitive data found 
instead of objects): Reading Template Object From Translet File \"" 
            + file + "\" - " + ode); 
                ode.printStackTrace();
                */
                throw new CxXsltTransformationException("OptionalDataException 
(Primitive data found instead of objects): Reading Template Object From 
Translet File \"" 
            + file + "\" - " + ode);
        }
            catch (IOException ioe) {
                /*
            System.err.println("IOException: Preparing Stream To Read Template 
Object From Translet File \"" + file +
            "\" - " + ioe); 
                ioe.printStackTrace();
                */
                throw new CxXsltTransformationException("IOException: Preparing 
Stream To Read Template Object From Translet File \"" + file +
            "\" - " + ioe);
        }
            catch (ClassNotFoundException cnfe) {
                /*
            System.err.println("ClassNotFoundException: Reading Template Object 
>From Translet File \"" 
            + file + "\" - " + cnfe); 
                cnfe.printStackTrace();
                */
                throw new CxXsltTransformationException
("ClassNotFoundException: Reading Template Object From Translet File \"" 
            + file + "\" - " + cnfe);
        }
            
            return(templates);
            
    }   // End readTemplates

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

The exception is thrown at the statement "ObjectInputStream p = new 
ObjectInputStream(ostream);"

Is the class file created using xsltc command line not compatible with the jax 
api calls?

Reply via email to