Hi,

Your problem is that Tapestry sees two RequestFilters, and that won't work. You'll need to properly identify each service and tell Tapestry that those are the services you want to contribute.

  public static void bind(ServiceBinder binder) {
    binder.bind(UserActivityFilterImpl.class).withId("UserActivityFilter");
  }

  public static RequestFilter buildTimingFilter(...) { ... }

public static void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,

@InjectService("TimingFilter") RequestFilter timingFilter,

@InjectService("UserActivityFilter") RequestFilter userActivityFilter)
  {
    ...
  }

I haven't tested it, but it should work.

-Filip

On 2008-08-13 22:30, Otho wrote:
Hi all!
I want two contribute a second requestfilter alongside the timing filter in
application module. But unfortunately this doesn't work with an anonymous
definition (like the timing filter)  and a contribution to RequestHandler
nor does it work with a written out interface/class pair contributet via the
bind mechanism. In the latter case the error message is like this:

HTTP ERROR: 500

Exception constructing service 'RequestHandler': Error invoking service
builder method
org.apache.tapestry5.services.TapestryModule.buildRequestHandler(Logger,
List, Dispatcher) (at TapestryModule.java:970) (for service
'RequestHandler'): Error invoking service contribution method
org.example.animaltips.services.AtModule.contributeRequestHandler(OrderedConfiguration,
RequestFilter): Unable to locate a single service assignable to type
org.apache.tapestry5.services.RequestFilter with marker annotation(s)
org.apache.tapestry5.ioc.annotations.Local.  All of the following services
match: org.example.animaltips.services.AtModule.buildTimingFilter(Logger)
(at AtModule.java:63),
org.example.animaltips.services.UserActivityFilterImpl() (at
UserActivityFilterImpl.java:24).

In the former case it also complains about 2 classes implementing the
RequestFilter interface.

My own filter works flawlessly when I comment out the timing filter
contribution. But for the time being I want to have both. Is there any way
to do this easily?

Regards,
Otho


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to