This discussion is archived
6 Replies Latest reply: Mar 6, 2012 2:28 PM by 583206 RSS

TYPE003: Runtime Type Mismatch

583206 Newbie
Currently Being Moderated
A general question:

ODSI 10gR3

Has anyone seen the "TYPE003: Runtime Type Mismatch" error returned when you pass a variable through a function rather than a literal? The variable is the exact same value as the literal and I have casted all to a xs:double before passing through the "getReferencesByVersionID" function in code below.

=============================================================


(: Always tested with the same $VersionID and only 1 order in the database :)


for $Order in tns:getOrdersByVersionID($VersionID)
return
          
...

(: let $OrderNum := tns:getOrderNum(fn:data($Order/ns1:OrderNum)) :) (: Fail :)
let $OrderNum := xs:double(fn:data($Order/ns1:OrderNum)) (: Fail :)
(: let $OrderNum := xs:double(12001002) :) (: Success :)
          
let $References := tns:getReferencesByVersionID($VersionID, $OrderNum)
return

...

Returned XML snippet when run successfully:

<ns0:Order ns0:TransactionPurpose="ADD/UPDATE">
<ns0:ShipperRef>J10310ST12001002</ns0:ShipperRef>
<ns0:OrderNum>12001002</ns0:OrderNum> (: Populated by: "data($Order/ns1:OrderNum)". "ns0:OrderNum" defined as xs:double in schema. Note: same value as literal :)
<ns0:Comments/>
<ns0:OrderType>O</ns0:OrderType>
<ns0:Workflow>O</ns0:Workflow>
...

Returned Trace when not working:

com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQueryTypeException: {bea-err}TYPE003: Runtime Type Mismatch
     at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
     at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
     at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
     at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:113)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1041)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1176)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1866)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:174)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1594)
     at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1597)
     at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1560)
     at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
     at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3687)
     at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3298)
     at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
     at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
     at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
     at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
     at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
     at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
     at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
     at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)

The obvious answer is that "fn:data($Order/ns1:OrderNum)" does not equal "xs:double(12001002)" when passed through the " tns:getReferencesByVersionID()" function but it appears to be the same value.

This is happening in the Application layer so too much to include all the code. Thoughts/Comments on where to look or what I am missing?

