You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Csaba Győrffy <cs...@gmail.com> on 2011/04/30 03:02:09 UTC

[Jelly] XML ForEach tag hangs

Hello there!

I'm trying to use the ForEach tag in Jelly's XML tag library. The
following script works fine in a standard Java console application:

<x:parse var="doc">
  <a>
    <b v="1"/>
    <b v="2"/>
    <b v="3"/>
  </a>
</x:parse>

<x:forEach select="$doc/a/b" var="x">
  ...
</x:forEach>

However, if using Jelly on an application server, from inside an EJB
container (session bean), running the script above hangs, and 100% CPU
utilisation comes. I realized while debugging that NodeComparator
class' getDepth method gets into an infinite loop and never returns.

If I remove two "b" elements from the xml fragment above (so only one
remains), it works fine. It also works if I change the second part of
the above script to the following:

<x:forEach select="$doc/a">
  <x:forEach select="b">
    ...
  </x:forEach>
</x:forEach>

Does anyone have any idea why is that happening? Any help is much appreciated.

Thank you:
Csaba

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
Yes, beta was in commons-jelly-1.0.zip downloaded from the project's page.
After replaxing all jaxen jars with the beta the result was the same,
spinning @ 100%

Thanks again for all your help.

Csaba

2011/5/1 Paul Libbrecht <pa...@hoplahup.net>:
> Csaba,
>
> googling around about websphere and old jars should ring some bells, I've heard lots about jdom in this respect.
>
> Just for fun, you could try to replace all jaxen's by the beta and see if it also works. It would then be something that classes are loaded here and there and end-up be incompatible.
>
> Was that beta delivered with jelly?
>
> paul
>
>
> Le 1 mai 2011 à 00:10, Csaba Győrffy a écrit :
>
>> My standard Java app used the same (1.1-beta) version of the older jar
>> without a problem. Why didn't it work inside the app server?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Csaba, 

googling around about websphere and old jars should ring some bells, I've heard lots about jdom in this respect.

Just for fun, you could try to replace all jaxen's by the beta and see if it also works. It would then be something that classes are loaded here and there and end-up be incompatible.

Was that beta delivered with jelly?

paul


Le 1 mai 2011 à 00:10, Csaba Győrffy a écrit :

> My standard Java app used the same (1.1-beta) version of the older jar
> without a problem. Why didn't it work inside the app server?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
And it's working now!:) Wow Paul, thank you very very much. Replaced
jaxen jar inside {jelly}\lib with the 1.1.1 version, re-added to the
app's classpath and my original example and all of yours are working
now.

My standard Java app used the same (1.1-beta) version of the older jar
without a problem. Why didn't it work inside the app server?

2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
>
> Le 30 avr. 2011 à 23:27, Csaba Győrffy a écrit :
>
>>> That is very dark indeed!
>>> Can you use find to see where that jaxen is?
>> I have jaxen-1.1-beta-4.jar in my {jelly}\lib folder. I also have
>> jaxen-1.1-beta-8.jar and jaxen-1.1.1.jar in two locations which are
>> definitely not on the application's/app server's classpath.
>
> going to 1.1.1 for all of them seems like a good idea to me.
>
> paul
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Le 30 avr. 2011 à 23:27, Csaba Győrffy a écrit :

>> That is very dark indeed!
>> Can you use find to see where that jaxen is?
> I have jaxen-1.1-beta-4.jar in my {jelly}\lib folder. I also have
> jaxen-1.1-beta-8.jar and jaxen-1.1.1.jar in two locations which are
> definitely not on the application's/app server's classpath.

going to 1.1.1 for all of them seems like a good idea to me.

paul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
> Actually that's good news to my eyes. The guilty is probably jaxen then.
> Try removing the last line, just keep:
>  <x:set select="$doc/a/b" var="x"/>
> it should still spin 100%.
Yes, it still spins 100%.

> That is very dark indeed!
> Can you use find to see where that jaxen is?
I have jaxen-1.1-beta-4.jar in my {jelly}\lib folder. I also have
jaxen-1.1-beta-8.jar and jaxen-1.1.1.jar in two locations which are
definitely not on the application's/app server's classpath.

> Or google around to see how this bundlerresource resolves to?
> You could also explore xx.getClass().getClassLoader to see whether it offers something such as a getURL method.
I'm investigating it...

2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
>
> Le 30 avr. 2011 à 22:35, Csaba Győrffy a écrit :
>
>>> does it also spin 100%?
>>>
>> Yes, it is:/
>
> Actually that's good news to my eyes. The guilty is probably jaxen then.
> Try removing the last line, just keep:
>  <x:set select="$doc/a/b" var="x"/>
> it should still spin 100%.
> If not, we need to try more things.
>
>>> Also, could you please try to see the origin a jaxen class? (e.g. org.jaxen.Context ?)
>> Origin of org.jaxen.Context is: bundleresource://106/org/jaxen/Context.class
>> I'm afraid this is not in the form you'd like to see...
>
> That is very dark indeed!
> Can you use find to see where that jaxen is?
> Or google around to see how this bundlerresource resolves to?
> You could also explore xx.getClass().getClassLoader to see whether it offers something such as a getURL method.
>
>>> What about the version of the jelly xml tag? e.g org.apache.commons.jelly.tags.xml.SetTag ?
>> SetTag is in commons-jelly-tags-xml-1.1.jar. Is this the version
>> you're interested in?
>
> That is a recent version, no complaint here!
>
> paul
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Le 30 avr. 2011 à 22:35, Csaba Győrffy a écrit :

>> does it also spin 100%?
>> 
> Yes, it is:/

Actually that's good news to my eyes. The guilty is probably jaxen then.
Try removing the last line, just keep:
  <x:set select="$doc/a/b" var="x"/>
it should still spin 100%.
If not, we need to try more things.

>> Also, could you please try to see the origin a jaxen class? (e.g. org.jaxen.Context ?)
> Origin of org.jaxen.Context is: bundleresource://106/org/jaxen/Context.class
> I'm afraid this is not in the form you'd like to see...

That is very dark indeed!
Can you use find to see where that jaxen is?
Or google around to see how this bundlerresource resolves to?
You could also explore xx.getClass().getClassLoader to see whether it offers something such as a getURL method.

>> What about the version of the jelly xml tag? e.g org.apache.commons.jelly.tags.xml.SetTag ?
> SetTag is in commons-jelly-tags-xml-1.1.jar. Is this the version
> you're interested in?

That is a recent version, no complaint here!

paul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
Hi Paul, please see my answers below.

> Can you try:
>
> <x:parse var="doc">
>  <a>
>   <b v="1"/>
>   <b v="2"/>
>   <b v="3"/>
>  </a>
> </x:parse>
>
> <x:set select="$doc/a/b" var="x"/>
>
> x is ${x} of class ${x.getClass()} and of size ${size(x)}
>
>
> does it also spin 100%?
>
Yes, it is:/

> Also, could you please try to see the origin a jaxen class? (e.g. org.jaxen.Context ?)
Origin of org.jaxen.Context is: bundleresource://106/org/jaxen/Context.class
I'm afraid this is not in the form you'd like to see...

