1 Reply Latest reply: Apr 30, 2010 1:45 AM by odie_63 RSS

    NoClassDefFoundError: oracle/i18n/text/OraCollator while running xquery

    malkit
      While running the following query, for extracting all the namespaces defined in the xml document, I am running into java.lang.NoClassDefFoundError: oracle/i18n/text/OraCollator exception (stack pasted in the end). I have xquery.jar and xmlparser2.jar in the classpath. Please also note I am getting this exception only when distinct-values function is used. Is this function supported?

      I might be missing some required jar. Can someone please point me what jar I am missing and where can I get that jar.

      -----
      <result>
      {
           for $b in distinct-values(
      for $i in (doc("XMLDocument.xml")//* | doc("XMLDocument.xml")//@*)
      return namespace-uri($i)
           )
           return
                <ns>{$b}</ns>
      }
      </result>
      -----

      Stacktrace
      Exception in thread "main" java.lang.NoClassDefFoundError: oracle/i18n/text/OraCollator
           at oracle.xml.xqxp.functions.builtIns.FNUtil.getCollator(FNUtil.java:355)
           at oracle.xml.xqxp.functions.builtIns.DistinctValue.invoke(FNSequences.java:717)
           at oracle.xml.xqxp.functions.builtIns.DistinctValue.invoke(FNSequences.java:742)
           at oracle.xquery.exec.FunctionCall.EvaluateJavaFunction(FunctionCall.java:510)
           at oracle.xquery.exec.FunctionCall.Evaluate(FunctionCall.java:471)
           at oracle.xquery.exec.Expr.getIterator(Expr.java:504)
           at oracle.xquery.exec.Scan$ScanNSIterator.Start(Scan.java:175)
           at oracle.xquery.exec.FilterProject$FilterProjectIterator.Start(FilterProject.java:99)
           at oracle.xquery.exec.FLWR$FLWRIterator.Restart(FLWR.java:138)
           at oracle.xquery.exec.OXQuerySequence.next(OXQuerySequence.java:256)
           at oracle.xquery.exec.XMLElem.EvalDirectCons(XMLElem.java:314)
           at oracle.xquery.exec.XMLElem.Evaluate(XMLElem.java:271)
           at oracle.xquery.exec.Expr.getIterator(Expr.java:504)
           at oracle.xquery.exec.ExprSequence$ExprSequenceIterator.Restart(ExprSequence.java:75)
           at oracle.xquery.exec.OXQuerySequence.next(OXQuerySequence.java:256)
           at migrate.MigrateTest.test(MigrateTest.java:243)
           at migrate.MigrateTest.main(MigrateTest.java:267)
      Caused by: java.lang.ClassNotFoundException: oracle.i18n.text.OraCollator
           at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
           ... 17 more
      ------

      Thaks in advance.

      Malkit S. Bhasin