Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19279

Extension Repository not reachable via REST URL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 14.0, 13.10.3
    • 13.10.1
    • Repository
    • None
    • Unknown
    • n/a
    • n/a

    Description

      I installed the Extension Repository Application in a subwiki; however when trying to access the repository under /xwiki/rest/repository/ a 404 is returned.

      The log contains an exception like:

      2021-12-28 01:25:27.190:INFO:oejshC.xwiki:qtp2101842856-12 - http://localhost:8080/xwiki/rest/repository/search?start=0&number=100&q=: RestletServlet: [Restlet] Attaching application
      : org.xwiki.rest.internal.XWikiRestletJaxRsApplication@64df55c9 to URI: /xwiki/rest
      Dec 28, 2021 1:25:27 AM org.restlet.ext.jaxrs.internal.util.ExceptionHandler instantiateExecption
      WARNING: Could not create new instance of root resource class
      org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.repository.internal.resources.SearchRESTResource] identified by type [interface org.xwiki.
      rest.XWikiRestComponent] and hint [org.xwiki.repository.internal.resources.SearchRESTResource]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:204)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
              at org.xwiki.rest.internal.ComponentsObjectFactory.getInstance(ComponentsObjectFactory.java:67)
              at org.restlet.ext.jaxrs.internal.wrappers.PerRequestRootResourceClass.getInstance(PerRequestRootResourceClass.java:97)
      [...]
      Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.repository.internal.RepositoryManager] identified by type [class org.xwiki.repository.internal.RepositoryManager] and hint [default]
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:204)
              at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:406)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:355)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:451)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:201)
              ... 96 more
      Caused by: org.xwiki.component.phase.InitializationException: Failed to initialize cache
              at org.xwiki.repository.internal.RepositoryManager.initialize(RepositoryManager.java:227)
              at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39)
              at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:365)
              at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:451)
              at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:201)
              ... 100 more
      Caused by: org.xwiki.cache.CacheException: Cache with name [repository.extensionid.documentreference] already exist
              at org.xwiki.cache.infinispan.internal.InfinispanCacheFactory.newCache(InfinispanCacheFactory.java:152)
              at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:112)
              at org.xwiki.cache.internal.DefaultCacheManager.createNewCache(DefaultCacheManager.java:85)
              at org.xwiki.repository.internal.RepositoryManager.initialize(RepositoryManager.java:225)
              ... 104 more
      

      Out of curiosity I logged an exception in the initialize method of the RepositoryManager, and indeed it gets initialized twice (i.e. with two different instances), one for the subwiki and one for the REST-interface.

      I guess only allowing to install the org.xwiki.platform:xwiki-platform-repository-server-api in the root namespace should fix the problem; at least if I edit the corresponding *.xed in my local installation it works without problems.

      Attachments

        Activity

          People

            camil7 Clemens Robbenhaar
            camil7 Clemens Robbenhaar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: