Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
JSR-170 and Spring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I'll have to see how other implementations (jeceira for example) create their workspaces; in most of the cases a fixed number of workspaces will be used, usually through configuration (which can be programaticallly or declaratively) so there wouldn't be much gain from having such a method.
    Moreover, it would need separate class for every JCR-implementation which complicates things.


    • #17
      Well, there's already separate classes for jackrabbit and jeceira... they both have a RepositoryFactoryBean, and when jeceira is able to handle transactions, I'm assuming it will get a LocalTransactionManager as well. The code I'm suggesting would be very simple, and could be added to

      public void createWorkspace( String name )
          throw new InvalidDataAccessApiUsageException(
              "JCR does not specify a mechanism for creating workspaces. You must "
              + "use an implementation specific subclass." );
      This way, if the implementation doesn't support workspace creation in a manner that is accessible at runtime, this method will do the right thing. Concrete subclasses that have implementation-specific utilities can also do the right thing and create the workspace. In the case of Jackrabbit, for that to work, the implementation specific subclass would need to have a JcrSessionFactory (set to the default workspace) wired into it.

      I do agree though, that it may be more work than is needed to make things work for the common case.


      • #18
        Mark,can you post some code?

        Mark,thank you very much!
        Great idea!
        Can you post some code?


        • #19
          All the code I have is for my system, and I'm not even positive it works yet. Like I said, when am sure that this scheme works, I'll put together a small example to demonstrate it; code will be included in that. But that's a few weeks off a this point. I'm under a hard deadline for the end of March so I can't spare the cycles for the example until after that deadline is passed.



          • #20
            Why raise exception

            I implement it by your method,and some method raise exception:

            javax.jcr.RepositoryException: this session has been closed
            at org.apache.jackrabbit.core.SessionImpl.sanityCheck (

            How do you solved the problem?


            • #21
              It depends on what version of Jackrabbit you are using - I had errors like this in the past and the solution was a fix on the CVS. Make sure you get the latest version and in case the error keeps poping up take the issue with Jackrabbit.
              In most cases, the problem comes from the fact that the jcr session you are using is closed.


              • #22

                Thank you! I resolved the problem.
                Could you tell me when to release the next springmodules including JCR?


                • #23
                  Basically, the next release of spring modules will include the JCR along with a lot of new modules. Hopefully, the release will happen in the near future (1 months or so) - the main hold up being the infrastructure refactoring.
                  There are a number of cool features right now on the CVS and the entire team wants them released to the public.


                  • #24
                    For an update on Magnolia CMS & Spring integration, see this post: