Wednesday, June 02, 2010

Running Saxon HE on Google App Engine

(Modified. Thanks to Archie Cobbs for the tip)

About a year ago I tested Saxon B version 8 on the Google App Engine. This worked (and still works) perfectly. You can implement XSLT 2.0 and XQuery on Google's hardware.

Later on, Saxon moved to version 9 and the naming changed. I tried the Home Edition on the App Engine and got the following error:

java.lang.SecurityException: SHA1 digest error for net/sf/saxon/s9api/SaxonApiException.class

Usually I think this should mean that the SHA-1 key is invalid. (I'm not exactly an expert on the subject of security). The easiest way around this error it to remove some files from the /META-INF of the saxon9he.jar file. If you remove SAXONICA.SF and SAXONICA.RSA and upload the file again, the library works.

[...]removed[...]

I Googled for the error message and there seems to be another App Engine project with the same error: the Vosao CMS. They say they fixed the error. I checked and yes: they also just removed the SHA-1 files from the JAR...


[...]removed[...]

As noted in a comment by Archie Cobbs, the cause of this problem could be the JAR precompilation feature of the App Engine. This means that signing JARs does not work in general unless you turn off precompilation. This is a security vs. performance trade-off.

2 reacties:

Archie Cobbs said...

I think this problem occurs for all signed JARs with GAE's new precompilation feature:

See this thread.

Adriaan de Jonge said...

Thanks for the explanation and the link!

I'll edit the post this weekend to reflect this information!

Adriaan.