我尝试使用带有 Oracle DB 的 Jackrabbit 作为持久层。因此,我在 Tomcat 6 服务器(本地)上安装了 Jackrabbit。数据库在虚拟机中运行。从 Jackrabbits 项目页面安装 war 文件后,我使用了默认安装机制。之后我更改了配置(repository.xml)并删除了所有文件夹(工作区和存储库)。所以我的 Jackrabbit 文件夹只包含 repositry.xml 和 bootstrap.properties。
这是我的repository.xml
<Repository>
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
<param name="schema" value="oracle"/>
</FileSystem>
<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
<param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
</DataStore>
<Security appName="Jackrabbit">
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
</SecurityManager>
<AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
</AccessManager>
<LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
<param name="anonymousId" value="anonymous"/>
<param name="adminId" value="admin"/>
</LoginModule>
</Security>
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
<Workspace name="${wsp.name}">
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
<param name="schemaObjectPrefix" value="${wsp.home}_"/>
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
<param name="tableSpace" value=""/>
<param name="externalBLOBs" value="false"/>
<param name="schemaObjectPrefix" value="${wsp.home}_"/>
</PersistenceManager>
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
<param name="supportHighlighting" value="true"/>
</SearchIndex>
</Workspace>
<Versioning rootPath="${rep.home}/version">
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">
<param name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<param name="user" value="JCR" />
<param name="password" value="test"/>
<param name="tableSpace" value=""/>
<param name="externalBLOBs" value="false"/>
<param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>
</Versioning>
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${rep.home}/repository/index"/>
<param name="supportHighlighting" value="true"/>
</SearchIndex>
</Repository>
使用此配置,我在启动 tomcat 时遇到以下异常:
javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353) [jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486) [jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311) [jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589) [jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:445) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:413) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:242) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:215) [RepositoryStartupServlet.class:na]
at javax.servlet.GenericServlet.init(GenericServlet.java:241) [servlet-api-2.5.jar:2.5]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) [catalina.jar:6.0.35]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardService.start(StandardService.java:525) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) [catalina.jar:6.0.35]
at org.apache.catalina.startup.Catalina.start(Catalina.java:595) [catalina.jar:6.0.35]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_33]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_33]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_33]
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.35]
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.35]
Caused by: org.apache.jackrabbit.core.config.ConfigurationException: Configured class org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager does not contain a property named tableSpace
at org.apache.jackrabbit.core.config.BeanConfig.newInstance(BeanConfig.java:206) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1340) [jackrabbit-core-2.4.2.jar:2.4.2]
... 34 common frames omitted
2012-08-23 16:14:41.657 INFO [main] RepositoryImpl.java:1060 Shutting down repository...
2012-08-23 16:14:41.662 INFO [main] RepositoryImpl.java:1165 Repository has been shutdown
2012-08-23 16:14:41.663 ERROR [main] RepositoryStartupServlet.java:250 RepositoryStartupServlet initializing failed: org.apache.jackrabbit.j2ee.ServletExceptionWithCause: Error while creating repository
org.apache.jackrabbit.j2ee.ServletExceptionWithCause: Error while creating repository
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:415) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartupServlet.java:242) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupServlet.java:215) [RepositoryStartupServlet.class:na]
at javax.servlet.GenericServlet.init(GenericServlet.java:241) [servlet-api-2.5.jar:2.5]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) [catalina.jar:6.0.35]
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) [catalina.jar:6.0.35]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) [catalina.jar:6.0.35]
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardService.start(StandardService.java:525) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) [catalina.jar:6.0.35]
at org.apache.catalina.startup.Catalina.start(Catalina.java:595) [catalina.jar:6.0.35]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_33]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_33]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_33]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_33]
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.35]
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.35]
Caused by: javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1353) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:486) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(RepositoryStartupServlet.java:445) [RepositoryStartupServlet.class:na]
at org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(RepositoryStartupServlet.java:413) [RepositoryStartupServlet.class:na]
... 29 common frames omitted
Caused by: org.apache.jackrabbit.core.config.ConfigurationException: Configured class org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager does not contain a property named tableSpace
at org.apache.jackrabbit.core.config.BeanConfig.newInstance(BeanConfig.java:206) ~[jackrabbit-core-2.4.2.jar:2.4.2]
at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1340) ~[jackrabbit-core-2.4.2.jar:2.4.2]
... 34 common frames omitted
谁能帮我解决这个问题?