Re: T5 Varargs in service methods

2013-01-28 Thread Thiago H de Paula Figueiredo
On Mon, 28 Jan 2013 07:53:52 -0200, llama-king   
wrote:


Sorry to dig up an old thread but seems I'm experiencing precisely the  
same issue. Running on 5.3.6, injecting a service, calling method in  
service that takes varargs.


Any ideas what might be the cause?


This doesn't look like it's related to varargs at all.



java.lang.LinkageError: loader constraint violation: when resolving  
method

"com.albourne.web.services.AjaxRenderHelper.render([Lorg/apache/tapestry5/corelib/components/Zone;)V"
the class loader (instance of
org/apache/tapestry5/internal/plastic/PlasticClassLoader) of the current
class, com/albourne/web/components/hf/risk/ListingConditionNew, and the
class loader (instance of runjettyrun/ProjectClassLoader) for resolved
class, com/albourne/web/services/AjaxRenderHelper, have different Class
objects for the type apestry5/corelib/components/Zone;)V used in the
signature


You seem to be receiving an instance of a page or component or mixin in a  
service. Never do that. As Tapestry changes that classes in a different  
classpath when they're loaded, non-transformed classes (like your service)  
only see the original, non-transformed page, component or mixin.


The solution is to create an interface, make the page, component or mixin  
implement it and then use the new interface as the parameter in your  
service.


--
Thiago H. de Paula Figueiredo

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: T5 Varargs in service methods

2013-01-28 Thread llama-king
Sorry to dig up an old thread but seems I'm experiencing precisely the same
issue. Running on 5.3.6, injecting a service, calling method in service that
takes varargs.

Any ideas what might be the cause?

java.lang.LinkageError: loader constraint violation: when resolving method
"com.albourne.web.services.AjaxRenderHelper.render([Lorg/apache/tapestry5/corelib/components/Zone;)V"
the class loader (instance of
org/apache/tapestry5/internal/plastic/PlasticClassLoader) of the current
class, com/albourne/web/components/hf/risk/ListingConditionNew, and the
class loader (instance of runjettyrun/ProjectClassLoader) for resolved
class, com/albourne/web/services/AjaxRenderHelper, have different Class
objects for the type apestry5/corelib/components/Zone;)V used in the
signature
at
com.albourne.web.components.hf.risk.ListingConditionNew.onSuccessFromNewConditionForm(ListingConditionNew.java:127)
at
com.albourne.web.components.hf.risk.ListingConditionNew.dispatchComponentEvent(ListingConditionNew.java)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:935)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1112)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:61)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1057)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1054)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
at
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1053)
at
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:302)
at
org.apache.tapestry5.corelib.components.Form.advised$onAction_60237a7839c(Form.java:545)
at
org.apache.tapestry5.corelib.components.Form$Invocation_onAction_60237a7839b.proceedToAdvisedMethod(Unknown
Source)
at
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:84)
at
org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37)
at
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
at org.apache.tapestry5.corelib.components.Form.onAction(Form.java)
at
org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:935)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1112)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:61)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1057)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1054)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
at
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1053)
at
org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:110)
at
org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56)
at $ComponentEventRequestHandler_60237a78b89.handle(Unknown Source)
at $ComponentEventRequestHandler_60237a78b84.handle(Unknown Source)
at
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
at $ComponentEventRequestHandler_60237a78b86.handle(Unknown Source)
at
org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
at $ComponentEventRequestHandl

Re: T5 Varargs in service methods

2010-07-28 Thread joris

Hi Uli,

The VM argument doesn't help. I use tapestry 5.1.0.5 .

I tried to reproduce the bug in a empty app without luck. 
It's hard, because I don't know were I am looking for.
In my main app I can still reproduce it and I also noticed that the
exception is dependent by the method parameter type. If I use "void
getData(MyObject...o)" the exception occurs and if I change MyObject to
Integer or String it doesn't occur.

Every hint in which direction to search is welcome.

Joris

