[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">&lt;<a href="mailto:dkulp@apache.org">dkulp@apache.org</a>&gt;</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> &gt; Get the same when using PolicyBuilder instead \
of PolicyEngine:<br> &gt;<br>
&gt; java.lang.IllegalArgumentException: {<br>
&gt; <a href="http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion" \
target="_blank">http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion</a> \
is not<br> &gt; a &lt;wsp:Policy&gt; element.<br>
&gt; at org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)<br>
&gt; at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:109) at<br>
&gt; org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:136)<br>
&gt; at<br>
&gt; org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory.jav<br>
&gt; a:89)<br>
<br>
<br>
</div>You are asking to create a Policy object (which represents a \
&quot;ws:Policy&quot;<br> element), but you  aren&#39;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&#39;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&#39;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>
&gt;<br>
&gt; Thanks,<br>
&gt; Hiranya<br>
&gt;<br>
&gt; On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka<br>
&gt;<br>
&gt; &lt;<a href="mailto:hiranya911@gmail.com">hiranya911@gmail.com</a>&gt;wrote:<br>
&gt; &gt; Hi Folks,<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m trying to get WSO2 Throttling trunk (an open source project<br>
&gt; &gt; dependent<br>
&gt; &gt; on Neethi) working with Neethi 3.0.2. I was able to get it to work with<br>
&gt; &gt; Neethi 3.0.0. But cannot get it to work with 3.0.1 and 3.0.2. Keep<br>
&gt; &gt; getting the following error:<br>
&gt; &gt;<br>
&gt; &gt; java.lang.IllegalArgumentException: {<br>
&gt; &gt; <a href="http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion" \
target="_blank">http://www.wso2.org/products/wso2commons/throttle}ThrottleAssertion</a> \
is<br> &gt; &gt; not a &lt;wsp:Policy&gt; element.<br>
&gt; &gt;<br>
&gt; &gt;  at<br>
&gt; &gt;<br>
&gt; &gt; org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177<br>
 &gt; &gt; )<br>
&gt; &gt; at org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:125)<br>
&gt; &gt;<br>
&gt; &gt;  at org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:113)<br>
&gt; &gt;<br>
&gt; &gt; at<br>
&gt; &gt; org.wso2.throttle.ThrottleFactory.createThrottle(ThrottleFactory.java:13<br>
 &gt; &gt; 5)&gt;<br>
&gt; &gt;  at<br>
&gt; &gt;<br>
&gt; &gt; org.wso2.throttle.ThrottleFactory.createMediatorThrottle(ThrottleFactory<br>
 &gt; &gt; .java:89)<br>
&gt; &gt;<br>
&gt; &gt; Any idea what changed in the API for this code to break?<br>
&gt; &gt;<br>
&gt; &gt; Thanks<br>
&gt; &gt; --<br>
&gt; &gt; Hiranya Jayathilaka<br>
&gt; &gt; Associate Technical Lead;<br>
&gt; &gt; WSO2 Inc.;  <a href="http://wso2.org" \
target="_blank">http://wso2.org</a><br> &gt; &gt; 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> &gt; \
&gt; 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