[prev in list] [next in list] [prev in thread] [next in thread]
List: jaxme-dev
Subject: Re: Neethi 3.0.2 Issue
From: Hiranya Jayathilaka <hiranya911 () gmail ! com>
Date: 2011-12-21 17:10:23
Message-ID: CAGeidJ5z3aFvsUREUEpCFfm32rPZtOSL8nerSjyakbB1MrhGPQ () mail ! gmail ! com
[Download RAW message or body]
On Wed, Dec 21, 2011 at 10:05 PM, Daniel Kulp <dkulp@apache.org> wrote:
> On Wednesday, December 21, 2011 9:58:21 PM Hiranya Jayathilaka wrote:
> > Get the same when using PolicyBuilder instead of PolicyEngine:
> >
> > java.lang.IllegalArgumentException: {
> > http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion is
> not
> > a <wsp:Policy> element.
> > at
> org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)
> > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:109) at
> >
> org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:136)
> > at
> >
> org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory.jav
> > a:89)
>
>
> You are asking to create a Policy object (which represents a "ws:Policy"
> element), but you aren't feeding it a ws:Policy document. You are
> feeding
> it an assertion that would likely go in a policy document, but not a policy
> document.
>
> With 3.0.1, we tightened up the validation to make sure the inputs are
> proper
> policy documents so potentially important information isn't being lost or
> discarded.
>
What would be the solution? Should we write assertion builders and use them
instead? This is the line of code that throws the error:
Policy throttlePolicy =
PolicyEngine.getPolicy(primitiveAssertion.getValue());
You're correct in the sense primitiveAssertion.getValue() returns a DOM
node that refers to an assertion element. This works fine in 3.0.0.
-Hiranya
>
> Dan
>
>
> >
> > Thanks,
> > Hiranya
> >
> > On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka
> >
> > <hiranya911@gmail.com>wrote:
> > > Hi Folks,
> > >
> > > I'm trying to get WSO2 Throttling trunk (an open source project
> > > dependent
> > > on Neethi) working with Neethi 3.0.2. I was able to get it to work with
> > > Neethi 3.0.0. But cannot get it to work with 3.0.1 and 3.0.2. Keep
> > > getting the following error:
> > >
> > > java.lang.IllegalArgumentException: {
> > > http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion is
> > > not a <wsp:Policy> element.
> > >
> > > at
> > >
> > >
> org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177
> > > )
> > > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:125)
> > >
> > > at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:113)
> > >
> > > at
> > >
> org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:13
> > > 5)>
> > > at
> > >
> > >
> org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory
> > > .java:89)
> > >
> > > Any idea what changed in the API for this code to break?
> > >
> > > Thanks
> > > --
> > > Hiranya Jayathilaka
> > > Associate Technical Lead;
> > > WSO2 Inc.; http://wso2.org
> > > E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
> > > Blog: http://techfeast-hiranya.blogspot.com
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
--
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.; http://wso2.org
E-mail: hiranya@wso2.com; Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
[Attachment #3 (text/html)]
<br><br><div class="gmail_quote">On Wed, Dec 21, 2011 at 10:05 PM, Daniel Kulp <span \
dir="ltr"><<a href="mailto:dkulp@apache.org">dkulp@apache.org</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> <div class="im">On Wednesday, December 21, 2011 9:58:21 \
PM Hiranya Jayathilaka wrote:<br> > Get the same when using PolicyBuilder instead \
of PolicyEngine:<br> ><br>
> java.lang.IllegalArgumentException: {<br>
> <a href="http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion" \
target="_blank">http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion</a> \
is not<br> > a <wsp:Policy> element.<br>
> at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)<br>
> at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:109) at<br>
> org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:136)<br>
> at<br>
> org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory.jav<br>
> a:89)<br>
<br>
<br>
</div>You are asking to create a Policy object (which represents a \
"ws:Policy"<br> element), but you aren't feeding it a ws:Policy \
document. You are feeding<br> it an assertion that would likely go in a policy \
document, but not a policy<br> document.<br>
<br>
With 3.0.1, we tightened up the validation to make sure the inputs are proper<br>
policy documents so potentially important information isn't being lost or<br>
discarded.<br></blockquote><div><br></div><div>What would be the solution? Should we \
write assertion builders and use them instead? This is the line of code that throws \
the error:</div><div><br></div><div><div>Policy throttlePolicy = \
PolicyEngine.getPolicy(primitiveAssertion.getValue());</div> \
<div><br></div><div>You're correct in the sense primitiveAssertion.getValue() \
returns a DOM node that refers to an assertion element. This works fine in \
3.0.0.</div><div><br></div><div>-Hiranya</div></div><div> </div> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <br>
Dan<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> Thanks,<br>
> Hiranya<br>
><br>
> On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka<br>
><br>
> <<a href="mailto:hiranya911@gmail.com">hiranya911@gmail.com</a>>wrote:<br>
> > Hi Folks,<br>
> ><br>
> > I'm trying to get WSO2 Throttling trunk (an open source project<br>
> > dependent<br>
> > on Neethi) working with Neethi 3.0.2. I was able to get it to work with<br>
> > Neethi 3.0.0. But cannot get it to work with 3.0.1 and 3.0.2. Keep<br>
> > getting the following error:<br>
> ><br>
> > java.lang.IllegalArgumentException: {<br>
> > <a href="http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion" \
target="_blank">http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion</a> \
is<br> > > not a <wsp:Policy> element.<br>
> ><br>
> > at<br>
> ><br>
> > org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177<br>
> > )<br>
> > at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:125)<br>
> ><br>
> > at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:113)<br>
> ><br>
> > at<br>
> > org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:13<br>
> > 5)><br>
> > at<br>
> ><br>
> > org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory<br>
> > .java:89)<br>
> ><br>
> > Any idea what changed in the API for this code to break?<br>
> ><br>
> > Thanks<br>
> > --<br>
> > Hiranya Jayathilaka<br>
> > Associate Technical Lead;<br>
> > WSO2 Inc.; <a href="http://wso2.org" \
target="_blank">http://wso2.org</a><br> > > E-mail: <a \
href="mailto:hiranya@wso2.com">hiranya@wso2.com</a>; Mobile: <a \
href="tel:%2B94%2077%20633%203491" value="+94776333491">+94 77 633 3491</a><br> > \
> Blog: <a href="http://techfeast-hiranya.blogspot.com" \
target="_blank">http://techfeast-hiranya.blogspot.com</a><br>
--<br>
</div></div><span class="HOEnZb"><font color="#888888">Daniel Kulp<br>
<a href="mailto:dkulp@apache.org">dkulp@apache.org</a> - <a \
href="http://dankulp.com/blog" target="_blank">http://dankulp.com/blog</a><br> Talend \
Community Coder - <a href="http://coders.talend.com" \
target="_blank">http://coders.talend.com</a><br> \
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Hiranya \
Jayathilaka<br>Associate Technical Lead;<br>WSO2 Inc.; <a href="http://wso2.org" \
target="_blank">http://wso2.org</a><br>E-mail: <a href="mailto:hiranya@wso2.com" \
target="_blank">hiranya@wso2.com</a>; Mobile: +94 77 633 3491<br>
Blog: <a href="http://techfeast-hiranya.blogspot.com" \
target="_blank">http://techfeast-hiranya.blogspot.com</a><br>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic