Google App Engine java.lang.NoClassDefFoundError for BasisLibrary

I’ve just started to experiment with the Google App Engine (GAE) using Java Servlets. To tell the truth I also wanted to play a little bit with the technology. The application is supposed to transform an XML with the help of an XSLT file. Has some authentication and authorization implemented. Reads from blob storage and google drive, sends emails and so on.

I deployed many times during the development and everything was working. Then I started to use xsl:params with the help of the transformer.setParameter method. Locally – of course – everything worked fine the whole time. After deploying it I got a 500 error. Checked the logs: java.lang.NoClassDefFoundError: com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary is a restricted class. Please see the Google App Engine developer’s guide for more details.

Fine I thought, and what can I do about it? This was library used by the Transformer internally. I find it really strange, that google restricts such classes. Anyway I ended up implementing this functionality on my own replacing the parameters as Strings. Nice hack. By the way you should use xsl:variable instead of params if you wanna make it work…

After that I had another problem: ConfigurationException: Translet class loaded, but unable to create translet instance.
Oh my god… I thought. But luckily I’ve found a solution here.
From here you have to go to the Xalan download area. Interestingly enough the library didn’t change since 2007.

Advertisements

About Tamas Nemeth

Husband and proud father of two daughters in Nürnberg. I'm working as a Senior Software Developer and an enthusiastic Clean-Coder. I spend most of my free time with my family (playing, hiking, etc...). I also play table-tennis and badminton sometimes...
This entry was posted in Technical Interest and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s