AppServerGuide has been edited by Alec LaLonde (Nov 27, 2007).

(View changes)

Content:

Application Server Specific Configuration Guide

This document provides app server-specific configuration information for running Apache CXF.

JBoss

If you package the war in the ear, you might need to add the jboss specific file (jboss-app.xml) in the $EAR/META-INF folder to config the classloader.

<?xml version="1.0" encoding="UTF-8"?>
<jboss-app>
	<loader-repository>
		apache.cxf:loader=spring_http.ear
		<loader-repository-config>
			java2ParentDelegation=false
		</loader-repository-config>
	</loader-repository>
</jboss-app>

If you are coming across LinkageErrors involving the QName class, try repackaging the stax-api jar without the javax.xml.namespace.QName class.  (In JBoss 4.0.5GA at least) a conflicting version of this class is included in JBoss's lib and lib/endorsed directories.  This was the only way I could get CXF working in my environment.



WebLogic

There are two ways to deploy a CXF WAR archive in WebLogic. (Note: This has been validated on WebLogic9.2.)

Put jars in endorsed folder

  • Put the geronimo-ws-metadata_2.0_spec-1.1.1.jar in the $Weblogic_Home/jdk_../jre/lib/endorsed folder.
  • Deploy the CXF war in weblogic.
    (This way is not recommended, since it might break the application server itself. )

Pack war in an ear, deploy the ear with weblogic-application.xml

  • Create a standard J2EE application.xml file in the META-INF folder. (Take $CXF_HOME/samples/java_first_spring_support for example)
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC
    		"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    		"http://java.sun.com/dtd/application_1_3.dtd">
    <application>
    	<display-name>spring_http</display-name>
    	<module>
    		<web>
    			<web-uri>spring_http.war</web-uri>
    			<context-root>spring</context-root>
    		</web>
    	</module>
    </application>
  • Create a weblogic-application.xml (Weblogic specific) in the META-INF folder.
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90">
    	<application-param>
    		<param-name>webapp.encoding.default</param-name>
    		<param-value>UTF-8</param-value>
    	</application-param>
    	<prefer-application-packages>
    		<package-name>javax.jws.*</package-name>
    	</prefer-application-packages>
    </weblogic-application>
  • Run "jar cvf ..." command to create the ear and then deploy it.

    This is the recommend way to deploy since it only impacts a single module.

Websphere

Currently, I've only found the endorsed way to make cxf work with websphere. (Note: this has been validated against Websphere6.1.0.0)

put jar in the endorsed folder

  • put the wsdl4j-1.6.1.jar in the $WebSphere_HOME/java/jre/lib/endorsed folder.
  • In the WebSphere console, find the specific enterprise application, click the "Class loading and update detection".
    • Mark the "Classes loaded with application class loader first" selected.
    • Mark the "Class loader for each war file in application" selected.

And then restart the Websphere server. (Because we changed the endorsed folder, we need to restart it to make it effect).

Please make sure your classpath doesn't have the servlet-2.5 library, since WebSphere6.1 is servlet-2.4 compliant!

OC4J

I got CXF working in OC4J by ignoring Oracle's XML parser and adding the Xerces parser libs as shared libraries, and by performing the QName hack above.

Resources

Utilizing the OC4J Class Loading Framework
Deploy XFire in WebLogic
Understanding WebLogic ClassLoader
JBoss Class Configuration

Reply via email to