You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Michael Shapiro <mi...@creativescience.com> on 2000/07/21 12:18:32 UTC

Possible bugs in StylesheetRoot serialization

While porting my application from XALAN-J 1.0.3 to XALAN-J 1.1 I found that
stylesheet serialization doesn't work.

To reproduce the erroneous behavior try the following:

java org.apache.xalan.xpath.Process -XSL anyValidXsl.xslt -LXCOUT
anyValidXsl.lxc

The result:

========= Parsing file:/E:\XALANbugs\anyValidXsl.xslt ==========
Parse of file:/E:\XALANbugs\anyValidXsl.xslt took 1172 milliseconds
Error! org.apache.xalan.xpath.xml.StringToStringTable
Xalan: was not successful.
XSLProcessor: done

Making StringToStringTable class Serializable solves the problem.

Test environment:
1. NT 4.0 JDK 1.1.8
2. NT 4.0 msjava.dll 5.00.3240
Results are identical for both environments.

Another problem (also in 1.0.3) is IllegalAccessException while reading lxc
file.
This happens because the base class org.apache.xalan.xslt.UnImplNode doesn't
have a public no-arg constructor .
It only happens in msjava environment but in this case msjava is simply
following SUN's Java documentation:

"To allow subtypes of non-serializable classes to be serialized, the subtype
may assume responsibility for saving and restoring the state of the
supertype's public, protected, and (if accessible) package fields. The
subtype may assume this responsibility only if the class it extends has an
accessible no-arg constructor to initialize the class's state. It is an
error to declare a class Serializable in this case. The error will be
detected at runtime. "

Making the constructor for UnImplNode public solves the problem.

- Michael Shapiro