Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting Apache 2.2 SOAP working with Weblogic 6.1 (pointing to a stateful session bean inside of an EAR)

0 views
Skip to first unread message

Michael J. Hudson

unread,
Jan 12, 2002, 12:56:48 AM1/12/02
to
I had the hardest time getting this all to work... but I finally have
it working! Since, there was a lot to it... I wanted to make sure I
wrote all of it down and posted it just in case anyone else out there
is going through the same troubles I went through.

Anyway.. this is what I did:

1) Download Apache 2.2 SOAP
2) If you're not already using SP2 with your Weblogic 6.1, then make
sure to go to BEA's website to download it (you have to be registered
it seems to get it). If you don't get SP2, more than likely you'll
get a servlet error java.lang.NullPointerException somewhere near
servlet.internal.ChunkOutput.clearBuffer.
3) Go to webapps directory and copy the soap directory there
somewhere where you can modify it.
4) Use this page as a reference
(http://xml.apache.org/soap/docs/install/weblogic60.html where it says
"Optionally configure the soap.xml")

a) Essentially, go to soap/WEB-INF/web.xml, and put the following
XML after each <servlet-class> tag:

<init-param>
<param-name>ConfigFile</param-name>
<param-value>..\soap.xml</param-value>
</init-param>

b) Then create a soap.xml file and put it in your main soap
directory. In that file put something like this in it:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Sample Apache SOAP Server Configuration File -->
<soapServer>
<!-- This section defines the same thing you get if you don't -->
<!-- specify anything at all - aka the default -->
<configManager value="org.apache.soap.server.DefaultConfigManager"
>
<option name="filename" value="DeployedServices.ds" />
</configManager>
</soapServer>

This helps facilitate the soap app persisting the deployed services.
Sometimes, it has trouble writing it out without these steps. Also,
it'll end up putting that persisted file (DeployedServices.ds) in your
main weblogic server directory (before the config/domain/applications
directory).

5) Now, another problem you'll probably get is the following SOAP
error:

A 'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must
contain a: 'faultcode' element.

This is caused by the Xerces.jar that Weblogic bundles up with 6.1.
To fix this, you need
to do the following (use this web page as a reference:
http://xml.apache.org/soap/faq/faq-for-WL6.1beta.html

a) Put your xerces.jar in the beginning of your classpath
(startWeblogic script). Should
probably be using xerces 1.4 or higher as well.
Your classpath setting will look something like this:
set CLASSPATH=E:\apache\xerces-1_4_0\xerces.jar;.\lib\weblogic_sp.jar;.\lib\weblogic.jar

b) Now, you need to set up an XML Registry in Weblogic. You can
either make
this change through Weblogic's web GUI or through the config.xml
file itself.

GUI:
Go to mydomain/Services/XML were 'mydomain' is the domain you're
using
Click on Configure a new XML Registry
Fill in the following values:
Name = Xerces JAXP
DocumentBuilderFactory =
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
SAXParserFactory = org.apache.xerces.jaxp.SAXParserFactoryImpl

The following values should already be at their default
Transformer Factory =
weblogic.apache.xalan.processor.TransformerFactoryImpl
When To Cache = "cache-on-reference"

Go to mydomain/Servers/myserver where 'mydomain' is the domain
you're using
Click on the "Services" tab followed by the "XML" tab
Select "Xerces JAPX" from "XML Registry" pulldown
Select "Xerces JAPX" from "XML Registry" pulldown

Config.xml:

Put the following in your config.xml:

<XMLRegistry
DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
Name="Xerces JAXP"
SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"
TransformerFactory="weblogic.apache.xalan.processor.TransformerFactoryImpl"
WhenToCache="cache-on-reference"/>

Then add this Attribute to the <Server> tag:
XMLRegistry="Xerces JAXP"

This should fix the faultcode problem as well as have Weblogic using
the JAXP standard interface that's found in the new xerces rather than
Weblogic's old bundled version of xerces.


6) Now, at this point... you'd think that everything would work. But
if you have your application in an EAR file, AND the SOAP deployment
descriptor you have points to a stateful session bean that's inside
your EAR file... well, there's still more you need to do.

a) First of all, don't put the SOAP.jar in your classpath
b) put the SOAP.jar in your EAR file (at the same level as your
EJBs... probably root level)
c) Wrap up the whole soap directory into a WAR file.
d) Include a manifest file in your WAR file... but make sure not to
call it "Manifest.mf" with a capital M. This messed me up originally
and will not work. I called mine "dependancy.mf" and used Ant's
manifest attribute in it's 'war' task to include the manifest file.
Now, in the manifest file put the following in it:
Class-Path: soap.jar
This ensures that your SOAP.WAR can point to the soap.jar that lies
outside of the WAR but still inside the EAR file. The soap.jar file
needs to be at the same level as your EJBs... so, that it nows how to
get a hold of the home interface to your stateful (or stateless)
session bean. And the SOAP.WAR stuff of course needs the classes in
soap.jar... and the only way to do that... is to have your manifest
file reference it.
e) Now, finally include your SOAP.WAR file in your EAR file.
f) Ensure that your SOAP.WAR is declared in your EAR's
application.xml file

7) Run your weblogic installation that points to this EAR file.
Create your SOAP deployment descriptor (read Apache's documentation on
that) and deploy it appropriately using Apache's deployer:

java org.apache.soap.server.ServiceManagerClient
http://localhost:7001/soap/servlet/rpcrouter deploy
DeploymentDescriptor.xml

8) And finally, everything should work. Swooo...

Like I said... I just want to make sure that I captured everything I
basically ended up having to do (after a ton of trial and error and
web research). This was tons easier with Weblogic 5.1 as well as
pre-EAR packaging!!it

0 new messages