> What about the version of the jelly xml tag? e.g org.apache.commons.jelly.tags.xml.SetTag ?
SetTag is in commons-jelly-tags-xml-1.1.jar. Is this the version
you're interested in?

Many thanks, Paul!

Csaba

2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
> Csaba,
>
> this sounds real dark...
>
> Can you try:
>
> <x:parse var="doc">
>  <a>
>   <b v="1"/>
>   <b v="2"/>
>   <b v="3"/>
>  </a>
> </x:parse>
>
> <x:set select="$doc/a/b" var="x"/>
>
> x is ${x} of class ${x.getClass()} and of size ${size(x)}
>
>
> does it also spin 100%?
>
> Also, could you please try to see the origin a jaxen class? (e.g. org.jaxen.Context ?)
> What about the version of the jelly xml tag? e.g org.apache.commons.jelly.tags.xml.SetTag ?
>
> thanks in advance
>
> paul
>
>
>
> Le 30 avr. 2011 à 20:16, Csaba Győrffy a écrit :
>
>> If I'm running Paul's script from a standard Java app, DefaultHandler
>> gets loaded from an xml.jar different than the one I mentioned
>> earlier. So, I tried to replace WebSphere's version with the "good"
>> version of xml.jar, but the result is the same: processing of a script
>> with foreach tag hangs, 100% CPU utilization.
>>
>> Origin of DefaultDocument class is the same, no matter if using app
>> server or not. Do you have any idea why it's not working inside the
>> app server?
>>
>> Thanks.
>>
>> Csaba
>>
>> 2011/4/30 Csaba Győrffy <cs...@gmail.com>:
>>> DefaultDocument comes from a Jelly library, while DefaultHandler is
>>> from a WebSphere jar:
>>>
>>> class org.dom4j.tree.DefaultDocument loaded from
>>> wsjar:file:/C:/Documents and
>>> Settings/usr/Desktop/commons-jelly-1.0/lib/dom4j-1.5.2.jar!/org/dom4j/tree/DefaultDocument.class
>>> class org.xml.sax.helpers.DefaultHandler loaded from
>>> jar:file:/C:/Program%20Files/ibm/WebSphere/AppServer1/java/jre/lib/xml.jar!/org/xml/sax/helpers/DefaultHandler.class
>>>
>>> 2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
>>>> Here's a little script that will tell you the URL of classes of interest:
>>>>
>>>> <j:jelly trim="false" xmlns:j="jelly:core">
>>>>
>>>>  <j:new var="x" className="org.dom4j.tree.DefaultDocument"/>
>>>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultDocument.class')}
>>>>
>>>>  <j:new var="x" className="org.xml.sax.helpers.DefaultHandler"/>
>>>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultHandler.class')}
>>>>
>>>> </j:jelly>
>>>>
>>>> With some chances, your URLs are of the form file:///xxxxx.jar!a/b/c/d/e.class
>>>> If you have a special protocol-handler, it may be harder.
>>>>
>>>> paul
>>>>
>>>>
>>>> Le 30 avr. 2011 à 15:40, Csaba Győrffy a écrit :
>>>>
>>>>> Hi,
>>>>>
>>>>> thank you very much for your responses. I'm already trying to
>>>>> determine the version of xml parser without much success yet.
>>>>>
>>>>> Csaba
>>>>>
>>>>> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
>>>>>>
>>>>>> trying not to point fingers (at least until we have ALL the facts)
>>>>>> a similar incident happened on another apache project and an older version of xml-parser was at fault
>>>>>> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>>>>>>
>>>>>> thanks paul!
>>>>>> Martin
>>>>>> ______________________________________________
>>>>>> Jogi és Bizalmassági kinyilatkoztatás
>>>>>>  Ez az
>>>>>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>>>>>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>>>>>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>>>>>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>>>>>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>>>>>> ezen üzenet tartalma miatt.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Subject: Re: [Jelly] XML ForEach tag hangs
>>>>>>> From: paul@hoplahup.net
>>>>>>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>>>>>>> To: user@commons.apache.org
>>>>>>>
>>>>>>> Csaba,
>>>>>>>
>>>>>>> As Martin has suggested, the underlying XML parser could be guilty.
>>>>>>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>>>>>>
>>>>>>> Are you able to find their version?
>>>>>>> Otherwise I can dig out a form of jwhich in jelly.
>>>>>>>
>>>>>>> paul
>>>>>>>
>>>>>>>
>>>>>>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>>>>>>
>>>>>>>> Hello there!
>>>>>>>>
>>>>>>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>>>>>>> following script works fine in a standard Java console application:
>>>>>>>>
>>>>>>>> <x:parse var="doc">
>>>>>>>>  <a>
>>>>>>>>    <b v="1"/>
>>>>>>>>    <b v="2"/>
>>>>>>>>    <b v="3"/>
>>>>>>>>  </a>
>>>>>>>> </x:parse>
>>>>>>>>
>>>>>>>> <x:forEach select="$doc/a/b" var="x">
>>>>>>>>  ...
>>>>>>>> </x:forEach>
>>>>>>>>
>>>>>>>> However, if using Jelly on an application server, from inside an EJB
>>>>>>>> container (session bean), running the script above hangs, and 100% CPU
>>>>>>>> utilisation comes. I realized while debugging that NodeComparator
>>>>>>>> class' getDepth method gets into an infinite loop and never returns.
>>>>>>>>
>>>>>>>> If I remove two "b" elements from the xml fragment above (so only one
>>>>>>>> remains), it works fine. It also works if I change the second part of
>>>>>>>> the above script to the following:
>>>>>>>>
>>>>>>>> <x:forEach select="$doc/a">
>>>>>>>>  <x:forEach select="b">
>>>>>>>>    ...
>>>>>>>>  </x:forEach>
>>>>>>>> </x:forEach>
>>>>>>>>
>>>>>>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>>>>>>>
>>>>>>>> Thank you:
>>>>>>>> Csaba
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Csaba,

this sounds real dark...

Can you try:

<x:parse var="doc">
 <a>
   <b v="1"/>
   <b v="2"/>
   <b v="3"/>
 </a>
</x:parse>

<x:set select="$doc/a/b" var="x"/>

x is ${x} of class ${x.getClass()} and of size ${size(x)}


does it also spin 100%?

Also, could you please try to see the origin a jaxen class? (e.g. org.jaxen.Context ?)
What about the version of the jelly xml tag? e.g org.apache.commons.jelly.tags.xml.SetTag ?

thanks in advance

paul



Le 30 avr. 2011 à 20:16, Csaba Győrffy a écrit :

