Friday, May 12, 2006

WebLogic and Axis

Ever tried using Axis for webservices in WebLogic environment and have all sort of weird axis fault?

Well, I was using Axis 1.2.1 on WebLogic 8.1 sp5 and having this Axis fault. After trying to debug for a while, I finally went back to the Axis installation instruction and sure enough, there on the last part of step 2 I found my solution.

The information is there, on the Axis docs. It's knowing which one will bring you solution is another. You may think everything is alright and just wondering why Axis throwing faults when it should've been fine. The first thing to do in most cases is nail the basic first. Run HappyAxis and makesure everything is what it should. If everything is okay then you can move on to the next without having to worry about these basics without making mere assumptions.

My problem was as they said: "WebLogic 8.1 ships with webservices.jar that conflicts with Axis' saaj.jar and prevents Axis 1.2 from working right out of the box. This conflict exists because WebLogic uses an older definition of javax.xml.soap.* package from Java Web Services Developer Pack Version 1.0, whereas Axis uses a newer revision from J2EE 1.4."

The solution suggested was two options of configuration changes (http://ws.apache.org/axis/java/install.html):
  1. In a webapp containing Axis, set element in WEB-INF/weblogic.xml to true.
  2. In a script used to start WebLogic server, modify CLASSPATH property by placing Axis's saaj.jar library in front of WebLogic's webservices.jar.
In my case, option 1 for some reason wasn't too helpful. It was already set and the needed jar files are in the classpath. So I went for option 2, and making sure that the jar files needed are first in line.

No comments:

Post a Comment