Archive

Archive for the ‘linux’ Category

Apache CXF Linux Deployment

April 11th, 2011

A short reminder of small issues I had with deploying Apache CXF web service I built on linux server (CentOS in my case):

yum install tomcat5 went really well :) and then I had to add webapps and manager packages with separate commands.

tomcat5 package depends on jdk-1.4 so in case you haven’t already installed a more recent version of java you’ll get this one.

I used the tutorial from http://www.jroller.com/gmazza/entry/web_service_tutorial to set up the options for deploying to tomcat using maven and that went well, but jdk-1.4 was causing spring context loader to throw:

SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org.springframework.core.CollectionFactory
at java.lang.Class.initializeClass(libgcj.so.7rh)
...

and the actual error displayed when I tried to access the service from the browser was:

threw exception javax.xml.transform.TransformerFactoryConfigurationError:
Provider org.apache.xalan.processor.TransformerFactoryImpl not found  at
javax.xml.transform.TransformerFactory.newInstance(Unknown Source)  at
org.apache.cxf.helpers.XMLUtils.newTransformer(XMLUtils.java:118)

This was solved by installing open-jdk 1.6 devel package with yum, but then another, trickier error appeared:

java.lang.NoClassDefFoundError: org/apache/xml/serializer/OutputPropertiesFactory
at org.apache.xalan.templates.OutputProperties.(OutputProperties.java:82)
at org.apache.xalan.transformer.TransformerIdentityImpl.(TransformerIdentityImpl.java:86)
...

At several links (here and there) I figured it out that it has something to do with xalan.jar which was unavailable to my service deployed on tomcat. A command:

yum list xerces* xalan* | grep installed

showed that I already had xalan-2.7.1 in my /usr/share/java so I tried with copying it to CATALINA_HOME/common/endorsed but that didn’t fix the problem. I also tried symlinking xalan.jar to that file but that didn’t work either.

In the end, at the link which appeared to be some forum’s archive I found that someone had problems similar to this and was advised revert to xalan-2.6 version. I’ve tried with jar in http://archive.apache.org/dist/xml/xalan-j/binaries/xalan-j_2_6_0-bin.zip and it worked.

Yeee “me happy” :)

Share/Save/Bookmark

Java, Links, linux , , ,