Deploying static content and java web services to Weblogic 9.2

Ramkumar Menon
Director, Product Strategy

I had a simple BPEL on Weblogic install - and was looking for a place to host some static XML content on the server. On OC4J, it was simple - just dump the content in the appropriate directories under htdocs, and you are done.

In a simple WLS install like the one I have, it doesn't work that way.

So I created a simple Web Project, added all my XML contents into it, and deployed the ear file into WLS, just like any J2EE application. Here you go - you can now access all the hosted content at the contextURI that you specified at deployment time!

Well, I use JDeveloper - and needed to create and deploy a simple Java Web Service into WLS. I tried using the standard deploy-to-weblogic app server connection - but alas! - I ran into some deployment issues while deploying JWS from JDev to WLS 9.2. The same error repeats if I pick up the ear file and deploy it directly from the WLS admin console.

But hey, there was a simple way to get it done.

Just use the WLS service generation build scripts - it will do the job just as well.

Here is a snippet of the build script that I used to deploy my WS onto WLS.

<project name="BuildHelloWorldService" default="ear">

<target name="ear">

<servicegen destEar="ears/HelloWorldService.ear" warName="HelloWorldService.war" contextURI="hello">


<pathelement path="${java.class.path}" />

<pathelement location="D:\oraBPEL\bpel\lib\orabpel.jar"/>

<pathelement location="D:\oraBPEL\bpel\lib\xmlparserv2.jar"/>


<service targetNamespace="http://xmlns.hello.com/"










Note that servicegen is an 8.1 release ant task. WLS 9.2 has updated ant tasks that you can leverage to build services from your java classes. I used it only for my local testing.

You can find detailed information on useful ant tasks for service generation, client stub generation and others on the WLS 9.2 documentation page.


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.