Rational Application Developer Web Project Basic Authentication Configuration: Security Editor

October 7th, 2008 dan Posted in Business Integration Tips No Comments »

If you are trying to force basic authentication to your web project resources in Rational Application Developer v6.1, ensure that you explicitly specify ‘BASIC’ as your authentication mechanism in the RAD Security Editor.

If you do not, you can get yourself into a weird situation where defaults on one application server cause your basic authentication to work, while defaults on another server cause your application to never authenticate.

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 No 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

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

ANT & Building an EJB with the JAR task: ClassNotFoundException

July 29th, 2008 dan Posted in Business Integration Tips No Comments »

Just a quick note. I was trying to build my EJB using ANT and the JAR task and when it ran, I was getting ClassNotFoundExceptions for my utility jars that should have been on the classpath.

<jar jarfile="${ejb-classes.dir}/EJB.jar" 
      basedir="${ejb-classes.dir}"" />

The reason is that the manifest file that existed in the directory was being overwritten by ANT. You need to specify the

manifest

attribute:

<jar jarfile="${ejb-classes.dir}/LoggingEJB.jar" 
      basedir="${ejb-classes.dir}" 
manifest="${ejb-classes.dir}/META-INF/MANIFEST.MF" />

Related Posts

AddThis Social Bookmark Button

XML Schema (XSD) to Database Definition Language (DDL) Generator?

July 9th, 2008 dan Posted in Business Integration Tips 2 Comments »

For the life of me, I can’t seem to find a simple tool that will allow me to generate a DDL from an XSD definition. I’ve checked out XML Spy, StylusStudio and even the entire suite of Rational Products (Rational Software Architect & Rational Data Architect). It seems like this option was present in older versions but I can’t find it in v7.0.

Sigh. I guess I’ll just use a utility to connect to the database and create the tables and then extract the DDL.

Related Posts

AddThis Social Bookmark Button

BPEL: Beware the use of nested loops in a short running process

July 3rd, 2008 dan Posted in Business Integration Tips, Design Decisions, WebSphere Business Events, WebSphere Integration Developer, WebSphere Process Server No Comments »

One of the restrictions when dealing with a short running process is that it must always run within a single transaction. The implication is that the process must complete within the default transaction timeout window. On an application server, this is 120s.

We had an issue where our Process Server was creating a large number of locks to rows on the SQL Server table. Eventually, SQL Server escalation would kick in and the entire table would lock. This would preclude other users of the database from being able to read/insert data.

Upon inspection of the offending process, we found that a short running process contained three nested loops which performed multiple invocations against the SQL server database. On the original test data, there weren’t enough nested objects created to determine if a large object could complete within 120s.

In addition, by default in WebSphere Application Server there are 10 activation specs that can process messages from a queue in parallel. This means that you need to ensure thete are enough database connections to service the requests.

Our solution to the problem was to break the transaction down into smaller parts and transmit the parts via JMS queues to new modules. A one-way invocation does not require the source bpel to block for a response, so it is able to now complete within the transaction timeout boundary.

Related Posts

AddThis Social Bookmark Button

WebSphere Adapter for JDBC Export and SQL Server 2000: Table Locking while Polling

June 24th, 2008 dan Posted in Business Integration Tips, WebSphere Enterprise Service Bus, WebSphere Process Server No Comments »

A technote was published for customers who use the WebSphere Adapter for JDBC for inbound processing of an SQL Server 2000 database. Apparently, the adapter will lock the entire event table (bad!).

The ‘fix’ aka workaround is to use a view to the event table and then set a custom property inside the adapter.

Related Posts

AddThis Social Bookmark Button

SOA integration: Decouple service consumers from service providers over an ESB

June 20th, 2008 syndication Posted in Business Integration Tips, DeveloperWorks No Comments »

From DeveloperWorks, SOA integration: Decouple service consumers from service providers over an ESB
Develop an integration solution composed of business and mediation modules. In this tutorial, you deploy the scenario to IBM WebSphere Process Server V6.1. The scenario involves the IBM WebSphere Adapter for Flat Files V6.1 for inbound delivery and IBM WebSphere Service Registry and Repository V6.1 to implement a dynamic Web service lookup.

Related Posts

AddThis Social Bookmark Button

The Support Authority: A systematic approach to problem solving

June 19th, 2008 syndication Posted in Business Integration Tips, DeveloperWorks No Comments »

From DeveloperWorks, The Support Authority: A systematic approach to problem solving
Problem determination is not an exact science, but it's also not rocket science. A methodical approach will help your problem solving techniques become more organized, systematic, and, ultimately, more effective. (IBM WebSphere Developer Technical Journal)

Related Posts

AddThis Social Bookmark Button

WAS: Resolution to Messages in the SIB locked forever

June 17th, 2008 dan Posted in Business Integration Tips, WebSphere Enterprise Service Bus, WebSphere Process Server 1 Comment »

In a cluster where the messaging engine has failed over between nodes, a situation could arise where the transaction log (‘tranlog’) has become corrupt or is unrecoverable. In this situations, you may see messages on SIB Queues that are in the LOCKED state but are unprocessed. If you factor in a sequential delivering of messages, we may see that the queue refuses to process any messages at all.
In this case, we have to look at the SIB Data store and run the following query:

select count(*) from sib000 where XID is not null

