You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2014/02/05 15:56:37 UTC

[jira] [Commented] (TAP5-2276) Error loading asset from inherited component from different library

    [ https://issues.apache.org/jira/browse/TAP5-2276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13892198#comment-13892198 ] 

Jochen Kemnade commented on TAP5-2276:
--------------------------------------

I think I'm facing a similar issue. Could it be that your 'common' library adds a component mapping with the same root package that the application uses as its root package, i.e. what is configured as the {{tapestry.app-package}} context parameter?
This way, there are two {{LibraryMapping}} s contributed to the {{ComponentClassResolver}} with the same root package being mapped to both the empty string and 'common' library names. When the component model is instantiated, it retrieves the library name for the component class name from the {{ComponentClassResolver}} via its {{getLibraryNameForClass(String)}} method. That library name is retrieved from the {{packageNameToLibraryName}} {{Map}} which contains the value from the last {{LibraryMapping}} that was processed by the {{ComponentClassResolverImpl}} constructor.

> Error loading asset from inherited component from different library
> -------------------------------------------------------------------
>
>                 Key: TAP5-2276
>                 URL: https://issues.apache.org/jira/browse/TAP5-2276
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Vladimir Velikiy
>              Labels: assets, component, inheritance
>
> I use component inheritance in my project. Parent component 'Dialog' is located in library 'common'. It uses asset 'common.js' located in META-INF/assets/common/common.js. When I use it in page it works fine, but if I use inherited component FormDialog located in my application components folder,  I get error: 'Unable to locate asset 'common.js' for component request/Create:contractorcreatedialog. It should be located at META-INF/assets/common.js'. Inherited component doesn't contain any @Import annotations.
> This error occurs because method getComponentAsset(...) in AssetSourceImpl uses ComponentResources of inherited component when calculates asset path and gets incorrect (empty in my case) library path prefix instead of super component library name.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)