Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8149923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:56:53+00:00 2026-06-06T14:56:53+00:00

I have a Document object initialized in the init() method of the servlet and

  • 0

I have a Document object initialized in the init() method of the servlet and use it in the doPost() method to service the requests.

selectNodeList() xpath query gives exception when the servlet services many request at same time.
The Exception is shown below:

Caused by: javax.xml.transform.TransformerException: -1
    at org.apache.xpath.XPath.execute(XPath.java:331)
    at org.apache.xpath.CachedXPathAPI.eval(CachedXPathAPI.java:328)
    at org.apache.xpath.CachedXPathAPI.selectNodeList(CachedXPathAPI.java:255)
    at org.apache.xpath.CachedXPathAPI.selectNodeList(CachedXPathAPI.java:235)
    at com.pro.bb.servlets.Controller.getDataOrPeriodForReport(Controller.java:511)
    ... 23 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at org.apache.xpath.XPathContext.pushCurrentNode(XPathContext.java:808)
    at org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:447)
    at org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java:409)
    at org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:176)
    at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
    at org.apache.xpath.axes.NodeSequence.runTo(NodeSequence.java:474)
    at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:257)
    at org.apache.xpath.axes.LocPathIterator.execute(LocPathIterator.java:257)
    at org.apache.xpath.XPath.execute(XPath.java:308)

Help me sort out the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:56:54+00:00Added an answer on June 6, 2026 at 2:56 pm

    The CachedXPathAPI class is not thread-safe. If you’re using it in the servlet, you have to manualy take care for synchonizing access (or use multiple instances).

    From the Apache Xalan-j javadoc:

    Note that any particular instance of CachedXPathAPI must not be operated upon by multiple threads without synchronization; we do not currently support multithreaded access to a single DTM. Similarly, any particular instance of CachedXPathAPI must not be operated upon by multiple threads without synchronization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object Document with nested Properties (Name, Value) collection. Now I want
I have one collection numbers with 200000 document object with {number: i} i =
I have a few .Net projects that would benefit from using a document/object database
I have an object called Document that has a one-to-many relationship with DocumentPersonCc. I
I have an XML document that I generate from an Entity Framework object. The
i have printed out the contents of an array/object (named 'document') with print_r. it
I have written some code that loads an XML document using an XmlDocument object
I have updated my jSon object using the code <script type=text/javascript > jQuery(document).ready(function($){ var
I'm trying to retrieve a document when I have an object id - however,
I have loaded image into a new, initialized Oracle ORDImage object and am processing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.