Oracle WebLogic server 12c + Apache-CXF JAX-WS + Packaging WAR as EAR

In this article, we will learn and understand issues while deploying JAX-WS based SOAP Web Service’s WAR packaging into Oracle WebLogic 12c server and their workaround

Note: Example demonstrated to create EAR package is based on the article Apache-CXF-top-down-approach. So for other examples, dependencies in pom.xml and application.xml & weblogic-application.xml needs to be modified accordingly

1. Issues :

Deploying JAX-WS service into WebLogic server as WAR package won’t work as expected, because WebLogic’s in-built JAX-WS API takes their precedence over packaged jars into the WAR file

To overcome the above issue, we need to package this WAR file into an EAR file and then deploy it into the Oracle WebLogic server as EAR package

2. Workaround :

Pre-requisite: WAR packaging is successfully built and installed in our local maven repository –> this will ensure we know maven co-ordinates to add this WAR as dependencies in EAR project

For this example, local maven co-ordinates is


3. EAR Packaging :

Steps to be followed to package WAR file into an EAR file

  • Create a java project (structure as shown below)1_ApacheCXF-JAX-WS-EAR-App_initial_structure_screenshot
  • Add below contents to pom.xml with WAR as dependency and also add their JAR dependencies


<project xmlns=""
	<dependencies> <!-- add WAR as dependency to this EAR packaging -->
		</dependency> <!-- apache cxf jax-ws 3.0.2 -->
		</dependency> <!-- spring framework 4.1.0 -->
	<build> <!-- final ear name -->
		<finalName>ApacheCXF-JAX-WS-EAR-App</finalName> <!-- maven ear plugin -->
  • This application.xml contains information about different types of modules like JAR or WAR as part of EAR packaging
  • For this example, we have got just one WAR module


<?xml version="1.0" encoding="UTF-8"?>
<application xmlns=""
	xmlns:xsi="" version="1.4">
  • This weblogic-application.xml tells the Oracle Weblogic server container to use jar libraries packaged within this EAR application, overriding in-built weblogic’s JAR modules


<?xml version="1.0" encoding="UTF-8"?>
		<!-- <wls:package-name>javax.jws.*</wls:package-name> -->
  • Package structure after “mvn install” (Eclipse package explorer view)


  • This article demonstrated a simple example on how to package WAR file into an EAR application, where we got just one WAR module to be packaged into an EAR
  • This can be expanded for a large enterprise application which could be possibly got more modules like JAR, WAR & EJB as part of our EAR application

Related Articles :

Happy Coding !!
Happy Learning !!

JAX-WS: Known Behavior or issues w.r.t Oracle WebLogic server
Apache CXF JAX-WS: SOAP based Web Service using Top-Down approach + Integrating with Spring & Hibernate ORM framework