IBM Support

Error JD-ClassNotFound discovering a Java service from server file in IBM Business Automation Workflow (BAW) or Cloud Pak for Business Automation (CP4BA)

Troubleshooting


Problem

I have a process application, and I need to add a java service.

I created my jar file with my class and in a sub folder I included all the required libraries.

Then I import the jar file as a Server file in my Process Designer without any error.

My managed asset is loaded correctly

Then I open the Services tab, and I click on the plus sign and I create a “New External Service”. I select the option "Java service from server file" and then I select the server file that I just uploaded, then the class it is correctly recognized, but when I click on finish button I receive the error

CWTBG0019E: Unexpected exception during execution. Exception information: 'com.ibm.bpm.common.discovery.exception.DiscoveryException: JD-ClassNotFound : Class metadata could not be discovered for class MyClass from 2063.819f2c2a-040e-4551-8a11-03042b47373d container due to java.lang.ClassNotFoundException'.

Symptom

I receive the following popup error:

PopUp window showing the error returned by the Web Process Designer while getting a com.ibm.bpm.common.discovery.exception.DiscoveryException: JD-ClassNotFound : Class metadata could not be discovered for class Class_name from 2063.819f2c2a-040e-4551-8a11-03042b47373d container due to java.lang.ClassNotFoundException

Looking in the SystemOut.log file you see the following exception

[2/20/25 8:16:22:847 PST] 0000017c ReflectionSer E   CWLLG2229E: An exception occurred in an EJB call.  Error: org.apache.poi.ss.usermodel.Font
                                 java.lang.NoClassDefFoundError: org.apache.poi.ss.usermodel.Font
            at java.lang.Class.forNameImpl(Native Method)
            at java.lang.Class.forName(Class.java:411)
            at com.lombardisoftware.core.Classes.createClass(Classes.java:99)
            at com.lombardisoftware.core.Classes.getClassMetaData(Classes.java:185)
            at com.lombardisoftware.server.ejb.reflection.ReflectionServicesCore$1.execute(ReflectionServicesCore.java:74)
            at com.lombardisoftware.server.core.ManagedAssetClassLoaderUtil.executeWithManagedAssetClassLoader(ManagedAssetClassLoaderUtil.java:58)
            at com.lombardisoftware.server.ejb.reflection.ReflectionServicesCore.getClassMetaData(ReflectionServicesCore.java:72)
            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)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
            at com.lombardisoftware.utility.spring.TransactionInterceptor$2.call(TransactionInterceptor.java:70)
            at com.lombardisoftware.utility.spring.ProgrammaticTransactionSupport.executeWithNoTransaction(ProgrammaticTransactionSupport.java:937)
            at com.lombardisoftware.utility.spring.ProgrammaticTransactionSupport.execute(ProgrammaticTransactionSupport.java:487)
            at com.lombardisoftware.utility.spring.TransactionInterceptor.invoke(TransactionInterceptor.java:68)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
            at com.lombardisoftware.utility.spring.CoreEntryInterceptor.invoke(CoreEntryInterceptor.java:44)
            at com.lombardisoftware.utility.spring.PSCoreEntryInterceptor.invoke(PSCoreEntryInterceptor.java:14)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:220)
            at com.sun.proxy.$Proxy164.getClassMetaData(Unknown Source)
            at com.lombardisoftware.client.delegate.ReflectionServicesDelegateDefault$1.execute(ReflectionServicesDelegateDefault.java:150)
            at com.lombardisoftware.client.delegate.ReflectionServicesDelegateDefault$1.execute(ReflectionServicesDelegateDefault.java:148)
            at com.lombardisoftware.server.ejb.EjbCallHandler.handleEjbCall(EjbCallHandler.java:44)
            at com.lombardisoftware.server.ejb.EjbCallHandler$1.run(EjbCallHandler.java:106)
            at java.security.AccessController.doPrivileged(AccessController.java:746)
            at com.lombardisoftware.server.ejb.EjbCallHandler.handleEjbCallInDelegateDefault(EjbCallHandler.java:104)
            at com.lombardisoftware.client.delegate.ReflectionServicesDelegateDefault.getClassMetaData(ReflectionServicesDelegateDefault.java:148)
            at com.ibm.bpmsdk.tools.repo.client.ExternalServiceRepoHelperImpl.getClassMetaData(ExternalServiceRepoHelperImpl.java:180)
            at com.ibm.bpm.java.discovery.impl.JavaDiscoveryAdapter.generateInterfaceWrapper(JavaDiscoveryAdapter.java:111)
            at com.ibm.bpm.common.discovery.DiscoveryAdapter.getInterfaceWrapper(DiscoveryAdapter.java:76)
            at com.ibm.bpm.common.discovery.impl.ExternalServiceGenerator.discoverContent(ExternalServiceGenerator.java:159)
            at com.ibm.bpmsdk.tools.repo.client.ExternalServiceRepoHelperImpl.discoverContent(ExternalServiceRepoHelperImpl.java:248)
            at com.ibm.bpmsdk.model.util.ExternalServiceHelper.discoverContent(ExternalServiceHelper.java:347)
            at com.ibm.bpmsdk.model.util.ExternalServiceHelper.createBPMNExternalServiceDefinition(ExternalServiceHelper.java:256)
            at com.ibm.bpmsdk.model.util.ExternalServiceHelper.createBPMNExternalServiceDefinition(ExternalServiceHelper.java:220)
[…]
Caused by: java.lang.ClassNotFoundException
            at java.lang.ClassLoader.findClass(ClassLoader.java:516)
            at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:948)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:893)
            at com.lombardisoftware.server.core.ManagedAssetClassLoader.loadClass(ManagedAssetClassLoader.java:280)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:876)
            ... 141 more

The above it clearly shows that the main class selected requires the class

org.apache.poi.ss.usermodel.Font

and that it cannot be found by the class loader

Caused by: java.lang.ClassNotFoundException

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSBYVB","label":"IBM Cloud Pak for Business Automation"},"ARM Category":[{"code":"a8m0z0000001iUXAAY","label":"Design-\u003EBAW App Development"}],"ARM Case Number":"TS018549923","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"},{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS8JB4","label":"IBM Business Automation Workflow"},"ARM Category":[{"code":"a8m50000000CccuAAC","label":"Process and Service Engine-\u003EService Engine-\u003EManaged Asset Class Loader (MACL)"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
26 February 2025

UID

ibm17183800