Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-10544

oak-jcr: remapping a namespace prefix leaves namespace resolver in broken state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.62.0, 1.22.21
    • core, jcr
    • None

    Description

      Remapping a prefix to a different namespaceURI should leave the registry in a consistent state; access to nodes that were created using the previous prefix mapping still needs to work.

      Likely cause is that LocaleNameMapper indeed mints a new prefix, but doesn't add it to the session registry.

      The (ignored) test (from OAK-10545) currently fails with:

      [ERROR] Tests run: 14, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.732 s <<< FAILURE! - in org.apache.jackrabbit.oak.jcr.NamePathTest
      [ERROR] testPrefixRemapping(org.apache.jackrabbit.oak.jcr.NamePathTest)  Time elapsed: 0.235 s  <<< ERROR!
      javax.jcr.NamespaceException: internal error: failed to resolve namespace prefix
              at org.apache.jackrabbit.spi.commons.namespace.SessionNamespaceResolver.getURI(SessionNamespaceResolver.java:62)
              at org.apache.jackrabbit.spi.commons.conversion.NameParser.parse(NameParser.java:189)
              at org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver.getQName(ParsingNameResolver.java:64)
              at org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver.getQName(DefaultNamePathResolver.java:74)
              at org.apache.jackrabbit.oak.jcr.NamePathTest.testPrefixRemapping(NamePathTest.java:255)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
              at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
              at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
              at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
              at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
              at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
              at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
              at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
              at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
              at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
      Caused by: javax.jcr.NamespaceException: Unknown namespace prefix: nstest-20592706202
              at org.apache.jackrabbit.oak.jcr.session.SessionNamespaces.getNamespaceURI(SessionNamespaces.java:132)
              at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getNamespaceURI(SessionImpl.java:821)
              at org.apache.jackrabbit.spi.commons.namespace.SessionNamespaceResolver.getURI(SessionNamespaceResolver.java:59)
              ... 34 more
      
      

      Attachments

        Issue Links

          Activity

            People

              reschke Julian Reschke
              reschke Julian Reschke
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: