[ 
https://issues.apache.org/jira/browse/TAPESTRY-1776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529863
 ] 

Ognen Ivanovski commented on TAPESTRY-1776:
-------------------------------------------

After some debugging (method breakpoint on ClassLoader.loadClass()) I came up 
with the following:

The first time loadClass() with name.endsWith("CheckboxGroup") is called during 
what seems to be a normal 
component instantaion:

Thread [SocketListener0-1] (Suspended (entry into method loadClass in 
ClassLoader))     
        
ComponentInstantiatorSourceImpl$PackageAwareLoader(ClassLoader).loadClass(String)
 line: 251     
        ComponentInstantiatorSourceImpl.findClass(String) line: 254     
        ComponentInstantiatorSourceImpl.findInstantiator(String) line: 240      
        $ComponentInstantiatorSource_11537cb38c6.findInstantiator(String) line: 
not available   
        PageElementFactoryImpl.newComponentElement(Page, ComponentPageElement, 
String, String, String, String, Location) line: 268      
        $PageElementFactory_11537cb38ed.newComponentElement(Page, 
ComponentPageElement, String, String, String, String, Location) line: not 
available   
        PageLoaderProcessor.startComponent(StartComponentToken) line: 618       
        PageLoaderProcessor.loadTemplateForComponent(ComponentPageElement) 
line: 498    
        PageLoaderProcessor.workComponentQueue() line: 714      
        PageLoaderProcessor.loadPage(String, String, Locale) line: 392  
        PageLoaderImpl.loadPage(String, Locale) line: 59        
        $PageLoader_11537cb38eb.loadPage(String, Locale) line: not available    
        PagePoolImpl.checkout(String) line: 70  
        $PagePool_11537cb38ea.checkout(String) line: not available      
        RequestPageCacheImpl.get(String) line: 44       
        $RequestPageCache_11537cb38e9.get(String) line: not available   
        $RequestPageCache_11537cb38c2.get(String) line: not available   
        PageRenderRequestHandlerImpl.handle(String, String[]) line: 55  
        $PageRenderRequestHandler_11537cb38e3.handle(String, String[]) line: 
not available      
        PageRenderDispatcher.dispatch(Request, Response) line: 72       
        $Dispatcher_11537cb38e6.dispatch(Request, Response) line: not available 
        $Dispatcher_11537cb38d9.dispatch(Request, Response) line: not available 
        TapestryModule$12.service(Request, Response) line: 1066 
        AppModule$1.service(Request, Response, RequestHandler) line: 83 
        $RequestFilter_11537cb38d8.service(Request, Response, RequestHandler) 
line: not available       
        $RequestHandler_11537cb38da.service(Request, Response) line: not 
available      
        LocalizationFilter.service(Request, Response, RequestHandler) line: 43  
        $RequestHandler_11537cb38da.service(Request, Response) line: not 
available      
        TapestryModule$2.service(Request, Response, RequestHandler) line: 657   
        $RequestHandler_11537cb38da.service(Request, Response) line: not 
available      
        StaticFilesFilter.service(Request, Response, RequestHandler) line: 63   
        $RequestHandler_11537cb38da.service(Request, Response) line: not 
available      
        CheckForUpdatesFilter$2.invoke() line: 97       
        CheckForUpdatesFilter$2.invoke() line: 88       
        ConcurrentBarrier.withRead(Invokable<T>) line: 77       
        CheckForUpdatesFilter.service(Request, Response, RequestHandler) line: 
110      
        $RequestHandler_11537cb38da.service(Request, Response) line: not 
available      
        $RequestHandler_11537cb38d2.service(Request, Response) line: not 
available      
        TapestryModule$11.service(HttpServletRequest, HttpServletResponse) 
line: 1044   
        $HttpServletRequestHandler_11537cb38d1.service(HttpServletRequest, 
HttpServletResponse) line: not available     
        TapestryFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
line: 135 
        WebApplicationHandler$CachedChain.doFilter(ServletRequest, 
ServletResponse) line: 821   
        WebApplicationHandler.dispatch(String, HttpServletRequest, 
HttpServletResponse, ServletHolder, int) line: 471   
        WebApplicationHandler(ServletHandler).handle(String, String, 
HttpRequest, HttpResponse) line: 568       
        WebApplicationContext(HttpContext).handle(String, String, HttpRequest, 
HttpResponse) line: 1530 
        WebApplicationContext.handle(String, String, HttpRequest, HttpResponse) 
line: 633       
        WebApplicationContext(HttpContext).handle(HttpRequest, HttpResponse) 
line: 1482 
        Server(HttpServer).service(HttpRequest, HttpResponse) line: 909 
        HttpConnection.service(HttpRequest, HttpResponse) line: 820     
        HttpConnection.handleNext() line: 986   
        HttpConnection.handle() line: 837       
        SocketListener.handleConnection(Socket) line: 245       
        SocketListener(ThreadedServer).handle(Object) line: 357 
        ThreadPool$PoolThread.run() line: 534   

Then once again loadClass with name.endsWith("CheckboxGroup")  is called. This 
time it comes through BulkSelect._$read_parameter_checkboxes() and some 
javaassist classes. 

Thread [SocketListener0-1] (Suspended (entry into method loadClass in 
ClassLoader))     
        Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 251        
        Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: 
319        
        Class<T>.forName0(String, boolean, ClassLoader) line: not available 
[native method]     
        Class<T>.forName(String) line: 164      
        Desc.getClassObject(String) line: 43    
        Desc.getClassType(String, int, int, int) line: 149      
        Desc.getType(String, int, int, int) line: 119   
        Desc.getType(String) line: 75   
        BulkSelect._$read_parameter_checkboxes() line: not available    
        BulkSelect.getLinkedElementName() line: 55      
        $PropertyConduit_11537c975e4.get(Object) line: not available    
        PropBinding.get() line: 54      
        PageElementFactoryImpl$3.provideString() line: 187      
        PageElementFactoryImpl$4.provideString() line: 217      
        PageElementFactoryImpl$2.render(MarkupWriter, RenderQueue) line: 134    
        RenderQueueImpl.run(MarkupWriter) line: 57      
        PageMarkupRendererImpl.renderPageMarkup(Page, MarkupWriter) line: 40    
        $PageMarkupRenderer_11537c97609.renderPageMarkup(Page, MarkupWriter) 
line: not available        
        PageResponseRendererImpl.renderPageResponse(Page, Response) line: 71    
        $PageResponseRenderer_11537c97595.renderPageResponse(Page, Response) 
line: not available        
        PageRenderRequestHandlerImpl.handle(String, String[]) line: 81  
        $PageRenderRequestHandler_11537c975b5.handle(String, String[]) line: 
not available      
        PageRenderDispatcher.dispatch(Request, Response) line: 72       
        $Dispatcher_11537c975b8.dispatch(Request, Response) line: not available 
        $Dispatcher_11537c975ab.dispatch(Request, Response) line: not available 
        TapestryModule$12.service(Request, Response) line: 1066 
        AppModule$1.service(Request, Response, RequestHandler) line: 83 
        $RequestFilter_11537c975aa.service(Request, Response, RequestHandler) 
line: not available       
        $RequestHandler_11537c975ac.service(Request, Response) line: not 
available      
        LocalizationFilter.service(Request, Response, RequestHandler) line: 43  
        $RequestHandler_11537c975ac.service(Request, Response) line: not 
available      
        TapestryModule$2.service(Request, Response, RequestHandler) line: 657   
        $RequestHandler_11537c975ac.service(Request, Response) line: not 
available      
        StaticFilesFilter.service(Request, Response, RequestHandler) line: 63   
        $RequestHandler_11537c975ac.service(Request, Response) line: not 
available      
        CheckForUpdatesFilter$2.invoke() line: 97       
        CheckForUpdatesFilter$2.invoke() line: 88       
        ConcurrentBarrier.withRead(Invokable<T>) line: 77       
        CheckForUpdatesFilter.service(Request, Response, RequestHandler) line: 
110      
        $RequestHandler_11537c975ac.service(Request, Response) line: not 
available      
        $RequestHandler_11537c975a4.service(Request, Response) line: not 
available      
        TapestryModule$11.service(HttpServletRequest, HttpServletResponse) 
line: 1044   
        $HttpServletRequestHandler_11537c975a3.service(HttpServletRequest, 
HttpServletResponse) line: not available     
        TapestryFilter.doFilter(ServletRequest, ServletResponse, FilterChain) 
line: 135 
        WebApplicationHandler$CachedChain.doFilter(ServletRequest, 
ServletResponse) line: 821   
        WebApplicationHandler.dispatch(String, HttpServletRequest, 
HttpServletResponse, ServletHolder, int) line: 471   
        WebApplicationHandler(ServletHandler).handle(String, String, 
HttpRequest, HttpResponse) line: 568       
        WebApplicationContext(HttpContext).handle(String, String, HttpRequest, 
HttpResponse) line: 1530 
        WebApplicationContext.handle(String, String, HttpRequest, HttpResponse) 
line: 633       
        WebApplicationContext(HttpContext).handle(HttpRequest, HttpResponse) 
line: 1482 
        Server(HttpServer).service(HttpRequest, HttpResponse) line: 909 
        HttpConnection.service(HttpRequest, HttpResponse) line: 820     
        HttpConnection.handleNext() line: 986   
        HttpConnection.handle() line: 837       
        SocketListener.handleConnection(Socket) line: 245       
        SocketListener(ThreadedServer).handle(Object) line: 357 
        ThreadPool$PoolThread.run() line: 534   

My guess is that 

  @Parameter(required = true, defaultPrefix="component")
  private CheckboxGroup checkboxes;

provokes the second loadClass() call.

> Component Class object exists in several instances  
> ----------------------------------------------------
>
>                 Key: TAPESTRY-1776
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1776
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>         Environment: Mac OS X, Eclipse 3.3, Jetty Launcher, Jetty 5
>            Reporter: Ognen Ivanovski
>
> I get the following exception:
> java.lang.IllegalArgumentException: Could not find a coercion from type 
> com.telekurs.pass.online.permissiongui.components.CheckboxGroup to type 
> com.telekurs.pass.online.permissiongui.components.CheckboxGroup.  Available 
> coercions:... (full trace attached)
> Note that it says "cannot find a coercion from A to A". I did some debugging 
> and indeed the class CheckboxGroup was represented by two different objects. 
> Tapestry should not allow for a component class to be loaded differently than 
> in the modified version. 
> More details: 
>  - CheckBoxGroup is a component very similar to RadioGroup (80% code similar) 
> it is used to group render a set of checkboxes with the same name. 
> - BulkSelect is a js component that i used for "select all" and "select none" 
> operations in connection to the CheckBoxGroup. It has a  
>   @Parameter(required = true, defaultPrefix="component")
>   private CheckboxGroup checkboxes;
> They are used in the following way:
>       <t:BulkSelect checkboxes="permissionSelections" select="true" />
>       <t:CheckboxGroup t:id="permissionSelections"
>         value="selected" encoder="permissionValueEncoder" disabled="disabled">
>            <!-- ...-->
>         </t:CheckboxGroup>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to