Thanks
Tom
  • 1. Re: TYPE003: Runtime Type Mismatch
    mikereiche Pro
    Currently Being Moderated
    Hi Tom -

    The Runtime Type Mismatch may be referring to some element other than OrderNum that is accessed in getOrderNum. For instance, if getOrderNum results in a web-service call that includes an xs:integer zipcode, and the zipcode data is non-numeric. If you show the complete stack trace, including all the "caused by" traces, we would be able to see if that is the case. This shouldn't happen for data taken from a database with an ODI-generated sql-select, as only the required data is retrieved, unless there is something blocking optimization. If you show the audit for the query execution, we would have more information on that. For the audit, it would be helpful to also check 'results' for the type of physical data service that is retrieving OrderNum


    You can also use the trace function to dump intermediate results - the caveat is that it will change the query plan. For instance if your query only references $Order/ns1:OrderNum, but you trace($Order), then instead of retrieving only OrderNum, your query will retrieve all the elements of $Order.

    thread about using trace : How to see fn:trace() results in log and/or Workshop console?

    - Mike
  • 2. Re: TYPE003: Runtime Type Mismatch
    583206 Newbie
    Currently Being Moderated
    Thanks Mike. No other web services... all physical ODSI to a single Oracle 11g denormalized table, selected several times to get different parts of the data (order header, shipping info, items, etc) and bubbled up through the layers via transformations finally getting into a single XML ORDER at the app layer.

    I'm not a guru at reading traces but it appears numieric vs double issue?

    The full stack trace:

    weblogic.xml.query.exceptions.XQueryTypeException: {bea-err}TYPE003: Runtime Type Mismatch
         at weblogic.xml.query.runtime.core.ExecutionWrapper.asXQueryException(ExecutionWrapper.java:165)
         at weblogic.xml.query.runtime.core.ExecutionWrapper.fetchNext(ExecutionWrapper.java:94)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
         at weblogic.xml.query.runtime.node.DeflateRec.fetchNext(DeflateRec.java:43)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at com.bea.ld.server.ResultPusher$ChunkyBinxmlChunker.nextChunk(ResultPusher.java:402)
         at com.bea.ld.server.ResultPusher$AsyncChunkyBinxmlChunker.nextChunk(ResultPusher.java:520)
         at com.bea.ld.server.ResultPusher$BinxmlChunker.next(ResultPusher.java:292)
         at com.bea.ld.EJBRequestHandler$1.next(EJBRequestHandler.java:938)
         at com.bea.ld.ServerBean.maybeStreamResult(ServerBean.java:97)
         at com.bea.ld.ServerBean.executeOperationStreaming(ServerBean.java:86)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeOperationStreaming(Server_ydm4ie_EOImpl.java:72)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.ClassCastException: weblogic.xml.query.tokens.basic.Basic_StringToken
         at weblogic.xml.query.runtime.numeric.compare.DoubleEqual.compare(DoubleEqual.java:31)
         at weblogic.xml.query.runtime.compare.ComparisonIterator.execute(ComparisonIterator.java:45)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.logic.BoolEffValue.exec(BoolEffValue.java:47)
         at weblogic.xml.query.runtime.logic.BoolEffValue.execute(BoolEffValue.java:43)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:167)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:91)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:91)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:221)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream.next(BasicMaterializedTokenStream.java:109)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream$MatStreamIterator.fetchNext(BasicMaterializedTokenStream.java:448)
         at weblogic.xml.query.iterators.LegacyGenericIterator.next(LegacyGenericIterator.java:109)
         at weblogic.xml.query.runtime.core.RTVariable.fetchNext(RTVariable.java:53)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.sequences.Exists.execute(Exists.java:37)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream.next(BasicMaterializedTokenStream.java:109)
         at weblogic.xml.query.iterators.BasicMaterializedTokenStream$MatStreamIterator.fetchNext(BasicMaterializedTokenStream.java:448)
         at weblogic.xml.query.iterators.LegacyGenericIterator.next(LegacyGenericIterator.java:109)
         at weblogic.xml.query.runtime.core.RTVariable.fetchNext(RTVariable.java:53)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.navigation.ChildPath.fetchNext(ChildPath.java:221)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.sequences.Exists.execute(Exists.java:37)
         at weblogic.xml.query.iterators.FunctionIterator.fetchNext(FunctionIterator.java:30)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.IfThenElse.fetchNext(IfThenElse.java:79)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.buildPreserveModeTextNode(SuperElementConstructor.java:320)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:405)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.matEverything(PartMatElemConstructor.java:123)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:197)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:229)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.LetIterator.fetchNext(LetIterator.java:133)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.CountMapIterator.fetchNext(CountMapIterator.java:167)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.constructor.SuperElementConstructor.getPhase2(SuperElementConstructor.java:388)
         at weblogic.xml.query.runtime.constructor.PartMatElemConstructor.fetchNext(PartMatElemConstructor.java:229)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.debug.Trace.fetchNext(Trace.java:70)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.LegacyGenericIterator.hasNext(LegacyGenericIterator.java:130)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:163)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:237)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at weblogic.xml.query.runtime.core.ExecutionWrapper.fetchNext(ExecutionWrapper.java:88)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:133)
         at weblogic.xml.query.runtime.node.DeflateRec.fetchNext(DeflateRec.java:43)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
         at com.bea.ld.server.ResultPusher$ChunkyBinxmlChunker.nextChunk(ResultPusher.java:402)
         at com.bea.ld.server.ResultPusher$AsyncChunkyBinxmlChunker.nextChunk(ResultPusher.java:520)
         at com.bea.ld.server.ResultPusher$BinxmlChunker.next(ResultPusher.java:292)
         at com.bea.ld.EJBRequestHandler$1.next(EJBRequestHandler.java:938)
         at com.bea.ld.ServerBean.maybeStreamResult(ServerBean.java:97)
         at com.bea.ld.ServerBean.executeOperationStreaming(ServerBean.java:86)
         at com.bea.ld.Server_ydm4ie_EOImpl.executeOperationStreaming(Server_ydm4ie_EOImpl.java:72)
         at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
  • 3. Re: TYPE003: Runtime Type Mismatch
    583206 Newbie
    Currently Being Moderated
    To clarify the xs:integer parameter in the ns0:getSalesOrder() call below.... The intital parameter is an xs:integer which signifies which $VersionID of our ERP we are requesting data from in down in the physical layer. During all my testing, I have gone against the same ERP.


    common/application {
    user: weblogic
    name: TMS_ODSI
    eventkind: evaluation
    principals: weblogic Administrators IntegrationAdministrators AdminChannelUsers
    server: AdminServer
    }

    query/cache/queryplan {
    type: XQUERY_PLAN_CACHE
    found: true
    }

    query/performance {
    compiletime: 46
    }

    common/application {
    exception: {bea-err}TYPE003: Runtime Type Mismatch
    }

    query/service {
    function: getSalesOrder
    arity: 1
    dataservice: ld:Application/SalesOrder.ds
    parameters: 9
    query: import schema namespace t1 = "www.chiquita.com/schemas/tms/SalesOrder" at "ld:Application/schema/SalesOrder.xsd";
    declare namespace ns0="ld:Application/SalesOrder";
    declare namespace ns1="http://www.w3.org/2001/XMLSchema";
    declare variable $__fparam0 as ns1:integer external;
    fn:subsequence(
    for $LeanXML in ns0:getSalesOrder($__fparam0)
         return
                   $LeanXML


    ,1,500)
    }

    common/time {
    timestamp: Tue Mar 06 13:37:05 EST 2012
    duration: 62
    }
  • 4. Re: TYPE003: Runtime Type Mismatch
    mscongdon Newbie
    Currently Being Moderated
    Hi Tom,

    Based on your stack trace above, these 2 lines intrigue me:

    java.lang.ClassCastException: weblogic.xml.query.tokens.basic.Basic_StringToken
    at weblogic.xml.query.runtime.numeric.compare.DoubleEqual.compare(DoubleEqual.java:31)

    My first asssumption is that the field is returning a string that cannot be cast to a double for some syntactical reason.

    Can you print out the value of the order number field or even the raw XML itself? Is it an empty string ("")? Is it the word "null"? Is it a null XML element (like <OrderNum/>)?
  • 5. Re: TYPE003: Runtime Type Mismatch
    mikereiche Pro
    Currently Being Moderated
    Tom -

    There is no database access in the audit - it looks like the query errored out before the call was made.

    let $OrderNum := tns:getOrderNum(fn:data($Order/ns1:OrderNum))

    Can you provide the body of getOrderNum()? And also the bodies of any functions that it calls? And the same for getOrdersByVersionID?

    And don't replace any parts with "...", because they matter. For instance, depending on what is being returned, getOrderNum() may or may not be called (and if getOrderNum() is never called, then there is no reason to call getOrdersByVersionID() unless its output is used elsewhere.

    Another thing to look for is warnings (yellow) in the source view. They can become runtime errors.

    Probably not relevant to the issue, but it seems odd to call getOrderNum() with an argument of OrderNum.

    - Mike
  • 6. Re: TYPE003: Runtime Type Mismatch
    583206 Newbie
    Currently Being Moderated
    Mike:

    Sorry... I have been offline and now see the issue. When you pointed me to the trace() link which noted to make sure you have DEBUG levels both at the WLS and ODSI level, I went over the PL/SQL that was created which saw the TO_CHAR() command applied to the "OrderNum" field. I then saw that I had a schema issue on one of the sub queries on the logical layer with the OrderNum as xs:string rather than xs:double. So even though it was a xs:double on 3 of the 4 layer, the switching must have caused issues that I could not see on the surface.

    That explains a bit why I could not use the OrderNum value but could could with a literal. Odd behaviour though...

    Thanks for the help with this and all the posts that I read weekly. Much appreciated.

    Tom

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points