> If I'm running Paul's script from a standard Java app, DefaultHandler
> gets loaded from an xml.jar different than the one I mentioned
> earlier. So, I tried to replace WebSphere's version with the "good"
> version of xml.jar, but the result is the same: processing of a script
> with foreach tag hangs, 100% CPU utilization.
> 
> Origin of DefaultDocument class is the same, no matter if using app
> server or not. Do you have any idea why it's not working inside the
> app server?
> 
> Thanks.
> 
> Csaba
> 
> 2011/4/30 Csaba Győrffy <cs...@gmail.com>:
>> DefaultDocument comes from a Jelly library, while DefaultHandler is
>> from a WebSphere jar:
>> 
>> class org.dom4j.tree.DefaultDocument loaded from
>> wsjar:file:/C:/Documents and
>> Settings/usr/Desktop/commons-jelly-1.0/lib/dom4j-1.5.2.jar!/org/dom4j/tree/DefaultDocument.class
>> class org.xml.sax.helpers.DefaultHandler loaded from
>> jar:file:/C:/Program%20Files/ibm/WebSphere/AppServer1/java/jre/lib/xml.jar!/org/xml/sax/helpers/DefaultHandler.class
>> 
>> 2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
>>> Here's a little script that will tell you the URL of classes of interest:
>>> 
>>> <j:jelly trim="false" xmlns:j="jelly:core">
>>> 
>>>  <j:new var="x" className="org.dom4j.tree.DefaultDocument"/>
>>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultDocument.class')}
>>> 
>>>  <j:new var="x" className="org.xml.sax.helpers.DefaultHandler"/>
>>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultHandler.class')}
>>> 
>>> </j:jelly>
>>> 
>>> With some chances, your URLs are of the form file:///xxxxx.jar!a/b/c/d/e.class
>>> If you have a special protocol-handler, it may be harder.
>>> 
>>> paul
>>> 
>>> 
>>> Le 30 avr. 2011 à 15:40, Csaba Győrffy a écrit :
>>> 
>>>> Hi,
>>>> 
>>>> thank you very much for your responses. I'm already trying to
>>>> determine the version of xml parser without much success yet.
>>>> 
>>>> Csaba
>>>> 
>>>> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
>>>>> 
>>>>> trying not to point fingers (at least until we have ALL the facts)
>>>>> a similar incident happened on another apache project and an older version of xml-parser was at fault
>>>>> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>>>>> 
>>>>> thanks paul!
>>>>> Martin
>>>>> ______________________________________________
>>>>> Jogi és Bizalmassági kinyilatkoztatás
>>>>>  Ez az
>>>>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>>>>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>>>>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>>>>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>>>>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>>>>> ezen üzenet tartalma miatt.
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> Subject: Re: [Jelly] XML ForEach tag hangs
>>>>>> From: paul@hoplahup.net
>>>>>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>>>>>> To: user@commons.apache.org
>>>>>> 
>>>>>> Csaba,
>>>>>> 
>>>>>> As Martin has suggested, the underlying XML parser could be guilty.
>>>>>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>>>>> 
>>>>>> Are you able to find their version?
>>>>>> Otherwise I can dig out a form of jwhich in jelly.
>>>>>> 
>>>>>> paul
>>>>>> 
>>>>>> 
>>>>>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>>>>> 
>>>>>>> Hello there!
>>>>>>> 
>>>>>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>>>>>> following script works fine in a standard Java console application:
>>>>>>> 
>>>>>>> <x:parse var="doc">
>>>>>>>  <a>
>>>>>>>    <b v="1"/>
>>>>>>>    <b v="2"/>
>>>>>>>    <b v="3"/>
>>>>>>>  </a>
>>>>>>> </x:parse>
>>>>>>> 
>>>>>>> <x:forEach select="$doc/a/b" var="x">
>>>>>>>  ...
>>>>>>> </x:forEach>
>>>>>>> 
>>>>>>> However, if using Jelly on an application server, from inside an EJB
>>>>>>> container (session bean), running the script above hangs, and 100% CPU
>>>>>>> utilisation comes. I realized while debugging that NodeComparator
>>>>>>> class' getDepth method gets into an infinite loop and never returns.
>>>>>>> 
>>>>>>> If I remove two "b" elements from the xml fragment above (so only one
>>>>>>> remains), it works fine. It also works if I change the second part of
>>>>>>> the above script to the following:
>>>>>>> 
>>>>>>> <x:forEach select="$doc/a">
>>>>>>>  <x:forEach select="b">
>>>>>>>    ...
>>>>>>>  </x:forEach>
>>>>>>> </x:forEach>
>>>>>>> 
>>>>>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>>>>>> 
>>>>>>> Thank you:
>>>>>>> Csaba
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>> 
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>> 
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
If I'm running Paul's script from a standard Java app, DefaultHandler
gets loaded from an xml.jar different than the one I mentioned
earlier. So, I tried to replace WebSphere's version with the "good"
version of xml.jar, but the result is the same: processing of a script
with foreach tag hangs, 100% CPU utilization.

Origin of DefaultDocument class is the same, no matter if using app
server or not. Do you have any idea why it's not working inside the
app server?

Thanks.

Csaba

2011/4/30 Csaba Győrffy <cs...@gmail.com>:
> DefaultDocument comes from a Jelly library, while DefaultHandler is
> from a WebSphere jar:
>
> class org.dom4j.tree.DefaultDocument loaded from
> wsjar:file:/C:/Documents and
> Settings/usr/Desktop/commons-jelly-1.0/lib/dom4j-1.5.2.jar!/org/dom4j/tree/DefaultDocument.class
> class org.xml.sax.helpers.DefaultHandler loaded from
> jar:file:/C:/Program%20Files/ibm/WebSphere/AppServer1/java/jre/lib/xml.jar!/org/xml/sax/helpers/DefaultHandler.class
>
> 2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
>> Here's a little script that will tell you the URL of classes of interest:
>>
>> <j:jelly trim="false" xmlns:j="jelly:core">
>>
>>  <j:new var="x" className="org.dom4j.tree.DefaultDocument"/>
>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultDocument.class')}
>>
>>  <j:new var="x" className="org.xml.sax.helpers.DefaultHandler"/>
>>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultHandler.class')}
>>
>> </j:jelly>
>>
>> With some chances, your URLs are of the form file:///xxxxx.jar!a/b/c/d/e.class
>> If you have a special protocol-handler, it may be harder.
>>
>> paul
>>
>>
>> Le 30 avr. 2011 à 15:40, Csaba Győrffy a écrit :
>>
>>> Hi,
>>>
>>> thank you very much for your responses. I'm already trying to
>>> determine the version of xml parser without much success yet.
>>>
>>> Csaba
>>>
>>> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
>>>>
>>>> trying not to point fingers (at least until we have ALL the facts)
>>>> a similar incident happened on another apache project and an older version of xml-parser was at fault
>>>> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>>>>
>>>> thanks paul!
>>>> Martin
>>>> ______________________________________________
>>>> Jogi és Bizalmassági kinyilatkoztatás
>>>>  Ez az
>>>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>>>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>>>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>>>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>>>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>>>> ezen üzenet tartalma miatt.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Subject: Re: [Jelly] XML ForEach tag hangs
>>>>> From: paul@hoplahup.net
>>>>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>>>>> To: user@commons.apache.org
>>>>>
>>>>> Csaba,
>>>>>
>>>>> As Martin has suggested, the underlying XML parser could be guilty.
>>>>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>>>>
>>>>> Are you able to find their version?
>>>>> Otherwise I can dig out a form of jwhich in jelly.
>>>>>
>>>>> paul
>>>>>
>>>>>
>>>>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>>>>
>>>>>> Hello there!
>>>>>>
>>>>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>>>>> following script works fine in a standard Java console application:
>>>>>>
>>>>>> <x:parse var="doc">
>>>>>>  <a>
>>>>>>    <b v="1"/>
>>>>>>    <b v="2"/>
>>>>>>    <b v="3"/>
>>>>>>  </a>
>>>>>> </x:parse>
>>>>>>
>>>>>> <x:forEach select="$doc/a/b" var="x">
>>>>>>  ...
>>>>>> </x:forEach>
>>>>>>
>>>>>> However, if using Jelly on an application server, from inside an EJB
>>>>>> container (session bean), running the script above hangs, and 100% CPU
>>>>>> utilisation comes. I realized while debugging that NodeComparator
>>>>>> class' getDepth method gets into an infinite loop and never returns.
>>>>>>
>>>>>> If I remove two "b" elements from the xml fragment above (so only one
>>>>>> remains), it works fine. It also works if I change the second part of
>>>>>> the above script to the following:
>>>>>>
>>>>>> <x:forEach select="$doc/a">
>>>>>>  <x:forEach select="b">
>>>>>>    ...
>>>>>>  </x:forEach>
>>>>>> </x:forEach>
>>>>>>
>>>>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>>>>>
>>>>>> Thank you:
>>>>>> Csaba
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
DefaultDocument comes from a Jelly library, while DefaultHandler is
from a WebSphere jar:

