createPathAndSetValue(...) differs from createPath(...).setValue(...) : 
"Factory is not set"
--------------------------------------------------------------------------------------------

                 Key: JXPATH-103
                 URL: https://issues.apache.org/jira/browse/JXPATH-103
             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(JXPathContextReferenceImpl.java:450)
        at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:427)

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.

Reply via email to