Oracle XA_RMERR & Spring Oracle LOB Handler Exceptions

August 13th, 2008 dan Posted in Oracle BPEL, Spring, WebSphere Application Server No Comments »

Was getting the following oracle exception when trying to use an Oracle XA datasource from WebSphere:

WSRdbXaResour E
 DSRA0304E:  XAException occurred. XAException
contents and details are:
The XA Error is            : -3
The XA Error message is    : A resource
manager error has occured in the transaction branch.
The Oracle Error code is   : 65535
The Oracle Error message is: Internal XA Error
The cause is               : null.
[8/13/08 14:22:50:777 EDT] 00000066 WSRdbXaResour E
DSRA0302E:  XAException occurred.
Error code is: XAER_RMERR (-3).
Exception is: <null>

This led me to the standard “Oracle is not configured to support XA”. Alas, the admin ran the scripts and we continued to get it.

We were also getting

OracleLobHand E org.springframework.jdbc.support.lob.OracleLobHandler
$OracleLobCreator close Could not free Oracle LOB
java.sql.SQLException: Protocol violation

Then the version of the jdbc driver caught my eye:

InternalOracl I   DSRA8205I: JDBC driver name  : Oracle JDBC driver
InternalOracl I   DSRA8206I: JDBC driver version  : 9.2.0.1.0
InternalOracl I   DSRA8212I: DataStoreHelper name is:
com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper@218a218a.
WSRdbDataSour I   DSRA8208I: JDBC driver type  : ""

Notice that a very old 9i driver was in use connecting to our 10g database. I upgraded the driver to 10.2.0.3 and the problem was resolved.

Related Posts

AddThis Social Bookmark Button

Connecting to Oracle BPEL hosted on WebSphere Application Server 6.1 with JDeveloper

August 13th, 2008 dan Posted in Oracle BPEL, WebSphere Application Server No Comments »

Before I could do any of the steps below to invoke a REST service or install my BPEL suitcase, I needed to figure out how to connect JDeveloper to my application server. It’s not an obvious procedure.

  1. In JDeveloper, flip to the connections view.
  2. Create a new Application Server Configuration.
    1. Choose to create a Standalone OC4J 10g 10.1.3 Connection Type
    2. Enter your username and password to connect to the application server
    3. Enter the hostname
    4. For RMI Port, I had to use the port defined for ‘WC_defaulthost ‘ which was 9080. This part I don’t understand. I would have thought that 2809 was correct but it didn’t work. Take this step with a grain of salt.
    5. Click Test Connection. You should get back a warning that ORMI couldn’t be contacted. That’s ok, you can ignore it.
  3. Create a new Integration Server.
    1. Use the Application Server connection created above.
    2. Click Test Connection.
    3. Obtain the following result:
      “Application Server: FAILED
      BPEL Process Manager Server: OK
      ESB Server: FAILED”

You now have a connection to the Oracle BPEL contained inside of WebSphere. You can now right click your BPEL project and choose “Deploy” to install the app on the server.

Related Posts

AddThis Social Bookmark Button

Oracle BPEL ‘Suitcase’ JAR Deployment Options

August 13th, 2008 dan Posted in Oracle BPEL No Comments »

I had created a simple echoing BPEL process in my JDeveloper and then looked around for the option to export an EAR for my service. Of course, there isn’t one. What happens is that JDeveloper will create a JAR that contains your BPEL artifacts. This JAR is called the “BPEL Suitcase”. I assume it’s a suitcase because it’s a container for your BPEL like a suitcase is a container to your clothes.

You then need to follow this document that describes how to deploy your BPEL into the Oracle BPEL container. Basically it boils down to one of:

  1. Use JDeveloper to connect to your container and deploy.
  2. Use the Oracle BPEL Console to deploy your suitcase.
  3. Strangely enough, if you have access to the physical file location of the container you can just drop the suitcase jar into a specific directory.

I was surprised that the processes weren’t deployed as EARs to the application server.

Related Posts

AddThis Social Bookmark Button

Integrating Oracle BPEL with an HTTP (REST) Service

August 13th, 2008 dan Posted in Oracle BPEL, WebSphere Process Server No Comments »

