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

IBM Client Application For JMS – Put JMS messages in queues

August 12th, 2008 dan Posted in Business Integration Tips, DeveloperWorks, WebSphere Application Server 2 Comments »

I had the need to be able to place a JMS Message onto a Service Integration Bus Queue. I tried to use the SIBus Explorer, but it really didn’t like my WebSphere v6.1 configuration and would always throw an exception.

I then checked out the IBM Client Application Tool for JMS pointed out to me by David Currie a few months ago. It’s actually really awesome. It does require an application server in order to reference jars that are required for the classpath, but if you have an install somewhere, this is a tool you will like.

Basically, you can connect to any remote WebSphere server and use JNDI to lookup JMS resources and create JMS messages. For my remote server the provider url is of the form:

corbaloc:iiop:<hostname>:<Server Bootstrap Port>

corbaloc:iiop:danhost:2809

There is one caveat: If you are looking up a connection factory on a remote machine, then the JMS connection factory will need to have it’s Provider Endpoint configured. By default, this value is blank which stands for ‘localhost’. If ‘localhost’ doesn’t host your bus then you will get connection errors. It follows the standard:

<host_name>:<SIBus Bootsctrap messaging port>:BootstrapBasicMessaging

danhost:7276:BootstrapBasicMessaging

Once you have set that up in the connection factory, restart your server and now the IBM Client for JMS will connect to the given connection factory. You can then connect to a queue and start putting messages on remote destinations.

Related Posts

AddThis Social Bookmark Button

Default Messaging (SIBus): Modifying JMS ConnectionFactory Provider Endpoints requires a server restart

August 11th, 2008 dan Posted in WebSphere Application Server 2 Comments »

Just a quick tip, if you need to modify a JMS ConnectionFactory’s Provider Endpoints in WebSphere Application Server, be sure to re-start your server. You normally need to perform this task when you are outside the application server hosting the queue and performing remote JNDI lookups.

I modified the value but always got the error that ‘localhost:7276:BootstrapBasicMessaging’ could not be found. Once I restarted the server, then my lookup used the proper endpoint of my remote server and everything was fine.

Related Posts

AddThis Social Bookmark Button

IBM APAR PK49507: PROFILE RECREATION Required!

August 4th, 2008 dan Posted in WebSphere Application Server 1 Comment »

In a case of something I have never seen before, it appears that PK49507: THE SIBUS RESOURCE ADAPATER WILL NOW INDICATE THAT AN MDB SHOULD BE STOPPED IF A CERTAIN NUMBER OF FAILURES ARE HIT actually requires you to recreate your entire server profile from scratch! It contains the statement:

This property will only be available for new activation
specifications in profiles created after this APAR has been
applied.

This makes the fix completely useless to anyone who actually uses a WebSphere server. The functionality? It adds a new property called ‘maxSequentialMessageFailure’ so that MDBs who use activation specs aren’t also completely useless in the rollback scenario.

All I want is to have this fix so that WebSphere can issue a ‘CWSIV0605W’ message which we can listen for to turn off the delivery of messages to the endpoint. If you can’t turn off the processing, then you have to deal with creating dead letter queues and have a process for putting message back on the queue when they are non-poison. This scenario is discussed further on Bobby Woolf’s Wiki.

I’ve never seen IBM release something called an ‘ifix’ that required you to create a completely new profile. I’m hoping that this is a misinterpretation from the support team. Unfortunately, I have verified with my two eyes that a server who has a preexisting profile and then upgraded does not see it.

Related Posts

AddThis Social Bookmark Button

The WebSphere Contrarian: Are you sure you want to reorg that messaging engine database?

July 31st, 2008 syndication Posted in DeveloperWorks, WebSphere Application Server No Comments »

From DeveloperWorks, The WebSphere Contrarian: Are you sure you want to reorg that messaging engine database?

The standard practice for database administration is to periodically
check on the database and table organization to insure optimal performance –
but do these standard practices apply to a database used for JMS persistent
message storage with IBM WebSphere Application Server? (IBM WebSphere Developer Technical Journal)

An interesting article about your messaging engines databases and how they are structured.

Related Posts

AddThis Social Bookmark Button

WebSphere 6.1 and Jakarta Commons Logging (JCL) using Log4J in an EJB

