Integrating with third party libraries/JARs may result inClassNotFoundExceptionerrors forTransformerFactoryImpl atruntime.

Integrating with third party libraries/JARs may result inClassNotFoundExceptionerrors forTransformerFactoryImpl atruntime.

book

Article ID: KB0093777

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
Integrating with third party libraries/JARs may result in ClassNotFoundException errors at runtime even when there are no issues at Design time. While testing in Studio there may be no issues but when deployed the application to appnode, there will be classnotfound issues at runtime.


Symptoms:
The following error is seen in bwappnode.log.

+++
 ERROR [bwEngThread:In-Memory Process Worker-2]  TIBCO-BW-PALETTE-JAVA-500001: While executing method [invoke] encountered exception [java.lang.reflect.InvocationTargetException] [null].-{ActivityName=JavaInvoke, ProcessName=MyProcess, ModuleName=xxx.xxx.module}
at com.tibco.bw.palette.java.runtime.JavaInvokeActivity.execute(JavaInvokeActivity.java:198)
at com.tibco.bw.core.runtime.bx.BWBxActivityBridgeImpl.eval(BWBxActivityBridgeImpl.java:773)
.
.
. at com.tibco.pvm.infra.api.impl.util.director.IpmEventDirectorBase.handleModelEvent(IpmEventDirectorBase.java:170)
at com.tibco.pvm.infra.api.impl.util.director.IpmEventDirectorBase.handleEvent(IpmEventDirectorBase.java:90)
.
.
.

at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.tibco.bw.palette.java.runtime.JavaInvokeActivity.execute(JavaInvokeActivity.java:164)
... 13 more
Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
.
.
.at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1441)
at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:212)
at charter.bw.enterprise.webapi.statement.StatementsExcel.invoke(StatementsExcel.java:290)
... 18 more
Caused by: java.lang.ClassNotFoundException: org.apache.xalan.processor.TransformerFactoryImpl cannot be found by com.tibco.bx.core_1.12.203.002
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.tibco.bx.core.service.BxExtServiceAgentImpl$ExtendedClassLoader.loadClass(BxExtServiceAgentImpl.java:673)
at javax.xml.transform.FactoryFinder.getProviderClass(Unknown Source)
at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
at javax.xml.transform.FactoryFinder.findJarServiceProvider(Unknown Source)
at javax.xml.transform.FactoryFinder.find(Unknown Source)
... 25 more

++++

Cause:
Issue with OSGi classloading

Issue/Introduction

Integrating with third party libraries/JARs may result inClassNotFoundExceptionerrors forTransformerFactoryImpl atruntime.

Resolution

You have couple of options to resolve this issue.



Option 1:


Add the following line to Appnode TRA file and restart the Appnode.


java.extended.properties=-Xmx1024m -Xms128m -XX:PermSize=27m -XX:MaxPermSize=128m -XX:-HeapDumpOnOutOfMemoryError -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl


Option2:


Add the missing packages [org.apache.xalan.xsltc.trax(2.7.200)] in dependencies tab for the application module's Module Descriptor in Business Studio as shown in the attached screenshot (Filename: depenxalan.png). Recreate the EAR and redeploy the application.


Attachments

Integrating with third party libraries/JARs may result inClassNotFoundExceptionerrors forTransformerFactoryImpl atruntime. get_app