Hi Steve,

the problem is the protocol bundleresource.
You should override ClasspathURLConverter which is used by ClassNameLocator.
This service was introduced to be able to handle URLs which are not common
in Java.
I provide for example my own implementition of this service in an OSGi
environment, where the URL start with bundleresource.
So you have the same issue.


On Wed, May 6, 2009 at 12:23 AM, Steve Eynon <steve.ey...@alienfactory.co.uk
> wrote:

> How do I advise the ClassNameLocator service?
>
> If I add the following advice method to my AppModule ...
>
> @Match("*")
> public static void adviseEverything(MethodAdviceReceiver receiver) {
>        System.out.println(receiver.getInterface());
> }
>
> Only the following interfaces are advised ...
>
> interface org.apache.tapestry5.ioc.ObjectProvider
> interface org.apache.tapestry5.services.AliasManager
> interface org.apache.tapestry5.services.ApplicationInitializer
> interface org.apache.tapestry5.services.UpdateListenerHub
> interface
> org.apache.tapestry5.internal.services.ComponentInstantiatorSource
> interface org.apache.tapestry5.services.InvalidationEventHub
> interface org.apache.tapestry5.internal.services.EndOfRequestEventHub
> interface org.apache.tapestry5.services.ApplicationGlobals
> interface org.apache.tapestry5.services.ComponentClassResolver
> interface com.formos.tapestry.templating.services.TemplateRendererSource
> interface com.formos.tapestry.templating.services.LocationManager
> interface
> com.formos.tapestry.templating.internal.services.TemplateRequestGlobals
> interface org.apache.tapestry5.services.RequestGlobals
> interface org.apache.tapestry5.services.LocalizationSetter
> interface org.apache.tapestry5.services.ComponentSource
> interface org.apache.tapestry5.internal.services.RequestPageCache
>
> I can debug and step into the ClassNameLocator so I know it's been
> created but I'm not given an opportunity to override its return value.
>
> To give context, I am trying to use tapx-templating to generate
> customer receipts (which are exported into pdf files via Flying Saucer
> and iText).
>
> It all works brilliantly when run from unit tests but fails miserably
> when I make the same call from within an Eclipse RCP application. It
> fails due to the ClassLoader of the RCP app returning URLs in the form
> of :
>
> bundleresource://1/com/bushmasters/admin/templating/pages/
>
> which the Tapestry ClassNameLocator service doesn't understand.
>
> I'm happy to override the ClassNameLocator and return some hard coded
> defaults (as I have few pages and components) but am not sure how...?
>
> Any help is much appreciated.
>
> Steve.
>
> --
> Steve Eynon
> www.bushmasters.co.uk
> mobie: (+592) 6784236
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Reply via email to