Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-3129

It should be possible to create a non-transient Repository inside the JCARepositoryManager

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.4
    • Component/s: jackrabbit-jca
    • Labels:
      None

      Description

      With JCR-2555 jukka changed the code to create a Repository with the RepositoryFactory mechanism.
      It should be possible to create a non-transient Repository

      1. JCR-3129.patch
        5 kB
        Claus Köll

        Activity

        Hide
        Gustavo Orair added a comment -

        There is another problem with this patch.

        If config is null, it will call the method in line 108:
        config = RepositoryConfig.create(configFile, homeDir);

        It will result in an NPE (Null Pointer Exception) on org.apache.jackrabbit.core.config.RepositoryConfig line 276:
        URI uri = new File(file).toURI();

        Following stack trace is provided:
        Caused by: java.lang.NullPointerException
        at java.io.File.<init>(File.java:222)
        at org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:276)
        at org.apache.jackrabbit.jca.JCARepositoryManager.createNonTransientRepository(JCARepositoryManager.java:108)
        at org.apache.jackrabbit.jca.JCARepositoryManager.createRepository(JCARepositoryManager.java:77)
        at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.getRepository(JCAManagedConnectionFactory.java:205)
        at org.apache.jackrabbit.jca.JCAManagedConnection.openSession(JCAManagedConnection.java:100)
        at org.apache.jackrabbit.jca.JCAManagedConnection.<init>(JCAManagedConnection.java:85)
        at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createManagedConnection(JCAManagedConnectionFactory.java:174)
        at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createManagedConnection(JCAManagedConnectionFactory.java:166)
        at com.sun.enterprise.resource.allocator.ConnectorAllocator.createResource(ConnectorAllocator.java:160)
        at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)
        ... 77 more

        #]
        Show
        Gustavo Orair added a comment - There is another problem with this patch. If config is null, it will call the method in line 108: config = RepositoryConfig.create(configFile, homeDir); It will result in an NPE (Null Pointer Exception) on org.apache.jackrabbit.core.config.RepositoryConfig line 276: URI uri = new File(file).toURI(); Following stack trace is provided: Caused by: java.lang.NullPointerException at java.io.File.<init>(File.java:222) at org.apache.jackrabbit.core.config.RepositoryConfig.create(RepositoryConfig.java:276) at org.apache.jackrabbit.jca.JCARepositoryManager.createNonTransientRepository(JCARepositoryManager.java:108) at org.apache.jackrabbit.jca.JCARepositoryManager.createRepository(JCARepositoryManager.java:77) at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.getRepository(JCAManagedConnectionFactory.java:205) at org.apache.jackrabbit.jca.JCAManagedConnection.openSession(JCAManagedConnection.java:100) at org.apache.jackrabbit.jca.JCAManagedConnection.<init>(JCAManagedConnection.java:85) at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createManagedConnection(JCAManagedConnectionFactory.java:174) at org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createManagedConnection(JCAManagedConnectionFactory.java:166) at com.sun.enterprise.resource.allocator.ConnectorAllocator.createResource(ConnectorAllocator.java:160) at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907) ... 77 more #]
        Hide
        Claus Köll added a comment -

        Thanks for hint i opened a new issue JCR-3176

        Show
        Claus Köll added a comment - Thanks for hint i opened a new issue JCR-3176
        Hide
        Gustavo Orair added a comment -

        I checked the patch and seems like configInputStream is not being closed.
        Am I right?

        Show
        Gustavo Orair added a comment - I checked the patch and seems like configInputStream is not being closed. Am I right?
        Hide
        Claus Köll added a comment -

        Committed revision 1205295.

        Show
        Claus Köll added a comment - Committed revision 1205295.
        Hide
        Jukka Zitting added a comment -

        +1 looks good to me

        Show
        Jukka Zitting added a comment - +1 looks good to me
        Hide
        Claus Köll added a comment -

        I would prefer that if we use the "old" parameters homeDir and configFile to create the repository not transient (create repo via RepositoryConfig.create)
        WDOT ?

        Show
        Claus Köll added a comment - I would prefer that if we use the "old" parameters homeDir and configFile to create the repository not transient (create repo via RepositoryConfig.create) WDOT ?

          People

          • Assignee:
            Claus Köll
            Reporter:
            Claus Köll
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development