Q: java.sql.SQLException: Failed to parse bundle deadbeef-face-babe-cafe-babecafebabe I am trying to create JCR Repository. I am using Tomcat 7 and jdk 6 and jars as:
commons-collections-3.2.1.jar
commons-dbcp-1.3.jar
commons-io-2.2.jar
commons-pool-1.5.4.jar
concurrent-1.3.4.jar
jackrabbit-api-2.5.2.jar
jackrabbit-core-2.5.2.jar
jackrabbit-jcr-commons-2.5.2.jar
jackrabbit-spi-2.5.2.jar
jackrabbit-spi-commons-2.5.2.jar
jcr-2.0.jar
log4j-1.2.14.jar
log4j-over-slf4j-1.6.4.jar
lucene-core-4.0.0.jar
postgresql-8.2-504.jdbc4.jar
slf4j-api-1.6.4.jar
xercesImpl-2.8.1.jar
xmlParserAPIs-2.0.2.jar

My Context.xml file of Server:
<Resource 
            name="jcr/repository" 
            auth="Container"
            type="javax.jcr.Repository"
            factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
            configFilePath="C:/comrep/fiplrepository/repository.xml"
            repHomeDir="C:/comrep/fiplrepository/repository"></Resource>

My Servlet Class:
1)...InitialContext inc = new InitialContext();
2)...Context context = (Context) inc.lookup("java:comp/env");
3)...Object repository = context.lookup("jcr/repository");//This line gives error...

Line 3) gives an error as:
javax.jcr.RepositoryException: org.apache.jackrabbit.core.state.ItemStateException: failed to read bundle (stacktrace on DEBUG log level): deadbeef-face-babe-cafe-babecafebabe: java.sql.SQLException: Failed to parse bundle deadbeef-face-babe-cafe-babecafebabe
    at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<init>(InternalVersionManagerImpl.java:208)
    at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:492)
    at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311)
    at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
    at org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:141)
    at org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:117)
    at org.apache.jackrabbit.core.jndi.BindableRepository.<init>(BindableRepository.java:106)
    at org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:52)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)
    at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
    at com.willcode4beer.demo.jcr.JcrDemoServlet.doPost(JcrDemoServlet.java:33)
    at com.willcode4beer.demo.jcr.JcrDemoServlet.doGet(JcrDemoServlet.java:22)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.jackrabbit.core.state.ItemStateException: failed to read bundle (stacktrace on DEBUG log level): deadbeef-face-babe-cafe-babecafebabe: java.sql.SQLException: Failed to parse bundle deadbeef-face-babe-cafe-babecafebabe
    at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:902)
    at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundleCacheMiss(AbstractBundlePersistenceManager.java:766)
    at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundle(AbstractBundlePersistenceManager.java:749)
    at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.exists(AbstractBundlePersistenceManager.java:560)
    at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<init>(InternalVersionManagerImpl.java:162)

and My repository.xml file contain: 
<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository" />
    </FileSystem><!-- security configuration -->
    <Security appName="Jackrabbit">
        <AccessManager
            class="org.apache.jackrabbit.core.security.SimpleAccessManager">
        </AccessManager>
        <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">             
            <param name="anonymousId" value="anonymous" />
        </LoginModule>
    </Security>
    <Workspaces rootPath="${rep.home}/workspaces"
        defaultWorkspace="default" />
    <Workspace name="${wsp.name}">
        <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
        <param name="driver" value="org.postgresql.Driver"/>
          <param name="url" value="jdbc:postgresql://myPort/DMS"/>
          <param name="user" value="postgres" />
          <param name="password" value="pass" />
          <param name="schema" value="postgresql"/>
          <param name="schemaObjectPrefix" value="pm_ws_${wsp.name}_"/>
    </FileSystem>
        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager">
          <param name="driver" value="org.postgresql.Driver"/>
          <param name="url" value="jdbc:postgresql://myPort/DMS"/>
          <param name="user" value="postgres" />
          <param name="password" value="pass" />
          <param name="schema" value="postgresql"/>
          <param name="schemaObjectPrefix" value="pm_ws_${wsp.name}_"/>
           <param name="externalBLOBs" value="false"/>
        </PersistenceManager>
        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index" />
        </SearchIndex>
    </Workspace><!-- Configures the versioning -->
    <Versioning rootPath="${rep.home}/version">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.PostgreSQLPersistenceManager">
          <param name="url" value="jdbc:postgresql://myPort/DMS"/>
          <param name="user" value="postgres" />
          <param name="password" value="pass" />
          <param name="schema" value="postgresql"/>
          <param name="schemaObjectPrefix" value="pm_vs_"/>
        </PersistenceManager>       
    </Versioning>
    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index" />
    </SearchIndex>
</Repository>

In my Repository path I can see that repository folder is generated and also in my database named tables are created. So what going wrong here and what do I change here that program will run.
Also how can I configure for RMI for that my other application can invoke this repository?
Please help me, I stuck here from last week.
Thanks In advance.

A: Are you sure about the lucene core version ?
It seems to me that Jackrabbit 2.5.2 is for Lucene 3.6 not 4.0 thus this might be the cause of your new error.

A: The "failed to read bundle: deadbeef-face-babe..." message is a symptom of a repository inconsistency.  You might find these articles from the Adobe CQ5 knowledge base to be helpful: Fix the "jcr:system" node and Consistency Check.
