Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<?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.)

...

  • Create a standard J2EE application.xml file in the META-INF folder. (Take $CXF_HOME/samples/java_first_spring_support for example)
    Code Block
    xml
    xml
          <?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.
    Code Block
    xml
    xml
        <?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.
    Tip

    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)

...

Tip

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