if you discover existing values in XID you should update XID field to null:

update sib000 set xid = null where xid is not null

This situation would only occur if the ‘tranlog’ on a server was unrecoverable and should not be considered a ‘normal’ step of server recovery or server startup.

Related Posts

AddThis Social Bookmark Button

WebSphere Application Server: -recovery flag

June 17th, 2008 dan Posted in Business Integration Tips 2 Comments »

If you have a server that crashed without a clean shutdown, you may have transactions that are in progress and need to be recovered. In development, you would likely jusy delete the tranlog. On a production machine, you will likely need the following useful command line option when starting your server:

startServer <server> -recovery

This is the preferred way to clear any in-doubt transactions. It will start the server, allow you to recover transactions and then shut it down again. Once the in-doubt transactions are resolved, the following normal start of the server should be clean.

Related Posts

AddThis Social Bookmark Button

Tip: WebSphere Process Server – Do not delete the ‘tranlog’ on a production server

June 17th, 2008 dan Posted in Business Integration Tips, WebSphere Enterprise Service Bus, WebSphere Process Server 5 Comments »

In development mode, one of the steps to ‘clean up’ from a wonky process server instance is to delete the wstemp, temp directories along with the ‘tranlog’. The ‘tranlog’ is an internal file that WebSphere Application Server uses to manage in-flight transactions and attempt to recover them should the server crash. When you delete the tranlog, you remove this information from process server’s memory. At development time, your transactions are transient, you don’t really care if they complete or not, a new one can be created at any time.

On a production server, though, each transaction should be considered an extremely precious resource that can’t be deleted. Therefore, the tip that some of us use to delete the tranlog should NEVER be done on a production server. Removing it may lead to an inconsistency in your production database which may be unrecoverable.

Related Posts

AddThis Social Bookmark Button

WebSphere Integration Developer: Struggling with the Business Object Mapper

June 2nd, 2008 dan Posted in Business Integration Tips, WebSphere Enterprise Service Bus, WebSphere Integration Developer, WebSphere Process Server 1 Comment »

I had a custom snippet in my map between two string attributes and a list of business objects. The idea being that each string from the source should becomes an entry in the business object list with a wrapper.

No problem. I wrote up the snippet to create the destination business object (since it does not get initialized for you), added my wrapper data objects to my list. Everything looks good. I have “Print to Log” (aka system.out) to look at my resultant business object and it looks perfect.

Except when I run it, the List doesn’t get populated.

The key to my problem was how I was running it. You can’t test a business object map on its own, it’s always a part of some grander module ecosystem. In my case, it was a mediation flow component wedged between two XSLT transforms.

What I discovered was that it was a missing map in my XSLT that caused my list to remain null. The business object map was fine the entire time.

What’s the story? Remember that there are some components that you cannot test in complete isolation.

Related Posts

AddThis Social Bookmark Button

Tracking down a deadlock in a WebSphere Application Server V6.1 application

May 30th, 2008 syndication Posted in Business Integration Tips, WebSphere Process Server No Comments »

From DeveloperWorks, Tracking down a deadlock in a WebSphere Application Server V6.1 application
Learn how to use the thread dump facility in IBM WebSphere Application Server V6.1 to learn about your system environment, investigate whether a deadlock is happening, and extract information to help you avoid or resolve deadlock situations with your own applications.
It's easier to pretend that WebSphere Process Server isn't built on WebSphere Application Server and think that you don't need to know this. But normally when your server gets really broken, you have to perform WAS level debugging. Having this knowledge helps smooth the process.

Related Posts

AddThis Social Bookmark Button

Business Object Maps and ‘Required’ Attributes

May 28th, 2008 dan Posted in Business Integration Tips, WebSphere Enterprise Service Bus, WebSphere Integration Developer, WebSphere Process Server No Comments »

Just ran into an interesting scenario. We have a business object with a required attribute (amongst a sea of non-required ones). In a business object map, we only set the non-required ones and never set the required ones to any value.

In the above example, ‘productStatus’ is required, ‘name’ is not.

This is the Mediation Flow Component that my response flow is using. The map is being called via a Custom Mediation and then it gets passed onto an XSLT. This XSLT just adds some header information into the body of the message and match maps the business data from source to target.

When the response is serialized via a SOAP/HTTP we see the following XML:
<product> <name>ADSL</name> <productstatus></productstatus> </product>
Which is correct. The name field is populated from the BO Map and the productStatus field is present because it is required.Now, an interesting thing happens when we change the XSLT in the response MFC to a Message Element Setter. Now when the message is serialized, we get:
<product> <name>ADSL</name> </product>

‘productStatus’ is not present in the serialized message. Well that’s a no-no. A strict Web Service client would not be able to consume this response object.

So what happened to our required element? Simply, the XSLT transformation engine is smart enough to realize that ‘productStatus’ is required and the match map creates the element for us. The MessageElementSetter primitive assumes that the business object is already valid, so it doesn’t populate required fields.

What surprises me is why the Business Object Mapping runtime does not:

  1. Give me some kind of visual indication in the main editor that a field is required
  2. Set required elements to “”, given that they are required in order to serialize a valid message

So watch out when you are dealing with business object maps that your required elements are set properly. If you don’t, you can ‘catch all’ the missing elements using the XSLT primitive.

Related Posts

AddThis Social Bookmark Button