class org.dom4j.tree.DefaultDocument loaded from
wsjar:file:/C:/Documents and
Settings/usr/Desktop/commons-jelly-1.0/lib/dom4j-1.5.2.jar!/org/dom4j/tree/DefaultDocument.class
class org.xml.sax.helpers.DefaultHandler loaded from
jar:file:/C:/Program%20Files/ibm/WebSphere/AppServer1/java/jre/lib/xml.jar!/org/xml/sax/helpers/DefaultHandler.class

2011/4/30 Paul Libbrecht <pa...@hoplahup.net>:
> Here's a little script that will tell you the URL of classes of interest:
>
> <j:jelly trim="false" xmlns:j="jelly:core">
>
>  <j:new var="x" className="org.dom4j.tree.DefaultDocument"/>
>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultDocument.class')}
>
>  <j:new var="x" className="org.xml.sax.helpers.DefaultHandler"/>
>  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultHandler.class')}
>
> </j:jelly>
>
> With some chances, your URLs are of the form file:///xxxxx.jar!a/b/c/d/e.class
> If you have a special protocol-handler, it may be harder.
>
> paul
>
>
> Le 30 avr. 2011 à 15:40, Csaba Győrffy a écrit :
>
>> Hi,
>>
>> thank you very much for your responses. I'm already trying to
>> determine the version of xml parser without much success yet.
>>
>> Csaba
>>
>> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
>>>
>>> trying not to point fingers (at least until we have ALL the facts)
>>> a similar incident happened on another apache project and an older version of xml-parser was at fault
>>> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>>>
>>> thanks paul!
>>> Martin
>>> ______________________________________________
>>> Jogi és Bizalmassági kinyilatkoztatás
>>>  Ez az
>>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>>> ezen üzenet tartalma miatt.
>>>
>>>
>>>
>>>
>>>
>>>> Subject: Re: [Jelly] XML ForEach tag hangs
>>>> From: paul@hoplahup.net
>>>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>>>> To: user@commons.apache.org
>>>>
>>>> Csaba,
>>>>
>>>> As Martin has suggested, the underlying XML parser could be guilty.
>>>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>>>
>>>> Are you able to find their version?
>>>> Otherwise I can dig out a form of jwhich in jelly.
>>>>
>>>> paul
>>>>
>>>>
>>>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>>>
>>>>> Hello there!
>>>>>
>>>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>>>> following script works fine in a standard Java console application:
>>>>>
>>>>> <x:parse var="doc">
>>>>>  <a>
>>>>>    <b v="1"/>
>>>>>    <b v="2"/>
>>>>>    <b v="3"/>
>>>>>  </a>
>>>>> </x:parse>
>>>>>
>>>>> <x:forEach select="$doc/a/b" var="x">
>>>>>  ...
>>>>> </x:forEach>
>>>>>
>>>>> However, if using Jelly on an application server, from inside an EJB
>>>>> container (session bean), running the script above hangs, and 100% CPU
>>>>> utilisation comes. I realized while debugging that NodeComparator
>>>>> class' getDepth method gets into an infinite loop and never returns.
>>>>>
>>>>> If I remove two "b" elements from the xml fragment above (so only one
>>>>> remains), it works fine. It also works if I change the second part of
>>>>> the above script to the following:
>>>>>
>>>>> <x:forEach select="$doc/a">
>>>>>  <x:forEach select="b">
>>>>>    ...
>>>>>  </x:forEach>
>>>>> </x:forEach>
>>>>>
>>>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>>>>
>>>>> Thank you:
>>>>> Csaba
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Here's a little script that will tell you the URL of classes of interest:

<j:jelly trim="false" xmlns:j="jelly:core">

  <j:new var="x" className="org.dom4j.tree.DefaultDocument"/>
  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultDocument.class')}

  <j:new var="x" className="org.xml.sax.helpers.DefaultHandler"/>
  class ${x.getClass()} loaded from ${x.getClass().getResource('DefaultHandler.class')}

</j:jelly>

With some chances, your URLs are of the form file:///xxxxx.jar!a/b/c/d/e.class
If you have a special protocol-handler, it may be harder.

paul


Le 30 avr. 2011 à 15:40, Csaba Győrffy a écrit :

> Hi,
> 
> thank you very much for your responses. I'm already trying to
> determine the version of xml parser without much success yet.
> 
> Csaba
> 
> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
>> 
>> trying not to point fingers (at least until we have ALL the facts)
>> a similar incident happened on another apache project and an older version of xml-parser was at fault
>> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>> 
>> thanks paul!
>> Martin
>> ______________________________________________
>> Jogi és Bizalmassági kinyilatkoztatás
>>  Ez az
>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>> ezen üzenet tartalma miatt.
>> 
>> 
>> 
>> 
>> 
>>> Subject: Re: [Jelly] XML ForEach tag hangs
>>> From: paul@hoplahup.net
>>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>>> To: user@commons.apache.org
>>> 
>>> Csaba,
>>> 
>>> As Martin has suggested, the underlying XML parser could be guilty.
>>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>> 
>>> Are you able to find their version?
>>> Otherwise I can dig out a form of jwhich in jelly.
>>> 
>>> paul
>>> 
>>> 
>>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>> 
>>>> Hello there!
>>>> 
>>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>>> following script works fine in a standard Java console application:
>>>> 
>>>> <x:parse var="doc">
>>>>  <a>
>>>>    <b v="1"/>
>>>>    <b v="2"/>
>>>>    <b v="3"/>
>>>>  </a>
>>>> </x:parse>
>>>> 
>>>> <x:forEach select="$doc/a/b" var="x">
>>>>  ...
>>>> </x:forEach>
>>>> 
>>>> However, if using Jelly on an application server, from inside an EJB
>>>> container (session bean), running the script above hangs, and 100% CPU
>>>> utilisation comes. I realized while debugging that NodeComparator
>>>> class' getDepth method gets into an infinite loop and never returns.
>>>> 
>>>> If I remove two "b" elements from the xml fragment above (so only one
>>>> remains), it works fine. It also works if I change the second part of
>>>> the above script to the following:
>>>> 
>>>> <x:forEach select="$doc/a">
>>>>  <x:forEach select="b">
>>>>    ...
>>>>  </x:forEach>
>>>> </x:forEach>
>>>> 
>>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>>> 
>>>> Thank you:
>>>> Csaba
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [Jelly] XML ForEach tag hangs