java.lang.LinkageError: loader constraint violation: when resolving
interface method
"de.ida.kv.services.VarargsTestService.bla([Lde/ida/kv/base/hibernate/MyObject;)V"
 the class loader (instance of 
org/apache/tapestry5/internal/services/ComponentInstantiatorSourceImpl$PackageAwareLoader)
 of the current class, de/ida/kv/pages/Login, and the class loader (instance of 
org/mortbay/jetty/webapp/WebAppClassLoader) for resolved class, 
de/ida/kv/services/VarargsTestService, have different Class objects for the 
type [Lde/ida/kv/base/hibernate/MyObject; used in the signature
at de.ida.kv.pages.Login.beginRender(Login.java:32)
at de.ida.kv.pages.Login.beginRender(Login.java)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl
$BeginRenderPhase.invokeComponent(ComponentPageElementImpl.java:206)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl
$AbstractPhase.run(ComponentPageElementImpl.java:164)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:933)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access
$400(ComponentPageElementImpl.java:49)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl
$AbstractPhase.callback(ComponentPageElementImpl.java:159)
at org.apache.tapestry5.internal.structure.ComponentPageElementImpl
$BeginRenderPhase.render(ComponentPageElementImpl.java:211)
at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74)
at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)
at
$PageRenderQueue_12a1973bcae.render($PageRenderQueue_12a1973bcae.java)
at
$PageRenderQueue_12a1973bca5.render($PageRenderQueue_12a1973bca5.java)
at
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
at org.apache.tapestry5.services.TapestryModule
$27.renderMarkup(TapestryModule.java:1748)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at org.apache.tapestry5.services.TapestryModule
$26.renderMarkup(TapestryModule.java:1732)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at org.apache.tapestry5.services.TapestryModule
$25.renderMarkup(TapestryModule.java:1714)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at org.apache.tapestry5.services.TapestryModule
$24.renderMarkup(TapestryModule.java:1700)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at org.apache.tapestry5.services.TapestryModule
$23.renderMarkup(TapestryModule.java:1681)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at org.apache.tapestry5.services.TapestryModule
$22.renderMarkup(TapestryModule.java:1662)
at
$MarkupRenderer_12a1973bcb0.renderMarkup($MarkupRenderer_12a1973bcb0.java)
at
$MarkupRenderer_12a1973bcad.renderMarkup($MarkupRenderer_12a1973bcad.java)
at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64)
at
$PageMarkupRenderer_12a1973bcaa.renderPageMarkup($PageMarkupRenderer_12a1973bcaa.java)
at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61)
at
$PageResponseRenderer_12a1973bc49.renderPageResponse($PageResponseRenderer_12a1973bc49.java)
at
org.tynamo.security.ShiroExceptionHandler.handle(ShiroExceptionHandler.java:107)
at org.tynamo.security.services.SecurityModule
$3.advise(SecurityModule.java:249)
at
org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121)
at
$RequestExceptionHandler_12a1973bc4b.handleRequestException($RequestExceptionHandler_12a1973bc4b.java)
at
$RequestExceptionHandler_12a1973bc2f.handleRequestException($RequestExceptionHandler_12a1973bc2f.java)
at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
at
$RequestHandler_12a1973bc31.service($RequestHandler_12a1973bc31.java)
at org.apache.tapestry5.services.TapestryModule
$4.service(TapestryModule.java:778)
at
$RequestHandler_12a1973bc31.service($RequestHandler_12a1973bc31.java)
at org.apa

Re: T5 Varargs in service methods

2010-07-28 Thread Ulrich Stärk
I don't think so, I can't reproduce it in 5.2.0-SNAPSHOT with a simple service concatenating a 
variable list of string arguments. When running Jetty please try to give the 
-Dorg.mortbay.jetty.webapp.parentLoaderPriority=true VM argument. It would also be helpful to know 
which version of Tapestry you are using.


Uli

On 27.07.2010 17:58, Howard Lewis Ship wrote:

Interesting; probably a bug, possibly in Javassist.

On Tue, Jul 27, 2010 at 8:44 AM, joris  wrote:

Hi,

if I implement a method with varargs in a tapestry service and try then
to call it without parameters, I get the following exception:

java.lang.LinkageError: loader constraint violation: when resolving
interface method "..." the class loader (instance of
org/apache/tapestry5/internal/services/ComponentInstantiatorSourceImpl
$PackageAwareLoader) of the current class, ..., and the class loader
(instance of org/mortbay/jetty/webapp/WebAppClassLoader) for resolved
class, ..., have different Class objects for the type ... used in the
signature

Example:

public interface MyService{
Data getData(Permission...permissions);
}

public class MyPage{

@Inject
private MyService service;

void onActivate(){
service.getData();
}
}

It looks like the loader does not handle this special case.
Is this a bug or is there a reason why it behaves like that?

Joris


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org








-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: T5 Varargs in service methods

2010-07-27 Thread Howard Lewis Ship
Interesting; probably a bug, possibly in Javassist.

On Tue, Jul 27, 2010 at 8:44 AM, joris  wrote:
> Hi,
>
> if I implement a method with varargs in a tapestry service and try then
> to call it without parameters, I get the following exception:
>
> java.lang.LinkageError: loader constraint violation: when resolving
> interface method "..." the class loader (instance of
> org/apache/tapestry5/internal/services/ComponentInstantiatorSourceImpl
> $PackageAwareLoader) of the current class, ..., and the class loader
> (instance of org/mortbay/jetty/webapp/WebAppClassLoader) for resolved
> class, ..., have different Class objects for the type ... used in the
> signature
>
> Example:
>
> public interface MyService{
>        Data getData(Permission...permissions);
> }
>
> public class MyPage{
>
> @Inject
> private MyService service;
>
> void onActivate(){
>        service.getData();
> }
> }
>
> It looks like the loader does not handle this special case.
> Is this a bug or is there a reason why it behaves like that?
>
> Joris
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org