[jdom-interest] org.jdom.JDOMException: java.lang.reflect.InvocationTargetException

Jason Hunter jhunter at acm.org
Fri Jul 5 11:43:22 PDT 2002


The cause is probably the reflection work being done behind the
newInstance() call.  Are you using the jaxen version that came with the
latest CVS copy of JDOM?  If that doesn't fix it, then send in the full
stack trace so we can take a look.

-jh-

> Olu Adelaja wrote:
> 
> Hello there,
> 
> I am trying to create an XML document using JDOM.  At the same time I
> also need to dynamically add addtional elements to the XML document as
> I traverse a dataset from the DB.  I am using the following code:
> 
> ----------------------- START CODE ---------------------
> 
>             Element root = new Element("events");
>             Document doc = new Document(root);
>             root.addContent(new Element("categories"));
>             StringBuffer buf = new
> StringBuffer("/events/categories/category[@id='1']");
>             XPath path = XPath.newInstance(buf.toString());
>             Element curCategory =
> (Element)path.selectSingleNode(root);
> 
> ----------------------- END CODE ---------------------
> 
> A org.jdom.JDOMException: java.lang.reflect.InvocationTargetException
> error is thrown at the point at which an xpath object is about to be
> created[line 5].  I don't know why this error is being thrown.  Is it
> the xpath expression or the context?   Can someone help please?
> 
> Regards
> 
> Olu Adelaja
> 
> _______________________________________________ To control your
> jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list