Right out of the gate in my experience with Oracle BPEL, I have to integrate with a non-SOAP HTTP service. Luckily, Lucas Jellema over on the AMIS Technology blog has a very well written article that goes end to end on exactly what you need to do in order to get Oracle and HTTP (REST) Get to play nicely with each other.

I’d also like to add that Oracle themselves include an example as well in the documentation in section “702.Bindings”.

If I was in WebSphere Integration Developer v6.0.2.x, I’d have to write the custom invocation logic myself.

In WebSphere Integration Developer v6.1.x I can use the HTTP Import Binding.

Related Posts

AddThis Social Bookmark Button

javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package {0}

July 25th, 2008 dan Posted in Oracle BPEL, WebSphere Application Server 4 Comments »

In my solution, I use JAXB to convert from XML over the wire into Java objects. I added the JAXB jars to my ear (as previously explained). When I deployed and tested the solution on my local server everything was fine.

When I deployed and tested the solution on the development machine, which contains WebSphere Application Server and the Oracle BPEL container, it didn’t work and threw the following exception:

javax.xml.bind.JAXBException: Unable 
to locate jaxb.properties for package com.twc.logging

This exception is very strange because the xjc compiler that I use to generate the JAXB classes from an XSD definition doesn’t generate a ‘jaxb.properties’. A search on google turned up?
the JAXB FAQ :
A thread on the sun java forums

The JAXB FAQ contains instructions to set the appropriate classloader so that the file can be found. I did this but it didn’t resolve my problem.

As I continued to scour the internet, it was strongly hinted that this was a required properties file in version 1.0 but is not present in 2.0. I decided to fire up my new best friend, Which4J to figure out which classloader was picking up the JAXB classes.

Sure enough, it turned out that there was an implementation of JAXB contained inside an oracle jar called ‘xml.jar’. Of course, the oracle container installed itself in the system classloader, so all of it’s jars are always on the classpath of all applications all the time. This means that no application that exploits JAXB 2.0 can be installed on the server.

We have a ticket open with oracle.

And since I’m on the topic of JAXB, the Unmarshaller is NOT thread-safe. I tried to save a line of code by storing it as a static reference in my class until my colleague pointed that fact out to me.

Related Posts

AddThis Social Bookmark Button

Oracle DBMS_CRYPTO Encryption

July 22nd, 2008 dan Posted in Oracle BPEL, WebSphere Process Server 2 Comments »

I spent a few days battling the oracle DBMS_CRYPTO package. This package allows the encryption of data types, including clobs and blobs (in oracle 10g). The battles included:

  1. My user not having visibility to the package in the stored procedure call. This was solved by a simple call to the DBA.
  2. In my system, I was trying to encrypt a CLOB. According to the oracle docs the function signature is:
    dbms_crypto.encrypt(
    
    dst IN OUT NOCOPY BLOB,
    
    src IN     CLOB CHARACTER SET ANY_CS,
    
    typ IN     PLS_INTEGER, key IN RAW,
    
    iv  IN     RAW DEFAULT NULL);

    To which I wrote:

    outputBlob := dbms_crypto.encrypt
    (outputBlob, myClob, myRawKey, myCryptoFormat, null)

    To which oracle told me:

    Error(13,15): PLS-00306: wrong number
     or types of arguments in call to 'ENCRYPT'".

    Now what is mischievous about this error is that it’s not actually the arguments of the function that are wrong, it’s the fact that I’m trying to set the output of the call back into outputBlob.

    dbms_crypto.encrypt(outputBlob, myClob,
    myRawKey, myCryptoType, null)

    Is the proper call. I wish that the compiler was better as telling me that. I’m assuming that because a parameter is an IN OUT I shouldn’t be trying to set the output value the way I was.

  3. When I tried to first invoke the stored procedure, I got:
    ORA-01405:	fetched column value is NULL

    Which basically said that the output BLOB needs to be initialized. I initialized the value to EMPTY_BLOB.

  4. When I then to invoke the stored procedure, I got the following error:
    ORA-22275:invalid LOB locator specified"

    Apparently EMPTY_BLOB is no good. I google’d around for a while and found:

    DBMS_LOB.CREATETEMPORARY(encrypt,true);

And finally it worked and returned me an encrypted BLOB! Props to the power of the internet for providing the chain of solutions that got my stored procedure up and running.

Related Posts

AddThis Social Bookmark Button