2 Replies Latest reply: Feb 1, 2011 7:28 AM by 835648 RSS

    I keep getting Uncaught exception from C++ API, errcode = INTERNAL_ERROR

    835648
      Hi,

      I have database application that I am porting from eXist. This application is largely written in XQuery that is called from Java code. The XQuery code is organised into functions in modules that can run to well over 1000 lines of code per module.

      The problem is, as I have converted the code, I have been getting an error:

      SEVERE: XQuery failed
      com.sleepycat.dbxml.XmlException: Uncaught exception from C++ API, errcode = INTERNAL_ERROR
           at com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_prepare__SWIG_1(Native Method)
      ...

      There are no clues about why this error is raised. Does anyone have any suggestions about how I can work out what is causing this kind of error.

      Is there any way of getting a sensible error message from the C++ core?
        • 1. Re: I keep getting Uncaught exception from C++ API, errcode = INTERNAL_ERROR
          637288
          Hi,

          that's really odd, and nothing much I could tell off hand.

          I would recommend to
          1) Try your queries in the dbxml shell - maybe you will get a better error, or nothing at all (the latter means that there is a problem in Java bindings)
          2) Try to debug your application using gdb and see where the exception is thrown in C++ code (once I had to do this)
          3) Try to narrow down the problem XQuery to a smaller XQuery
          4) Try to execute an XQuery without importing modules or merge everything into one XQuery, just for testing (I remember there were some problems with XQuery library modules at some point)

          Any further information would be useful to diagnose the problem

          Vyacheslav
          • 2. Re: I keep getting Uncaught exception from C++ API, errcode = INTERNAL_ERROR
            835648
            Thanks for the suggestions.

            By restructuring I have managed to simplify the XQueries and have narrowed the issue down to a block of recursive code that I will now need to re-think.