Posted by Martin Gainty <mg...@hotmail.com>.
if you are using a xml_parser_utility go to command line and type
bash>which xml_parser_utility

if not there is a build.xml and or pom.xml which will need to reference the xml-parser:

--in buildl.xml usually identified as a property to one of the constructed CLASSPATH
bash>vi build.xml
search for xml ( press / and type xml at bottom)
search for xerces (press / and type xerces at bottom)
quit vi (:q!)

--in pom.xml usually identified as a dependency
bash>vi  pom.xml 
search for xml ( press / and type xml at bottom)
search for xerces (press / and type xerces at bottom)
quit vi (:q!)

report back the exact version of the xml or xerces parser you see in either build.xml or pom.xml

thanks,
Martin 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.





> Date: Sat, 30 Apr 2011 15:40:53 +0200
> Subject: Re: [Jelly] XML ForEach tag hangs
> From: csabeee@gmail.com
> To: user@commons.apache.org
> 
> Hi,
> 
> thank you very much for your responses. I'm already trying to
> determine the version of xml parser without much success yet.
> 
> Csaba
> 
> 2011/4/30 Martin Gainty <mg...@hotmail.com>:
> >
> > trying not to point fingers (at least until we have ALL the facts)
> > a similar incident happened on another apache project and an older version of xml-parser was at fault
> > trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
> >
> > thanks paul!
> > Martin
> > ______________________________________________
> > Jogi és Bizalmassági kinyilatkoztatás
> >  Ez az
> > üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> > jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> > készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> > semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> > könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> > ezen üzenet tartalma miatt.
> >
> >
> >
> >
> >
> >> Subject: Re: [Jelly] XML ForEach tag hangs
> >> From: paul@hoplahup.net
> >> Date: Sat, 30 Apr 2011 09:44:27 +0200
> >> To: user@commons.apache.org
> >>
> >> Csaba,
> >>
> >> As Martin has suggested, the underlying XML parser could be guilty.
> >> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
> >>
> >> Are you able to find their version?
> >> Otherwise I can dig out a form of jwhich in jelly.
> >>
> >> paul
> >>
> >>
> >> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
> >>
> >> > Hello there!
> >> >
> >> > I'm trying to use the ForEach tag in Jelly's XML tag library. The
> >> > following script works fine in a standard Java console application:
> >> >
> >> > <x:parse var="doc">
> >> >  <a>
> >> >    <b v="1"/>
> >> >    <b v="2"/>
> >> >    <b v="3"/>
> >> >  </a>
> >> > </x:parse>
> >> >
> >> > <x:forEach select="$doc/a/b" var="x">
> >> >  ...
> >> > </x:forEach>
> >> >
> >> > However, if using Jelly on an application server, from inside an EJB
> >> > container (session bean), running the script above hangs, and 100% CPU
> >> > utilisation comes. I realized while debugging that NodeComparator
> >> > class' getDepth method gets into an infinite loop and never returns.
> >> >
> >> > If I remove two "b" elements from the xml fragment above (so only one
> >> > remains), it works fine. It also works if I change the second part of
> >> > the above script to the following:
> >> >
> >> > <x:forEach select="$doc/a">
> >> >  <x:forEach select="b">
> >> >    ...
> >> >  </x:forEach>
> >> > </x:forEach>
> >> >
> >> > Does anyone have any idea why is that happening? Any help is much appreciated.
> >> >
> >> > Thank you:
> >> > Csaba
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> > For additional commands, e-mail: user-help@commons.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  

Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
Hi,

thank you very much for your responses. I'm already trying to
determine the version of xml parser without much success yet.

Csaba

2011/4/30 Martin Gainty <mg...@hotmail.com>:
>
> trying not to point fingers (at least until we have ALL the facts)
> a similar incident happened on another apache project and an older version of xml-parser was at fault
> trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser
>
> thanks paul!
> Martin
> ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
>
>
>
>
>
>> Subject: Re: [Jelly] XML ForEach tag hangs
>> From: paul@hoplahup.net
>> Date: Sat, 30 Apr 2011 09:44:27 +0200
>> To: user@commons.apache.org
>>
>> Csaba,
>>
>> As Martin has suggested, the underlying XML parser could be guilty.
>> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
>>
>> Are you able to find their version?
>> Otherwise I can dig out a form of jwhich in jelly.
>>
>> paul
>>
>>
>> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
>>
>> > Hello there!
>> >
>> > I'm trying to use the ForEach tag in Jelly's XML tag library. The
>> > following script works fine in a standard Java console application:
>> >
>> > <x:parse var="doc">
>> >  <a>
>> >    <b v="1"/>
>> >    <b v="2"/>
>> >    <b v="3"/>
>> >  </a>
>> > </x:parse>
>> >
>> > <x:forEach select="$doc/a/b" var="x">
>> >  ...
>> > </x:forEach>
>> >
>> > However, if using Jelly on an application server, from inside an EJB
>> > container (session bean), running the script above hangs, and 100% CPU
>> > utilisation comes. I realized while debugging that NodeComparator
>> > class' getDepth method gets into an infinite loop and never returns.
>> >
>> > If I remove two "b" elements from the xml fragment above (so only one
>> > remains), it works fine. It also works if I change the second part of
>> > the above script to the following:
>> >
>> > <x:forEach select="$doc/a">
>> >  <x:forEach select="b">
>> >    ...
>> >  </x:forEach>
>> > </x:forEach>
>> >
>> > Does anyone have any idea why is that happening? Any help is much appreciated.
>> >
>> > Thank you:
>> > Csaba
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: user-help@commons.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [Jelly] XML ForEach tag hangs

Posted by Martin Gainty <mg...@hotmail.com>.
trying not to point fingers (at least until we have ALL the facts)
a similar incident happened on another apache project and an older version of xml-parser was at fault 
trying to determine the implemented xml-parser and the version in this case would *at least* isolate the problem to that parser

thanks paul!
Martin  
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.





