BrokerDate errors javalangNoClassDefFoundError

Here is the error:

java.lang.NoClassDefFoundError: COM/activesw/API/client/BrokerDate

Here is what happened:

Attempted to map a Date object retrieved from a database table into a Unicode String. Got the error. Repeatedly. And then after 36 or 37 permutations, I decided to take matters into my own hands.

Here is the work-around:

Create a Custom Code step which accepts the Date object as the input and returns a Unicode String. Using the BrokerDate API ([Server_Home/java_api/COM/activesw/API/client/BrokerDate.html), call the toString() method.

String dateString = new String(DATE.toString());
Return this string and use it as the variable to map into the Unicode String.

Here is the code that the webMethods adapter generated in my script that threw the error:

  in.step1.GMT_TIME = convert.toString(inputStep.GMT_TIME);

Hope this helps somebody, somewhere, sometime. I spent waaaaay too much time on this for this thread to go unread.

I encountered this error with the BrokerDate class. I reported
it back to webMethods support, and was told by them that one option is to turn off the “Enable Script Security” checkbox (which is checked by default), in the Java tab, of the Adapter Configuation tool, for your adapter.

I had the problem while using the JDBC Adapter, with the Oracle thin Type-4 JDBC driver. Unchecking the box make the problem disappear.

WM Support also said that this is a known outstanding issue.