Skip to Main Content

General Development Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xmlparserv2.jar in OpenScript

Jihai ChenAug 5 2013

Hi,

    The Financials Team is using Openscript to run OATS tests. We have a Common API called FinSharedLib, which imports xmlparserv2.jar in the Asset Tab b/c it is a required jar for a method call (we will call this Method_A()). Right now, we are trying to add a new feature, which involves adding more functions to the main class FinSharedLib, as well adding "lib" classes under FinSharedLib/lib/oracle/fin/ folder, one of this classes is Environment.java. This is where a conflict happens:

Both Environment.java and FinSharedLib.java (main class) uses javax.xml.*...but if we include xmlparserv2.java in Asset tab of the project, then when a function is called in Environment.java, we get:

22:52:19,718 ERROR [GeneralResultReporter] Failed to write xml report
java.lang.ClassCastException: oracle.xml.jaxp.JXSAXTransformerFactory cannot be cast to javax.xml.transform.TransformerFactory
     at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:102)
     at oracle.oats.scripting.modules.basic.api.internal.result.GeneralResultReporter.createReport(GeneralResultReporter.java:108)
     at oracle.oats.scripting.modules.basic.api.internal.result.ResultReportEventListener.onTransactionEnd(ResultReportEventListener.java:405)
     at oracle.oats.jagent.scripting.OpenscriptBundleBindEventListener.onTransactionEnd(OpenscriptBundleBindEventListener.java:231)
     at oracle.oats.jagent.AggregateJavaAgentEventListener.onTransactionEnd(AggregateJavaAgentEventListener.java:187)


This problem goes away if we remove xmlparserv2.jar...but if we do, then method_A() in FinSharedLib gets an error:

FinSharedLib.fn_fin_compareESSReportOutputXML failed, caused by: oracle/xml/parser/v2/SAXParser Caused by: ClassNotFoundException occured. oracle.xml.parser.v2.SAXParser

oracle.oats.scripting.modules.basic.api.exceptions.FunctionException: Function FinSharedLib.fn_fin_compareESSReportOutputXML failed, caused by: oracle/xml/parser/v2/SAXParser

    at oracle.oats.scripting.modules.basic.api.exceptions.FunctionException.createInnerFunctionException(FunctionException.java:29)

    at oracle.oats.scripting.modules.basic.api.internal.CallableFunction.callFunction(CallableFunction.java:132)

    at oracle.oats.scripting.modules.basic.api.internal.CallableScript.callFunction(CallableScript.java:100)

    at oracle.oats.scripting.modules.basic.api.internal.FuncLibraryWrapper.callFunction(FuncLibraryWrapper.java:60)

    at lib.oracle.fin.FinSharedLib.fn_fin_compareESSReportOutputXML(FinSharedLib.java:440)

    at script.run(script.java:130)

    at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:348)

    at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:779)

    at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.NoClassDefFoundError: oracle/xml/parser/v2/SAXParser

    at oracle.xdo.common.xml.util.XMLFilterElement.process(XMLFilterElement.java:240)

    at oracle.xdo.common.xml.util.XMLFilterElement.main(XMLFilterElement.java:674)

    at script.fn_fin_compareESSReportOutputXML(script.java:1127)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at oracle.oats.scripting.modules.basic.api.internal.CallableFunction.invokeMethod(CallableFunction.java:206)

    at oracle.oats.scripting.modules.basic.api.internal.CallableFunction.callFunction(CallableFunction.java:97)

There is no compilation issues in either case, both of these happens at run time. Please let me know how I can potentially solve this. Or if I should be posting in some other forum, let me know too.

thanks,

Jihai

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2013
Added on Aug 5 2013
0 comments
988 views