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

Still Springing Along

July 16th, 2008 dan Posted in Spring, WebSphere Application Server No Comments »

I’m still solidly in the spring domain with my solution. I’ve run into a number of obfuscated exceptions as I’ve gone along way my from Spring newbie to Spring intermediate newbie. They’re all nicely saved in my WebSphere Application Server log, so once I get some free time, I’ll go through them all with the solutions I encountered.

So far in Spring, I have:

Currently, I’m wrestling with Oracle’s DBMS_CRYPTO package (calling Encrypt(..) with a BLOB or RAW is fine, CLOB give me errors) and using CLOBs in Spring.

I’ve also run into a weird condition where I can’t republish to my WebSphere Application Server v6.1 anymore. I need to uninstall-reinstall.

I feel like I’m back on Process Server.

Related Posts

AddThis Social Bookmark Button

Spring + Oracle Database = Populating CachedRowSet produces SQLException: Invalid scale size

July 10th, 2008 dan Posted in Spring No Comments »

I have a simple table definition:

CREATE TABLE TABLE1 (

 	COL1 CHAR(3) NOT NULL,

 	COL2 VARCHAR2(28) NOT NULL,

                COL3 NUMBER)	)

I noticed that I get this error when I have a column of type ‘number’ created with default type. When I removed this column from the table, everything worked fine.

I have a number of columns which have a type of NUMBER. When the table was created they were not set a precision or scale value, so by default they are considered floating point numbers. When they are retrieved into my ResultSet, they are coming back with a scale of -127. As this is a negative, this affects the population of the CachedRowSet…

A thread from the sun forums addresses the potential workarounds that can be used.

Related Posts

AddThis Social Bookmark Button

Spring: ClassPathXmlApplicationContext File Lookup / Database Exceptions

July 10th, 2008 dan Posted in Spring No Comments »

Quick Tip: When you are trying to look up your xml Spring configuration file, ensure that you put the xml file into the build path source directory of your project. In my case, the ejbModule directory. I had it in the root of the EJB project and Spring (rightfully so) could not find it.

Also, one of the benefits of using the Spring framework is that you get back exceptions from databases that are actually relevant. Here, my J2C Authentication Alias is incorrect and I get back a nice Spring CannotGetJdbcConnectionException instead of just attempting to decipher what DSRA0010E: SQL State = 72000, Error Code = 1,017 means.

[7/10/08 11:31:01:171 EDT] 0000004c ExceptionUtil E

CNTR0020E: EJB threw an unexpected (non-declared) exception

during invocation of method "onMessage" on bean

"BeanId(LoggingEAR#LoggingEJB.jar#LoggingMDB, null)".

Exception data:

org.springframework.jdbc.CannotGetJdbcConnectionException:

Could not get JDBC Connection; nested exception is java.sql.SQLException:

 ORA-01017: invalid username/password; logon denied

DSRA0010E: SQL State = 72000, Error Code = 1,017

 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)

Related Posts

AddThis Social Bookmark Button

WebSphere Application Server and The Spring Framework

July 10th, 2008 dan Posted in Spring, WebSphere Application Server No Comments »

I’m in the process of skilling up on the spring framework used within the Websphere application server container. What I have amassed so far are a ton of links to various tutorials and developerWorks articles that answer a few questions:

  1. What is Spring?
  2. Why do I want to use it?
  3. How do I use it?
  4. How do I use it such that the WebSphere Container can manage connections to resources?
  5. How do I control transactionality?

My links so far:

  1. Using Spring and Hibernate with WebSphere Application Server
  2. Enterprise Java Community: Introduction To The Spring Framework 2.5
  3. The Spring Framework - Reference Documentation
    1. Chapter 11. Data access using JDBC
  4. Asynchronous Messaging Made Easy With Spring JMS
  5. The Spring Framework Forum
  6. A Primer on Spring’s Data Access Object (DAO) Framework
  7. ZK Spring DAO Example
  8. Twelve Best Practices for Spring
  9. Develop Spring applications for WebSphere Application Server Community Edition, Part 1: Spring MVC
  10. Spring and WebSphere – fish and chips, or fish on a bike?

Luckily, my scenario is relatively straight forward, I get a message from a queue and then need to persist it into a database without any need for transformation.

I took a brief look at Spring JMS for the message listener, but the documentation confused me. There is an attribute that states how long Spring will wait for a message to arrive. In my case, I want it to behave like a listener “Stay up forever”. So I don’t understand if Spring can be used with activation specifications or not.

For a while, I got confused by the ‘DAO’ pattern. I kept thinking that it was the equivalent of a Process Server Business Object (ie just contains data) but it’s really more of “the object that controls serialization to the back end”. I’m also viewing Spring as a framework that initializes classes based on information contained in an XML file.

I find that it’s harder to understand the benefits of Spring when working inside the application server. WAS already has all of this abstraction contained via JNDI lookups.

Anyway, I’m still ramping up the Spring learning curve, so take anything I say about how it works with a huge grain of salt. I’m likelier to be wrong than right.

Related Posts

AddThis Social Bookmark Button