ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <hiranya...@gmail.com>
Subject Re: Neethi 3.0.2 Issue
Date Wed, 21 Dec 2011 16:58:23 GMT
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

Mime
View raw message