Hi,
Finally we found the cause of the error: although there was all the tree jars in the code module, only the filenet-bpm-event-handler-51.jar was visible as Content element in the action.
After checking out and checking in again with refreshing, now there is no error at FileNet side. Hurray.
But now as the event arrives to BAW, we get null pointer exception.
And we get the same null pointer exception when we use the REST Api Tester with the very same parameters.
REST Call by FileNet:
https://<BAW server>:9443/rest/bpm/wle/v1/event/ecm?eventSourceId=%7BE31EB980-0271-485C-ABF5-FE7494598AED%7D&objectTypeId=cmis%3Adocument&eventType=Created&objectId=idd_60B9917F-0000-C51A-AA2C-9013BA2B0312
REST call by hand in REST API Tester:
The IDs are all correct, we checked them.
So, it seems that there is a problem with the REST API.
Sysout.log excerpt:
[2022.03.16. 9:23:13:391 CET] 0000022b RestHelper W java.lang.NullPointerException
com.lombardisoftware.core.TeamWorksRuntimeException: java.lang.NullPointerException
at com.lombardisoftware.core.TeamWorksRuntimeException.asTeamWorksRuntimeException(TeamWorksRuntimeException.java:88)
at com.ibm.bpm.integration.runtime.IntegrationUtils.getECMConnectionFromEventSourceId(IntegrationUtils.java:163)
at com.ibm.bpm.integration.runtime.ECMIntegrationInboundServices.getParentTypeIds(ECMIntegrationInboundServices.java:454)
at com.ibm.bpm.integration.runtime.ECMIntegrationInboundServices.sendEvent(ECMIntegrationInboundServices.java:214)
at com.ibm.bpm.rest.impl.event.ECMEventResource.sendEvent(ECMEventResource.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
Any ideas please? What's wrong? How to fix it?
We use BAW version 19.x.
Thx,
------------------------------
Laszlo
------------------------------
Original Message:
Sent: Sun March 13, 2022 08:51 PM
From: David Alfredson
Subject: com.ibm.bpm.integration.filenet.BPMEventHandler error
Hi Laszlo,
The event hander code does some lookup/retrieval of configuration data based on the userstring, a property of the subscription, which I think is a reference to a document which is a properties file that contains details about the BPM urls to use. Those operations are all done in static methods or in a constructor which could cause an initialization failure if they weren't correct which would then cause a downstream noclassdef found. It's not that the class isn't there, it's the loading has been attempted and failed due to the initialisation error and then it won't look it up again.
I don't use this event handler, so I'm just working backwards from what you've provided and what I can find in the code and what I know about how the CE works. I think it's an initialisation/configuration error that is then presenting as the class not found error.
------------------------------
David Alfredson
Original Message:
Sent: Sun March 13, 2022 06:53 PM
From: Laszlo Kertesz
Subject: com.ibm.bpm.integration.filenet.BPMEventHandler error
Hi David,
Thx for your answer.
I know, what class not found error means and why we get such an error.
My problem is that IBM publishes a step by step description which do not work, and later publishes a fix for it which again, do not work.
All the three jar files listed in the two descriptions are included in the code module.
Thx,
------------------------------
Laszlo
Original Message:
Sent: Sun March 13, 2022 05:42 PM
From: David Alfredson
Subject: com.ibm.bpm.integration.filenet.BPMEventHandler error
Check this post first https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java. It's years old but it provides some guidance on whether you're actually getting a class not found or some other issue that then causes the classdeffounderror. You've only indicated the final error, not that you've seen anything prior in the logs. I'm assuming you're using WebSphere in the next suggestions.
The class loader sometimes needs to be told to use Parent Last loading depending on what you're doing in the event handler so that your classes are found in the correct manner. It may not be your problem, but it's something that is easy to check. https://www.ibm.com/support/pages/class-loader-conflict-troubleshooting-content-platform-engine-codemodules.
Beyond that, can you list the specific jar files you've loaded in the new code module? The event action points to a single code module and that code module needs to have all the JARs necessary for the action, or they need to be included on the classpath some other way. You can add the jars to the WAS classpath (not normal), add in a shared library and associate it with the content engine (sometimes) or add the jars to the ext directory in WAS (less likely).
Code modules work well to isolate what is needed. Normally checking the list of JARs in the code module and the class loading order are the two major things to check.
------------------------------
David Alfredson
Original Message:
Sent: Sat March 12, 2022 05:16 AM
From: Laszlo Kertesz
Subject: com.ibm.bpm.integration.filenet.BPMEventHandler error
We tried to fix by adding the two jars mentioned here:
https://www.ibm.com/support/pages/release-note-event-subscriptions-configured-ibm-filenet-content-manager-552-and-handled-bpmeventhandler-event-action-fail-trigger-event-notifications-ibm-business-automation-workflow
but still not working, the error is still
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.Credentials
Any ideas?
Thx,
------------------------------
Laszlo
Original Message:
Sent: Fri March 11, 2022 05:02 PM
From: Laszlo Kertesz
Subject: com.ibm.bpm.integration.filenet.BPMEventHandler error
Hi All,
We want to handle FileNet document events in BAW, so we executed the steps described here (for document creation events):
Using the event handler for FileNet Content Manager
But when we create a document in the object store for which the event handler is installed and set up, we get this error in the ceserver log:
Exception in method onEvent(ObjectChangeEvent) of handler com.ibm.bpm.integration.filenet.BPMEventHandler
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.Credentials
What's wrong and how to fix it? Why do not finds the class the code (jar) which is created by IBM?
Any help appreciated,
------------------------------
Laszlo
------------------------------