July 30th, 2008 dan Posted in Business Integration Tips, WebSphere Application Server 1 Comment »

In my solution, I am using Log4J inside an EJB. I created a log4j.properties file and put it on the classpath of my EJB. I created a file appender for some exception cases. When I ran my solution, I found that my file wasn’t being created. Upon further inspection, my log4j.properties file was not being loaded at all.

Google provided a lot of links to people complaining of the same problem with some wacky solutions. This is apparently a very easy problem to solve when you have a WebProject as the META-INF/lib directory goes directly into the classpath as the first resource. Files that are placed there get resolved first.

This logging issues seemed to be more prevalent in WebSphere v5 as most links were old and referring to that version of the runtime. I figured that this problem has something to do with the classloader and likely that I need to override something to get my own logger running instead of WebSphere’s.

Luckily, I ran across:

Integrating Jakarta Commons Logging which discusses the issues of the classloader and what you can do to get around it. It’s still focused on the v5 product.

Next, I somehow stumbled into the WebSphere v6 infocenter. The infocenter contains a great set of articles outlining exactly what you need to do to get your own log4j configuration working:

The summary is to drop a file named:

org.apache.commons.logging.LogFactory

into the

META-INF/services

directory in your EJB.

The file contains (on a single line):

org.apache.commons.logging.LogFactory
=org.apache.commons.logging.impl.Log4jFactory

Now the log4j.properties will be picked up from your applications classpath first!

Happy Logging!

Related Posts

AddThis Social Bookmark Button

IBM Software Support Lifecycle – General Availability, End Of Marketing, End of Support Dates

July 29th, 2008 dan Posted in WebSphere Application Server, WebSphere Business Services Fabric, WebSphere Enterprise Service Bus, WebSphere Integration Developer, WebSphere Message Broker, WebSphere Process Server, WebSphere Service Registry and Repository 1 Comment »

Planning that new WebSphere Process Server v6.0 GA production deployment? I suggest you check out the End Of Service Dates published by IBM for your versions to ensure that you aren’t painting yourself into a corner before you even start. Beware clicking that last link, it’s a poorly created web page with every single IBM product and revision; the worlds longest HTML ever.

End of Marketing: IBM stops actively selling it to customers

End of Support: IBM stops answering the phone when you call to complain about it. Of course, you can always enter into an extended contract to continue support of mission critical installations.

Quick links:

WebSphere

WebSphere Integration Developer

I tried to get other quick links but it was too frustrating with all the product versions inlined together.

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

Do not use forward slashes in SIBus Destination names with JMS

July 24th, 2008 dan Posted in WebSphere Application Server, WebSphere Process Server No Comments »

I have an SIBus destination called: ‘MY/QUEUE’.

I create a JMS QueueConnectionFactory and JMS Queue definition to this destination. jms/LoggingPoisonQueueCF and jms/LoggingPoisonQueue. When I attempt to put a message on the destination (using Spring JMS) I get the following exception:

org.springframework.jms.InvalidDestinationException:
CWSIA0046E: The parameter queue://MY/QUEUE?busName=SIBJMSBus
is from a foreign implementation that is not supported.;
nestedexception is javax.jms.InvalidDestinationException: CWSIA0046E:
The parameter queue://MY/QUEUE?busName=SIBJMSBus is from a foreign
implementation that is not supported.; nested exception is
javax.jms.JMSException: CWSIA0385E: It is not permitted for a
destination URI to specify a queue manager, as found in URI :
queue://MY/QUEUE?busName=SIBJMSBus
at org.springframework.jms.support.JmsUtils.
convertJmsAccessException(JmsUtils.java:261)

Digging deeper into the stack trace, the offending piece of code is found:

Caused by: javax.jms.JMSException: CWSIA0385E:
It is not permitted for a destination URI to specify a
queue manager, as found in URI :

queue://My/Queue?busName=SCA.APPLICATION.widCell.Bus
at com.ibm.ws.sib.api.jms.impl.URIDestinationCreator.
processURI(URIDestinationCreator.java:476)
at com.ibm.ws.sib.api.jms.impl.URIDestinationCreator.
createDestinationFromString(URIDestinationCreator.java:285)
at com.ibm.ws.sib.api.jms.impl.JmsFactoryFactoryImpl.
createQueue(JmsFactoryFactoryImpl.java:523)
at com.ibm.ws.sib.api.jms.impl.JmsDestinationImpl.
checkNativeInstance(JmsDestinationImpl.java:707)

