How to resolve Java to XML activity Output Validation error?
book
Article ID: KB0073265
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks
6.x
Description
A project with the Java to XML activity runs successfully with the correct output showing in Business Studios.
Next, when the EAR file is generated from the project and deployed in an Appnode or Container, the Java to XML activity will throw a similar error to the below at runtime:
com.tibco.bw.core - TIBCO-BW-CORE-500050: The BW process [%%PROJECT_NAME%%] instance faulted, JobId [bw0a100], ProcessInstanceId [bw0a10g], ParentProcessInstanceId [bw0a107], Module [%%MODULE_NAME%%:1.0.0.20210526020925], Application [%%APPLICATION_NAME%%.application:1.0]. <CausedBy> TIBCO-BW-CORE-500064: Activity [JavatoXML] error. <CausedBy> com.tibco.bx.core.faults.BxException: Activity output data validation error. The output data from activity [JavatoXML] in process [%%PROCESS_NAME%%], module [%%MODULE_NAME%%] does not conform to the activity output schema. Unexpected element sequence, got 'resp' in {www.tibco.com/plugin/java/xmlSchema/com.tibco.psg.DataHolder}DataHolder. A non-absent element declaration or type definition is not known for the element Job. ....
Issue/Introduction
The Java to XML activity runs successfully in Business Studio. However, when the same application is deployed then the Java to XML activity throws an Output Validation error.
Environment
Operating System(S): All
Resolution
When the project is imported into Studio, it copies all the .annoxfiles and the bin folder which has all the required .ann.xml files. However, if the application/shared module is missing the entry of ".annoxfiles" in the Bundle-ClassPath entry for its MANIFEST.MF. It is able to run in Studio because the required .ann.xml file are available at bin path.
If the EAR is now created from this project without the entry of .annoxfiles in the Bundle-Classpath, there is no way for the runtime to find these files causing the error.
- Reloading the Class Name field after import the project and creating an EAR won't work. When you "Reload" the class name, if there are any changes in the class structure then it would update the respective .ann.xml files accordingly. However, the Reload will not create the ".annoxfiles" entry for Bundle-Classpath element in the respective MANIFEST.MF file.
Solution:
After importing the project, please check the MANIFEST.MF for Application/Shared module. If it doesn't have the .annoxfiles entry in the Bundle-Classpath (see attachment) then please do either of the following two:
1. Try to browse for the class that's required before creating an EAR. This will create an entry of .annoxfiles against Bundle-Classpath element.
2. You can try to add .annoxfiles entry manually in the MANIFEST.MF but make sure you are adding it using the correct syntax before creating an EAR.