> Subject: Re: [Jelly] XML ForEach tag hangs
> From: paul@hoplahup.net
> Date: Sat, 30 Apr 2011 09:44:27 +0200
> To: user@commons.apache.org
> 
> Csaba,
> 
> As Martin has suggested, the underlying XML parser could be guilty.
> I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).
> 
> Are you able to find their version?
> Otherwise I can dig out a form of jwhich in jelly.
> 
> paul
> 
> 
> Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :
> 
> > Hello there!
> > 
> > I'm trying to use the ForEach tag in Jelly's XML tag library. The
> > following script works fine in a standard Java console application:
> > 
> > <x:parse var="doc">
> >  <a>
> >    <b v="1"/>
> >    <b v="2"/>
> >    <b v="3"/>
> >  </a>
> > </x:parse>
> > 
> > <x:forEach select="$doc/a/b" var="x">
> >  ...
> > </x:forEach>
> > 
> > However, if using Jelly on an application server, from inside an EJB
> > container (session bean), running the script above hangs, and 100% CPU
> > utilisation comes. I realized while debugging that NodeComparator
> > class' getDepth method gets into an infinite loop and never returns.
> > 
> > If I remove two "b" elements from the xml fragment above (so only one
> > remains), it works fine. It also works if I change the second part of
> > the above script to the following:
> > 
> > <x:forEach select="$doc/a">
> >  <x:forEach select="b">
> >    ...
> >  </x:forEach>
> > </x:forEach>
> > 
> > Does anyone have any idea why is that happening? Any help is much appreciated.
> > 
> > Thank you:
> > Csaba
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  

Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Csaba,

As Martin has suggested, the underlying XML parser could be guilty.
I would rather suspect an overly old dom4j or jaxen (that would be in the container's classpath hence overriding the webapp's).

Are you able to find their version?
Otherwise I can dig out a form of jwhich in jelly.

paul


Le 30 avr. 2011 à 03:02, Csaba Győrffy a écrit :

> Hello there!
> 
> I'm trying to use the ForEach tag in Jelly's XML tag library. The
> following script works fine in a standard Java console application:
> 
> <x:parse var="doc">
>  <a>
>    <b v="1"/>
>    <b v="2"/>
>    <b v="3"/>
>  </a>
> </x:parse>
> 
> <x:forEach select="$doc/a/b" var="x">
>  ...
> </x:forEach>
> 
> However, if using Jelly on an application server, from inside an EJB
> container (session bean), running the script above hangs, and 100% CPU
> utilisation comes. I realized while debugging that NodeComparator
> class' getDepth method gets into an infinite loop and never returns.
> 
> If I remove two "b" elements from the xml fragment above (so only one
> remains), it works fine. It also works if I change the second part of
> the above script to the following:
> 
> <x:forEach select="$doc/a">
>  <x:forEach select="b">
>    ...
>  </x:forEach>
> </x:forEach>
> 
> Does anyone have any idea why is that happening? Any help is much appreciated.
> 
> Thank you:
> Csaba
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [Jelly] XML ForEach tag hangs

Posted by Martin Gainty <mg...@hotmail.com>.
jelly.properties contains the declarator for xml defined as follows:
xml         = org.apache.commons.jelly.tags.xml.XMLTagLibrary

suite.jelly contains a testcase for Czaba defined as follows:
<test:suite 
    xmlns:x="jelly:xml" 
    xmlns:test="jelly:junit">
  <test:case name="Czabo">
    <x:parse var="doc">
       <a>
         <b v="1"/>
         <b v="2"/>
         <b v="3"/>
       </a>
    </x:parse>
     <x:forEach select="$doc/a/b" var="x">
       <x:set var="c" select="$doc/a/b"/>
       <document>
         The current Element name and value is ${c} 
       </document>
    </x:forEach>  
  </test:case>
  
</test:suite>

produces this output:
$JELLY_HOME\test-classes>java -classpath .;DOM4J_HOME\target\classes;.\target\classes org.apache.commons.jelly.TestJelly

.<document>The current Element name and value is [org.dom4j.tree.DefaultElement@1815859 [Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@cf40f5 [Attribute: name v value "1"]]/>], 
org.dom4j.tree.DefaultElement@b1c260 [Element: <b 
at
tributes: [org.dom4j.tree.DefaultAttribute@503429 [Attribute: name v value "2"]]
/>], 
org.dom4j.tree.DefaultElement@1908ca1 [Element: <b attributes: [org.dom4j.tree.DefaultAttribute@100ab23 [Attribute: name v value "3"]]/>]]</document><document>
The current Element name and value is 
[org.dom4j.tree.DefaultElement@1815859
[Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@cf40f5 [Attribute: name v value "1"]]/>], org.dom4j.tree.DefaultElement@b1c260 [Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@503429 [Attribute: name v value "2"]]/>], org.dom4j.tree.DefaultElement@1908ca1 [Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@100ab23 [Attribute: name v value "3"]]/>]]</document><document>
The current Element name and value is 
[org.dom4j.tree.DefaultElement@1815859 
[Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@cf40f5 [Attribute: name v value "1"]]/>], org.dom4j.tree.DefaultElement@b1c260 [Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@503429 [Attribute: name v value "2"]]/>], org.dom4j.tree.DefaultElement@1908ca1 [Element: 
<b attributes: [org.dom4j.tree.DefaultAttribute@100ab23 [Attribute: name v value "3"]]/>]]</document>
Time: 0.172

from what i see here the parse and for-each iterator seems to be working for Jelly 1.0

Thanks Paul!
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.