This URIDestinationCreator is interpreting the string as the format

queue://<queue manager>/<queue_name>?<busName>

I poked around in vain in the infocenter and I think I found the article that describes the issue. Basically what happens with a destination URI that is ambiguous like this one (Am I referring to a queue names ‘Queue’ on QueueManager ‘My’ , or am I referring to a queue called ‘My/Queue’) is that WebSphere will just toss an exception.

When I tried to see if slashes were used anywhere in WebSphere Process Server, I was surprised to find that they were in the SYSTEM bus. I also noticed that JMS isn’t used by much except the BPEL engine. When the BPEL engine uses it, they use ‘.’ to separate components. I assume it’s because they also ran into this exception.

The workaround is to just not use forward slashes. The secondary workaround is to create aliases for your SIBus destinations sans slash.

Related Posts

AddThis Social Bookmark Button

Where’s that class being loaded from? – Which4J

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

I’d just like the tout the WHICH4J Project which has helped me immensely in my classpath confict issues with Oracle over LOG4J and JAXB.

Which4J is a small utility jar that can be added to your classpath and used via:

System.out.println("WHICH 4J: "
+ Which4J.which(JAXBContext.class))

Works fine with WebSphere Application Server

Related Posts

AddThis Social Bookmark Button

Log4J “NoSuchMethodError” for org/apache/log4j/Logger.trace(Ljava/lang/Object;)V

July 24th, 2008 dan Posted in WebSphere Application Server 2 Comments »

My application uses log4J and when I deployed to our development server, I was getting the following exception:

CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method “onMessage” on bean “BeanId(LoggingEAR#LoggingEJB.jar#LoggingExceptionMDB, null)”. Exception data: java.lang.NoSuchMethodError: org/apache/log4j/Logger.trace(Ljava/lang/Object;)V

At first, I believed that this was caused by Log4J not being on the classpath in ear. Upon further inspection, it’s not a ClassNotFoundException but a NoSuchMethodError.

I looked at the classpath of my EJB and discovered that oracle had installed it’s own copy of Log4J onto the server classpath and this older version did not have the trace() method.

Related Posts

AddThis Social Bookmark Button

Adding pre-built JAR files to your EAR in Rational Application Developer

July 23rd, 2008 dan Posted in WebSphere Application Server No Comments »

I have the following jars that I want to include on the classpath of my EAR:

  • jaxb-api.jar
  • jaxb-impl.jar
  • jsr172_1.0_api.jar
  • log4j-1.2.15.jar
  • spring.jar

For my Spring/JAXB/Log4J solution. I tried to look into the deployment descriptors to place prebuilt ears but I could not find it.

My solution was to open the MANIFEST.MF file inside the EJB project. You can add jars through the text editor.

My example:

Manifest-Version: 1.0
Class-Path: LoggingUtility.jar
spring.jar
jaxb-api.jar
jaxb-impl.jar
log4j-1.2.15.jar
jsr173_1.0_api.jar

Deploys and runs on WebSphere Application Server with no problem.

Related Posts

AddThis Social Bookmark Button

WebSphere Application Server: Non-Deterministic Error when configuring Default Messaging Activation Specs

July 23rd, 2008 dan Posted in WebSphere Application Server 2 Comments »

I’m in the process of moving an application from my test server to a development server. I started creating activation specifications for my MDBs. Everything was fine. Then I tried to start my ear and received the following exception:

The JMS activation specification has invalid values – the reason(s) for failing to validate the JMS activation specification are: [CWSJR1187E: The bus name on a JMS activation specification must be given a value]

To which I went back and fixed by specifying the bus (which isn’t a required property in the UI, but thats offtopic). When I went to start my ear again, I got the same exception again. I deleted and recreated my activation specs. One of the two worked fine. I waited a few more minutes and the other worked fine.

Not sure what happened there, but if you get this kind of error after you fix the issue, you may want to restart your application server.

UPDATE: This wasn’t a non-deterministic error. My node was non-clustered but managed and automatic sync was running in the background. I just wasn’t waiting enough time between my changes and the node syncronization.

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