commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] Closed: (JXPATH-103) createPathAndSetValue(...) differs from createPath(...).setValue(...) : "Factory is not set"
Date Mon, 24 Sep 2007 17:23:52 GMT


Matt Benson closed JXPATH-103.

    Resolution: Invalid

I'm afraid I _must_ ask.  There really isn't much of a way to work around this; creating a
path without passing in the value to set requires a factory to generate the initial value
at the path.  In fact you should see that createPathAndSetValue() throws the same exception
if more than one step of the path needs to be created.  Finally, I am at a loss to understand
your comment that you have to pass around the Pointer as createPathAndSetValue() returns the
created Pointer.  If this information does not help you, please return the discussion to


> createPathAndSetValue(...) differs from createPath(...).setValue(...) : "Factory is not
> --------------------------------------------------------------------------------------------
>                 Key: JXPATH-103
>                 URL:
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>            Reporter: Hans-Peter Stoerr
>            Priority: Minor
> Hi!
> If I have a bean (as shown below), I guess it is an error that the second of the next
two calls does not work:
>         JXPathContext.newContext(new TestBean()).createPathAndSetValue("/attrib", "val");
>         JXPathContext.newContext(new TestBean()).createPath("/attrib").setValue("val");
> The first one works, but the second one throws up:
> org.apache.commons.jxpath.JXPathException: Exception trying to create xpath /attrib;
Factory is not set on the JXPathContext - cannot create path: /attrib
> 	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(
> 	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(
> The bean is as follows:
>     public static class TestBean {
>         public String plainattrib;
>         private String attrib;
>         public String getAttrib() {
>             return attrib;
>         }
>         public void setAttrib(String attrib) {
>             this.attrib = attrib;
>         }
>     }
> (Don't ask: I cannot use the first method, since I have to pass around the Pointer.)
> Thanks so much,
> Hans-Peter

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message