> Subject: Re: [Jelly] XML ForEach tag hangs
> From: paul@hoplahup.net
> Date: Tue, 3 May 2011 23:51:53 +0200
> To: user@commons.apache.org
> 
> Martin,
> 
> your x namespace prefix is not properly bound.
> Somewhere up in your script, you should have 
> 
> xmlns:x="jelly:xml"
> 
> hope it helps.
> 
> paul
> 
> 
> Le 3 mai 2011 à 22:59, Martin Gainty a écrit :
> 
> > 
> > org.apache.commons.jelly.JellyException: file:/C:/maven-plugin/jelly/commons-jel
> > ly-1.0-src/test-classes/org/apache/commons/jelly/suite.jelly:29:43: <x:forEach>
> > This tag does not understand the 'select' attribute
> >     at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:232)
> >     at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
> >     at org.apache.commons.jelly.tags.junit.CaseTag$1.runTest(CaseTag.java:59
> > )
> >     at org.apache.commons.jelly.TestJelly.main(TestJelly.java:32)
> > 
> > my ForEach tag doesnt support 'select' attribute
> > any idea where i can obtain the ForEach Tag with select attribute would be appreciated!
> > 
> > regarding parsers:
> > $JELLY_HOME>grep -S -l ".xerces" *.java
> > -----------
> > $JELLY_HOME>grep -S -l ".dom4j" *.java
> > .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\XMLOutput.java
> > .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\expression\xpath\XPath
> > Expression.java
> > .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\tags\core\FileTag.java
> > .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\xpath\XPathComparator.java
> > .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\core\TestFileTag.java
> > .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\test\xml\TestCData.java
> > 
> > looking good for dom4j (working) 
> > Martin Gainty 
> > ______________________________________________ 
> > Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> > Ez az
> > üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> > jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> > készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> > semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> > könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> > ezen üzenet tartalma miatt.
> > 
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> > 
> > 
> > 
> > 
> >> From: mgainty@hotmail.com
> >> To: user@commons.apache.org
> >> Subject: RE: [Jelly] XML ForEach tag hangs
> >> Date: Fri, 29 Apr 2011 21:06:27 -0400
> >> 
> >> 
> >> Czaba
> >> 
> >> which xml-parser are you implementing?
> >> what is the version of which xml-parser you are implementing?
> >> 
> >> Martin 
> >> ______________________________________________ 
> >> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >> Ez az
> >> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> >> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> >> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> >> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> >> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> >> ezen üzenet tartalma miatt.
> >> 
> >> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> >> 
> >> 
> >> 
> >> 
> >>> Date: Sat, 30 Apr 2011 03:02:09 +0200
> >>> Subject: [Jelly] XML ForEach tag hangs
> >>> From: csabeee@gmail.com
> >>> To: user@commons.apache.org
> >>> 
> >>> Hello there!
> >>> 
> >>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
> >>> following script works fine in a standard Java console application:
> >>> 
> >>> <x:parse var="doc">
> >>> <a>
> >>> <b v="1"/>
> >>> <b v="2"/>
> >>> <b v="3"/>
> >>> </a>
> >>> </x:parse>
> >>> 
> >>> <x:forEach select="$doc/a/b" var="x">
> >>> ...
> >>> </x:forEach>
> >>> 
> >>> However, if using Jelly on an application server, from inside an EJB
> >>> container (session bean), running the script above hangs, and 100% CPU
> >>> utilisation comes. I realized while debugging that NodeComparator
> >>> class' getDepth method gets into an infinite loop and never returns.
> >>> 
> >>> If I remove two "b" elements from the xml fragment above (so only one
> >>> remains), it works fine. It also works if I change the second part of
> >>> the above script to the following:
> >>> 
> >>> <x:forEach select="$doc/a">
> >>> <x:forEach select="b">
> >>> ...
> >>> </x:forEach>
> >>> </x:forEach>
> >>> 
> >>> Does anyone have any idea why is that happening? Any help is much appreciated.
> >>> 
> >>> Thank you:
> >>> Csaba
> >>> 
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>> For additional commands, e-mail: user-help@commons.apache.org
> >>> 
> >> 		 	   		  
> > 		 	   		  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  

Re: [Jelly] XML ForEach tag hangs

Posted by Paul Libbrecht <pa...@hoplahup.net>.
Martin,

your x namespace prefix is not properly bound.
Somewhere up in your script, you should have 

xmlns:x="jelly:xml"

hope it helps.

paul


Le 3 mai 2011 à 22:59, Martin Gainty a écrit :

> 
> org.apache.commons.jelly.JellyException: file:/C:/maven-plugin/jelly/commons-jel
> ly-1.0-src/test-classes/org/apache/commons/jelly/suite.jelly:29:43: <x:forEach>
> This tag does not understand the 'select' attribute
>     at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:232)
>     at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
>     at org.apache.commons.jelly.tags.junit.CaseTag$1.runTest(CaseTag.java:59
> )
>     at org.apache.commons.jelly.TestJelly.main(TestJelly.java:32)
> 
> my ForEach tag doesnt support 'select' attribute
> any idea where i can obtain the ForEach Tag with select attribute would be appreciated!
> 
> regarding parsers:
> $JELLY_HOME>grep -S -l ".xerces" *.java
> -----------
> $JELLY_HOME>grep -S -l ".dom4j" *.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\XMLOutput.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\expression\xpath\XPath
> Expression.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\tags\core\FileTag.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\xpath\XPathComparator.java
> .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\core\TestFileTag.java
> .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\test\xml\TestCData.java
> 
> looking good for dom4j (working) 
> Martin Gainty 
> ______________________________________________ 
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
> 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
>> From: mgainty@hotmail.com
>> To: user@commons.apache.org
>> Subject: RE: [Jelly] XML ForEach tag hangs
>> Date: Fri, 29 Apr 2011 21:06:27 -0400
>> 
>> 
>> Czaba
>> 
>> which xml-parser are you implementing?
>> what is the version of which xml-parser you are implementing?
>> 
>> Martin 
>> ______________________________________________ 
>> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>> Ez az
>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>> ezen üzenet tartalma miatt.
>> 
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>> 
>> 
>> 
>> 
>>> Date: Sat, 30 Apr 2011 03:02:09 +0200
>>> Subject: [Jelly] XML ForEach tag hangs
>>> From: csabeee@gmail.com
>>> To: user@commons.apache.org
>>> 
>>> Hello there!
>>> 
>>> I'm trying to use the ForEach tag in Jelly's XML tag library. The
>>> following script works fine in a standard Java console application:
>>> 
>>> <x:parse var="doc">
>>> <a>
>>> <b v="1"/>
>>> <b v="2"/>
>>> <b v="3"/>
>>> </a>
>>> </x:parse>
>>> 
>>> <x:forEach select="$doc/a/b" var="x">
>>> ...
>>> </x:forEach>
>>> 
>>> However, if using Jelly on an application server, from inside an EJB
>>> container (session bean), running the script above hangs, and 100% CPU
>>> utilisation comes. I realized while debugging that NodeComparator
>>> class' getDepth method gets into an infinite loop and never returns.
>>> 
>>> If I remove two "b" elements from the xml fragment above (so only one
>>> remains), it works fine. It also works if I change the second part of
>>> the above script to the following:
>>> 
>>> <x:forEach select="$doc/a">
>>> <x:forEach select="b">
>>> ...
>>> </x:forEach>
>>> </x:forEach>
>>> 
>>> Does anyone have any idea why is that happening? Any help is much appreciated.
>>> 
>>> Thank you:
>>> Csaba
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>> 
>> 		 	   		  
> 		 	   		  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Jelly] XML ForEach tag hangs

Posted by Csaba Győrffy <cs...@gmail.com>.
Hi Martin

I had this exception when tried to use select attribute with the core
tag library's forEach tag, which doesn't support it. Anyway, I'm using
the binaries downloaded from the project Download site:
http://commons.apache.org/jelly/download_jelly.cgi and XML tag lib's
foreach is working for me with the select attribute.

Csaba

