JCR リポジトリを作成しようとしています。私はTomcat 7とjdk 6とjarを次のように使用しています:
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
サーバーの私の Context.xml ファイル:
<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>
私のサーブレットクラス:
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...
行 3) で次のようなエラーが発生します。
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)
および My repository.xml ファイルには以下が含まれます。
<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>
リポジトリ パスでは、リポジトリ フォルダが生成され、データベースにも名前付きテーブルが作成されていることがわかります。ここで何がうまくいかず、ここで何を変更すればプログラムが実行されますか。また、他のアプリケーションがこのリポジトリを呼び出せるように RMI を構成するにはどうすればよいですか? 助けてください、先週からここで立ち往生しています。前もって感謝します。