You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Hiranya Jayathilaka <hi...@gmail.com> on 2011/12/21 17:24:03 UTC

Neethi 3.0.2 Issue

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:135)
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

Re: Neethi 3.0.2 Issue

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Wed, Dec 21, 2011 at 10:05 PM, Daniel Kulp <dk...@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
> >
> > <hi...@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

Re: Neethi 3.0.2 Issue

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Wed, Dec 21, 2011 at 10:05 PM, Daniel Kulp <dk...@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
> >
> > <hi...@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

Re: Neethi 3.0.2 Issue

Posted by Daniel Kulp <dk...@apache.org>.
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.

Dan


> 
> Thanks,
> Hiranya
> 
> On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka
> 
> <hi...@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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


Re: Neethi 3.0.2 Issue

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
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.java:89)

Thanks,
Hiranya

On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka
<hi...@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:135)
>  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
>



-- 
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

Re: Neethi 3.0.2 Issue

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
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.java:89)

Thanks,
Hiranya

On Wed, Dec 21, 2011 at 9:54 PM, Hiranya Jayathilaka
<hi...@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:135)
>  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
>



-- 
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