You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2003/10/25 17:59:37 UTC
[Woody binding] - o.a.commons.jxpath.JXPathException: Exception trying to create xpath areas[7]; InsertBean jxpath factory failed.
Hi:
I am getting an error while trying to add a new row. The flow stop at
while executing: form.save(bean). The bean is a collection of beans
"Area".
Here is the error message:
org.apache.commons.jxpath.JXPathException: Exception trying to create
xpath areas[7]; InsertBean jxpath factory failed.
Is posible that because the are_id is of type "integer" this error is
raised? If answer is yes, please explain briefly, how can I enable the
integer datatype for this function.
I am going crazy with this I saw the woody example 2 days and I cannot it
get on feets! Please help :-D
Cocoon version: Lastest CVS.
Best Regards,
Antonio Gallardo.
The binding.xml is:
<wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0" path="/">
<wb:repeater id="transaccion" parent-path="." row-path="areas"
unique-row-id="are_id" unique-path="@are_id">
<wb:on-bind>
<wb:value id="are_name" path="are_name"/>
</wb:on-bind>
<wb:on-delete-row>
<wb:delete-node/>
</wb:on-delete-row>
<wb:on-insert-row>
<wb:insert-bean classname="test.Area" addmethod="addArea"/>
</wb:on-insert-row>
</wb:repeater>
</wb:context>
The form definition is:
<wd:repeater id="transaction">
<wd:output id="are_id">
<wd:datatype base="integer"/>
</wd:output>
<wd:field id="are_name" required="true">
<wd:label>Name</wd:label>
<wd:datatype base="string">
<wd:validation>
<wd:length min="5" max="50"/>
</wd:validation>
</wd:datatype>
</wd:field>
<wd:booleanfield id="select">
<wd:label>Select</wd:label>
</wd:booleanfield>
</wd:repeater>
Here is the cause of the error:
Caused by: org.apache.commons.jxpath.JXPathException: Exception trying to
create xpath areas[7]; InsertBean jxpath factory failed.
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:420)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:397)
at
org.apache.cocoon.woody.binding.RepeaterJXPathBinding.saveFormToModel(RepeaterJXPathBinding.java:261)
at
org.apache.cocoon.woody.binding.ComposedJXPathBindingBase.saveFormToModel(ComposedJXPathBindingBase.java:108)
at
org.apache.cocoon.woody.binding.ContextJXPathBinding.saveFormToModel(ContextJXPathBinding.java:107)
at
org.apache.cocoon.woody.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
Re: [SOLUTION] - Re: [Woody binding] - o.a.commons.jxpath.JXPathException: Exception trying to create xpath areas[7]; InsertBean jxpath factory failed.
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Sylvain Wallez dijo:
> Antonio Gallardo wrote:
>>The JDO specification said (chapter 14.6.1 page 105):
>><snip>
>>14.6.1 Query Execution
>>
>>The Query interface provides methods that execute the query based on
>> the parameters given. They return an unmodificable Collection.....
>></snip>
>>
>>The last sentence is the root of the problem. I got this Collection and
>> tried to modify it by adding a new row to the woody repeater. This is
>> why I got the error described in the first mail of the thread.
>>
>>At this point Flow+Woody+OJBwithJDO is working fine. I will continue
>> the tests. :-D
> Interesting point to know, but I'm not sure this is _the_ reason.
> Looking at the exception, it looks more like a JXPath problem (cannot
> find a property write method or something like that). Or is there
> another chained exception that you did not post?
Nope. There was not another chained exception at all. This is simply why
it takes me 2 days to discover the error!
After posting the mail and rewriting the getList() method to "copy" the
data from the returned Query collection to a new bean then the
form.save(bean) works fine.
I also did another trick:
If I used "other" bean for form.save(newBean) it works too. But I have a
very hard head and I wanted to save back to the same bean. This is why I
debugged and tried like crazy. :-D
Well, another interesting stuff is that I discovered that JXPath first
call the method "addArea" with a empty bean and then fill the bean. It is
interesting to me :-)
Best Regards,
Antonio Gallardo
Re: [SOLUTION] - Re: [Woody binding] - o.a.commons.jxpath.JXPathException:
Exception trying to create xpath areas[7]; InsertBean jxpath factory failed.
Posted by Sylvain Wallez <sy...@apache.org>.
Antonio Gallardo wrote:
>Hi:
>
>Sorry, this was my fault.
>
>I am learning while trying to work. Now, I know the problem is not related
>to Cocoon, but since I think many other people on the list will benefit
>for this. I decided to post the solution:
>
>The JDO specification said (chapter 14.6.1 page 105):
><snip>
>14.6.1 Query Execution
>
>The Query interface provides methods that execute the query based on the
>parameters given. They return an unmodificable Collection.....
></snip>
>
>The last sentence is the root of the problem. I got this Collection and
>tried to modify it by adding a new row to the woody repeater. This is why
>I got the error described in the first mail of the thread.
>
>At this point Flow+Woody+OJBwithJDO is working fine. I will continue the
>tests. :-D
>
>
Interesting point to know, but I'm not sure this is _the_ reason.
Looking at the exception, it looks more like a JXPath problem (cannot
find a property write method or something like that). Or is there
another chained exception that you did not post?
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
[SOLUTION] - Re: [Woody binding] - o.a.commons.jxpath.JXPathException: Exception trying to create xpath areas[7]; InsertBean jxpath factory failed.
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi:
Sorry, this was my fault.
I am learning while trying to work. Now, I know the problem is not related
to Cocoon, but since I think many other people on the list will benefit
for this. I decided to post the solution:
The JDO specification said (chapter 14.6.1 page 105):
<snip>
14.6.1 Query Execution
The Query interface provides methods that execute the query based on the
parameters given. They return an unmodificable Collection.....
</snip>
The last sentence is the root of the problem. I got this Collection and
tried to modify it by adding a new row to the woody repeater. This is why
I got the error described in the first mail of the thread.
At this point Flow+Woody+OJBwithJDO is working fine. I will continue the
tests. :-D
Best Regards,
Antonio Gallardo