2011/5/3 Martin Gainty <mg...@hotmail.com>:
>
> org.apache.commons.jelly.JellyException: file:/C:/maven-plugin/jelly/commons-jel
> ly-1.0-src/test-classes/org/apache/commons/jelly/suite.jelly:29:43: <x:forEach>
> This tag does not understand the 'select' attribute
>        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:232)
>        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
>        at org.apache.commons.jelly.tags.junit.CaseTag$1.runTest(CaseTag.java:59
> )
>        at org.apache.commons.jelly.TestJelly.main(TestJelly.java:32)
>
> my ForEach tag doesnt support 'select' attribute
> any idea where i can obtain the ForEach Tag with select attribute would be appreciated!
>
> regarding parsers:
> $JELLY_HOME>grep -S -l ".xerces" *.java
> -----------
> $JELLY_HOME>grep -S -l ".dom4j" *.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\XMLOutput.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\expression\xpath\XPath
> Expression.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\tags\core\FileTag.java
> .\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\xpath\XPathComparator.java
> .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\core\TestFileTag.java
> .\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\test\xml\TestCData.java
>
> looking good for dom4j (working)
> Martin Gainty
> ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> From: mgainty@hotmail.com
>> To: user@commons.apache.org
>> Subject: RE: [Jelly] XML ForEach tag hangs
>> Date: Fri, 29 Apr 2011 21:06:27 -0400
>>
>>
>> Czaba
>>
>> which xml-parser are you implementing?
>> what is the version of which xml-parser you are implementing?
>>
>> Martin
>> ______________________________________________
>> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>  Ez az
>> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
>> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
>> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
>> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
>> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
>> ezen üzenet tartalma miatt.
>>
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>>
>>
>>
>>
>> > Date: Sat, 30 Apr 2011 03:02:09 +0200
>> > Subject: [Jelly] XML ForEach tag hangs
>> > From: csabeee@gmail.com
>> > To: user@commons.apache.org
>> >
>> > Hello there!
>> >
>> > I'm trying to use the ForEach tag in Jelly's XML tag library. The
>> > following script works fine in a standard Java console application:
>> >
>> > <x:parse var="doc">
>> >   <a>
>> >     <b v="1"/>
>> >     <b v="2"/>
>> >     <b v="3"/>
>> >   </a>
>> > </x:parse>
>> >
>> > <x:forEach select="$doc/a/b" var="x">
>> >   ...
>> > </x:forEach>
>> >
>> > However, if using Jelly on an application server, from inside an EJB
>> > container (session bean), running the script above hangs, and 100% CPU
>> > utilisation comes. I realized while debugging that NodeComparator
>> > class' getDepth method gets into an infinite loop and never returns.
>> >
>> > If I remove two "b" elements from the xml fragment above (so only one
>> > remains), it works fine. It also works if I change the second part of
>> > the above script to the following:
>> >
>> > <x:forEach select="$doc/a">
>> >   <x:forEach select="b">
>> >     ...
>> >   </x:forEach>
>> > </x:forEach>
>> >
>> > Does anyone have any idea why is that happening? Any help is much appreciated.
>> >
>> > Thank you:
>> > Csaba
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: user-help@commons.apache.org
>> >
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [Jelly] XML ForEach tag hangs

Posted by Martin Gainty <mg...@hotmail.com>.
org.apache.commons.jelly.JellyException: file:/C:/maven-plugin/jelly/commons-jel
ly-1.0-src/test-classes/org/apache/commons/jelly/suite.jelly:29:43: <x:forEach>
This tag does not understand the 'select' attribute
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:232)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.junit.CaseTag$1.runTest(CaseTag.java:59
)
        at org.apache.commons.jelly.TestJelly.main(TestJelly.java:32)

my ForEach tag doesnt support 'select' attribute
any idea where i can obtain the ForEach Tag with select attribute would be appreciated!

regarding parsers:
$JELLY_HOME>grep -S -l ".xerces" *.java
-----------
$JELLY_HOME>grep -S -l ".dom4j" *.java
.\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\XMLOutput.java
.\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\expression\xpath\XPath
Expression.java
.\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\tags\core\FileTag.java
.\commons-jelly-1.0-src\src\java\org\apache\commons\jelly\xpath\XPathComparator.java
.\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\core\TestFileTag.java
.\commons-jelly-1.0-src\src\test\org\apache\commons\jelly\test\xml\TestCData.java

looking good for dom4j (working) 
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: mgainty@hotmail.com
> To: user@commons.apache.org
> Subject: RE: [Jelly] XML ForEach tag hangs
> Date: Fri, 29 Apr 2011 21:06:27 -0400
> 
> 
> Czaba
> 
> which xml-parser are you implementing?
> what is the version of which xml-parser you are implementing?
> 
> Martin 
> ______________________________________________ 
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>  Ez az
> üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
> készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
> semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
> könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
> ezen üzenet tartalma miatt.
> 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> > Date: Sat, 30 Apr 2011 03:02:09 +0200
> > Subject: [Jelly] XML ForEach tag hangs
> > From: csabeee@gmail.com
> > To: user@commons.apache.org
> > 
> > Hello there!
> > 
> > I'm trying to use the ForEach tag in Jelly's XML tag library. The
> > following script works fine in a standard Java console application:
> > 
> > <x:parse var="doc">
> >   <a>
> >     <b v="1"/>
> >     <b v="2"/>
> >     <b v="3"/>
> >   </a>
> > </x:parse>
> > 
> > <x:forEach select="$doc/a/b" var="x">
> >   ...
> > </x:forEach>
> > 
> > However, if using Jelly on an application server, from inside an EJB
> > container (session bean), running the script above hangs, and 100% CPU
> > utilisation comes. I realized while debugging that NodeComparator
> > class' getDepth method gets into an infinite loop and never returns.
> > 
> > If I remove two "b" elements from the xml fragment above (so only one
> > remains), it works fine. It also works if I change the second part of
> > the above script to the following:
> > 
> > <x:forEach select="$doc/a">
> >   <x:forEach select="b">
> >     ...
> >   </x:forEach>
> > </x:forEach>
> > 
> > Does anyone have any idea why is that happening? Any help is much appreciated.
> > 
> > Thank you:
> > Csaba
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> > 
>  		 	   		  
 		 	   		  

RE: [Jelly] XML ForEach tag hangs

Posted by Martin Gainty <mg...@hotmail.com>.
Czaba

which xml-parser are you implementing?
what is the version of which xml-parser you are implementing?

Martin 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sat, 30 Apr 2011 03:02:09 +0200
> Subject: [Jelly] XML ForEach tag hangs
> From: csabeee@gmail.com
> To: user@commons.apache.org
> 
> Hello there!
> 
> I'm trying to use the ForEach tag in Jelly's XML tag library. The
> following script works fine in a standard Java console application:
> 
> <x:parse var="doc">
>   <a>
>     <b v="1"/>
>     <b v="2"/>
>     <b v="3"/>
>   </a>
> </x:parse>
> 
> <x:forEach select="$doc/a/b" var="x">
>   ...
> </x:forEach>
> 
> However, if using Jelly on an application server, from inside an EJB
> container (session bean), running the script above hangs, and 100% CPU
> utilisation comes. I realized while debugging that NodeComparator
> class' getDepth method gets into an infinite loop and never returns.
> 
> If I remove two "b" elements from the xml fragment above (so only one
> remains), it works fine. It also works if I change the second part of
> the above script to the following:
> 
> <x:forEach select="$doc/a">
>   <x:forEach select="b">
>     ...
>   </x:forEach>
> </x:forEach>
> 
> Does anyone have any idea why is that happening? Any help is much appreciated.
> 
> Thank you:
> Csaba
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>