You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2008/04/29 10:41:56 UTC
[jira] Created: (SLING-396) RepositoryAccessor cannot cast to
Repository anymore
RepositoryAccessor cannot cast to Repository anymore
----------------------------------------------------
Key: SLING-396
URL: https://issues.apache.org/jira/browse/SLING-396
Project: Sling
Issue Type: Bug
Components: Repository
Reporter: Bertrand Delacretaz
My custom Sling webaapp gets a Repository via JNDI from another webapp, and up to Sling revision 651211 that works fine - I have added jcr.jar to the global libraries of my web container, so that both webapps get the same Repository interface definition and the cast works.
If I rebuild my app against the current Sling revision 652071, and load the resulting webapp in my web container without changing anything else (without even restarting the web container), the cast of repoObject to Repository in RepositoryAccessor.getRepository() fails:
Object repoObject = initialContext.lookup(repositoryName);
if (repoObject instanceof Repository) {
As repoObject is the same in both cases, this seems to be caused by a Sling change that causes the Repository interface to come from a different ClassLoader than before.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SLING-396) RepositoryAccessor cannot cast to
Repository anymore
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bertrand Delacretaz updated SLING-396:
--------------------------------------
Attachment: SLING-396.patch
The cause was a missing jcr-client.properties in the launchpad war file, that file has moved to
jcrapp/target/classes/WEB-INF/jcr-client.properties
and needs to be copied under WEB-INF for the bootdelegation to work: that file defines classes (including the jcr Repository interface) that must be loaded from the boot classloader, and it was missing.
Will apply the patch as soon as svn is writeable again
> RepositoryAccessor cannot cast to Repository anymore
> ----------------------------------------------------
>
> Key: SLING-396
> URL: https://issues.apache.org/jira/browse/SLING-396
> Project: Sling
> Issue Type: Bug
> Components: Repository
> Reporter: Bertrand Delacretaz
> Attachments: SLING-396.patch
>
>
> My custom Sling webaapp gets a Repository via JNDI from another webapp, and up to Sling revision 651211 that works fine - I have added jcr.jar to the global libraries of my web container, so that both webapps get the same Repository interface definition and the cast works.
> If I rebuild my app against the current Sling revision 652071, and load the resulting webapp in my web container without changing anything else (without even restarting the web container), the cast of repoObject to Repository in RepositoryAccessor.getRepository() fails:
> Object repoObject = initialContext.lookup(repositoryName);
> if (repoObject instanceof Repository) {
> As repoObject is the same in both cases, this seems to be caused by a Sling change that causes the Repository interface to come from a different ClassLoader than before.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SLING-396) RepositoryAccessor cannot cast to
Repository anymore
Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SLING-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bertrand Delacretaz resolved SLING-396.
---------------------------------------
Resolution: Fixed
Patch applied in revision 652267
> RepositoryAccessor cannot cast to Repository anymore
> ----------------------------------------------------
>
> Key: SLING-396
> URL: https://issues.apache.org/jira/browse/SLING-396
> Project: Sling
> Issue Type: Bug
> Components: Repository
> Reporter: Bertrand Delacretaz
> Attachments: SLING-396.patch
>
>
> My custom Sling webaapp gets a Repository via JNDI from another webapp, and up to Sling revision 651211 that works fine - I have added jcr.jar to the global libraries of my web container, so that both webapps get the same Repository interface definition and the cast works.
> If I rebuild my app against the current Sling revision 652071, and load the resulting webapp in my web container without changing anything else (without even restarting the web container), the cast of repoObject to Repository in RepositoryAccessor.getRepository() fails:
> Object repoObject = initialContext.lookup(repositoryName);
> if (repoObject instanceof Repository) {
> As repoObject is the same in both cases, this seems to be caused by a Sling change that causes the Repository interface to come from a different ClassLoader than before.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.