Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

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.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Migration to jackrabbit 1.5.3 + Spring-modules 0.9 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Migration to jackrabbit 1.5.3 + Spring-modules 0.9

    I'm running some test for a migration to JackRabbit 1.5.3.
    I'm getting a exception starting the repository.
    Does spring-modules 0.9 work with jackrabbit 1.5.3 ?

    where is my configuration

    Spring 2.0.6
    Spring-modules 0.9
    JackRabbit 1.5.3


    some help would be greatly welcomed.

    Cheers

    the spring-config ...............................................

    <?xml version="1.0" encoding="UTF-8"?>
    <beans>

    <bean id="repository" class="org.springmodules.jcr.jackrabbit.Repository FactoryBean">
    <property name="configuration" value="classpath:/pt/telindus/jck/optmz/optzm-repository.xml"/>
    <property name="homeDir" value="file:migration-repository"/>
    </bean>

    <!--Session factory -->
    <bean id="jcrSessionFactory" class="org.springmodules.jcr.jackrabbit.Jackrabbit SessionFactory" >
    <property name="repository" ref="repository"/>
    <property name="credentials">
    <bean class="javax.jcr.SimpleCredentials">
    <constructor-arg index="0" value="telindus"/>
    <constructor-arg index="1">
    <bean factory-bean="password" factory-method="toCharArray"/>
    </constructor-arg>
    </bean>
    </property>
    <!--
    <property name="contentType" value="text/x-jcr-cnd"/>
    <property name="nodeDefinitions">
    <list>
    <value>classpath:/pt/telindus/ikon/dao/jackrabbit/telindus.cnd</value>
    </list>
    </property>
    -->
    </bean>

    <bean id="password" class="java.lang.String">
    <constructor-arg index="0" value="telindus"/>
    </bean>

    <bean id="jcrTransactionManager" class="org.springmodules.jcr.jackrabbit.LocalTrans actionManager">
    <property name="sessionFactory" ref="jcrSessionFactory"/>
    </bean>

    <bean id="jcrTemplate" class="org.springmodules.jcr.JcrTemplate">
    <property name="sessionFactory" ref="jcrSessionFactory"/>
    <property name="allowCreate" value="true"/>
    </bean>

    <bean id="jcrRepositoryDao" class="pt.telindus.jck.optmz.dao.impl.JcrRepositor yDaoImpl">
    <property name="jcrTemplate" ref="jcrTemplate"/>
    </bean>
    </beans>

    and the code that throws the exception

    private void createAttachment(final AttachmentPoint attachmentPoint, final Attachment attachment) {
    jcrTemplate.execute(new JcrCallback() {
    public Object doInJcr(Session session) throws IOException, RepositoryException {

    List<Node> parentNodesList = getCheckedOutParentNodes(session, attachmentPoint);
    Node lastNode = parentNodesList.get(parentNodesList.size() - 1);

    Node fileNode = lastNode.addNode(Text.escapeIllegalJcrChars(attach ment.getName()), jcrConstants.getNT_FILE());
    fileNode.addMixin(jcrConstants.getMIX_VERSIONABLE( ));
    parentNodesList.add(fileNode);

    Node contentNode = fileNode.addNode(jcrConstants.getJCR_CONTENT(), RESOURCE);
    contentNode.addMixin(jcrConstants.getMIX_VERSIONAB LE());
    contentNode.setProperty(jcrConstants.getJCR_MIMETY PE(), attachment.getMimeType());
    contentNode.setProperty(jcrConstants.getJCR_ENCODI NG(), "UTF-8");
    contentNode.setProperty(jcrConstants.getJCR_DATA() , attachment.getInputStream());
    contentNode.setProperty(jcrConstants.getJCR_LASTMO DIFIED(), attachment.getDate().getTime());
    contentNode.setProperty(USERNAME, attachment.getUsername());
    if (attachment.getDescription() != null) {
    contentNode.setProperty(DESCRIPTION, attachment.getDescription());
    }
    parentNodesList.add(contentNode);

    session.save();
    doCheckin(parentNodesList);

    //Set this attachment the uuid value
    attachment.setUuid(fileNode.getUUID());

    return null;
    }
    });
    }


    70 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - Starting repository...
    96 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSyste m - LocalFileSystem initialized at path /Users/ptraca/develop/code-repo/telindus/jackRabbit-Optmz/runtime/migration-repository/repository
    260 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSyste m - LocalFileSystem initialized at path /Users/ptraca/develop/code-repo/telindus/jackRabbit-Optmz/runtime/migration-repository/version
    278 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSyste m - LocalFileSystem initialized at path /Users/ptraca/develop/code-repo/telindus/jackRabbit-Optmz/runtime/migration-repository/version/blobs
    318 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - initializing workspace 'ikon2'...
    318 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSyste m - LocalFileSystem initialized at path /Users/ptraca/develop/code-repo/telindus/jackRabbit-Optmz/runtime/migration-repository/workspaces/ikon2
    318 [main] INFO org.apache.jackrabbit.core.fs.local.LocalFileSyste m - LocalFileSystem initialized at path /Users/ptraca/develop/code-repo/telindus/jackRabbit-Optmz/runtime/migration-repository/workspaces/ikon2/blobs
    497 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - workspace 'ikon2' initialized
    554 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - Repository started
    615 [main] INFO org.apache.jackrabbit.core.security.simple.SimpleS ecurityManager - init: using Repository LoginModule configuration for ikon2
    618 [main] INFO org.apache.jackrabbit.core.RepositoryImpl - SecurityManager = class org.apache.jackrabbit.core.security.simple.SimpleS ecurityManager
    Creating new attachment Object [ size : 1024000]
    Creating new attachment Object [ size : 1024000]
    org.springmodules.jcr.JcrSystemException: Repository access exception; nested exception is javax.jcr.RepositoryException: this session has been closed
    Caused by: javax.jcr.RepositoryException: this session has been closed
    at org.apache.jackrabbit.core.SessionImpl.sanityCheck (SessionImpl.java:375)
    at org.apache.jackrabbit.core.WorkspaceImpl.sanityChe ck(WorkspaceImpl.java:175)
    at org.apache.jackrabbit.core.WorkspaceImpl.getNamesp aceRegistry(WorkspaceImpl.java:519)
    at org.apache.jackrabbit.commons.AbstractSession.getN amespacePrefix(AbstractSession.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springmodules.jcr.JcrTemplate$LogoutSuppressin gInvocationHandler.invoke(JcrTemplate.java:712)
    at $Proxy0.getNamespacePrefix(Unknown Source)
    at org.springmodules.jcr.JcrConstants.computeName(Jcr Constants.java:388)
    at org.springmodules.jcr.JcrConstants.resolveName(Jcr Constants.java:369)
    at org.springmodules.jcr.JcrConstants.getNT_UNSTRUCTU RED(JcrConstants.java:942)
    at pt.telindus.jck.optmz.dao.impl.JcrRepositoryDaoImp l.getCheckedOutParentNodes(JcrRepositoryDaoImpl.ja va:257)
    at pt.telindus.jck.optmz.dao.impl.JcrRepositoryDaoImp l.access$200(JcrRepositoryDaoImpl.java:23)
    at pt.telindus.jck.optmz.dao.impl.JcrRepositoryDaoImp l$4.doInJcr(JcrRepositoryDaoImpl.java:114)
    at org.springmodules.jcr.JcrTemplate.execute(JcrTempl ate.java:76)
    at org.springmodules.jcr.JcrTemplate.execute(JcrTempl ate.java:108)
    at pt.telindus.jck.optmz.dao.impl.JcrRepositoryDaoImp l.createAttachment(JcrRepositoryDaoImpl.java:111)
    at pt.telindus.jck.optmz.dao.impl.JcrRepositoryDaoImp l.saveAttachment(JcrRepositoryDaoImpl.java:97)
    at pt.telindus.jck.optmz.JackRabbitOptimizer.insertTw oVersions(JackRabbitOptimizer.java:122)
    at pt.telindus.jck.optmz.JackRabbitOptimizer.main(Jac kRabbitOptimizer.java:89)
Working...
X