jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister" <dominique.pfis...@day.com>
Subject Re: Cluster Connection to Oracle Database
Date Wed, 27 Feb 2008 08:53:21 GMT
Hi,

You should probably use the more concrete OracleDatabaseJournal class
in your repository.xml configuration, because this class will replace
the Oracle-specific ${tablespace} in oracle.ddl. I googled your NPE
and apparently this is what happens when unknown escapes are passed in
SQL statements.

Hope this helps
Dominique

On 27/02/2008, m k <mkwhitacre@gmail.com> wrote:
> Has anyone been able to connect to an Oracle database with Clustering
>  configured?  I'll attach the stack trace below but it seems to be encounter
>  a NPE in the driver I have for Oracle.  I'm using the
>  com.oracle:ojdbc1.4:10.2.0.2.0:jar[1] (The checksum files for the jar we
>  bought commercially)  I've also included the cluster configuration section
>  of the repository.xml.  The persistence manager section for the has also
>  been setup so with externalBLOBs set to false.  I did remove the actual
>  servers name but the URL value is the same as the URL used other places in
>  the repository.xml file.  If I remove the Cluster section I'm able to
>  connect just fine to the database and right now we are successfully working
>  and interacting with the repository (minus the issues that clustering
>  solves).  Is there an issue connecting to a database that hasn't previously
>  had Clustering turned on?  Or might have other open sessions while I'm
>  trying to connect?
>
>  I already mentioned the oracle driver I'm using and I running against
>  Jackrabbit 1.4 with jackrabbit-core 1.4.1 on a 1.5 JDK.  If anyone has seen
>  this type of problem and know what I'm doing wrong or if I'm missing some
>  configuration please let me know.
>
>  Thanks,
>  Micah
>
>  Cluster config in Repository.xml:
>     <Cluster id="Node1" syncDelay="100">
>         <Journal
>             class="org.apache.jackrabbit.core.journal.DatabaseJournal">
>             <param name="revision" value="${rep.home}/revision.log" />
>             <param name="url"
>                 value="jdbc:oracle:thin:@serverName:1521:config" />
>             <param name="driver"
>                 value="oracle.jdbc.driver.OracleDriver" />
>             <param name="user" value="system" />
>             <param name="password" value="password" />
>         </Journal>
>     </Cluster>
>
>
>  Test I'm running to connect to a repository:
>
>  import java.net.URI;
>  import java.net.URISyntaxException;
>  import java.net.URL;
>
>  import javax.jcr.RepositoryException;
>  import javax.jcr.Session;
>
>  import org.apache.jackrabbit.core.RepositoryImpl;
>  import org.apache.jackrabbit.core.config.ConfigurationException;
>  import org.apache.jackrabbit.core.config.RepositoryConfig;
>  import org.junit.Test;
>
>  public class ConnectionClusterTest {
>     @Test
>     public void testOracleClusterConnection() throws URISyntaxException,
>  ConfigurationException {
>         URL resource = ConnectionClusterTest.class.getResource("
>  repository.xml");
>
>         final URI uri = resource.toURI();
>
>         RepositoryConfig config = RepositoryConfig.create(uri,
>  "c:/test/repo_home");
>         RepositoryImpl repImpl;
>         try {
>             repImpl = RepositoryImpl.create(config);
>             Session session = repImpl.login();
>         } catch (RepositoryException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>     }
>  }
>
>
>  Stack Trace:
>  javax.jcr.RepositoryException: Unable to create connection.: Unable to
>  create connection.
>     at org.apache.jackrabbit.core.RepositoryImpl.createClusterNode(
>  RepositoryImpl.java:650)
>     at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java
>  :288)
>     at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java
>  :557)
>     at
>  com.cerner.system.configuration.repository.jcr.ConnectionClusterTest.testOracleClusterConnection
>  (ConnectionClusterTest.java:25)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
>  NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>  DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
>     at org.junit.internal.runners.MethodRoadie.runTestMethod(
>  MethodRoadie.java:98)
>     at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
>     at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(
>  MethodRoadie.java:87)
>     at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
>     at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>     at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(
>  JUnit4ClassRunner.java:88)
>     at org.junit.internal.runners.JUnit4ClassRunner.runMethods(
>  JUnit4ClassRunner.java:51)
>     at org.junit.internal.runners.JUnit4ClassRunner$1.run(
>  JUnit4ClassRunner.java:44)
>     at org.junit.internal.runners.ClassRoadie.runUnprotected(
>  ClassRoadie.java:27)
>     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java
>  :37)
>     at org.junit.internal.runners.JUnit4ClassRunner.run(
>  JUnit4ClassRunner.java:42)
>     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>  JUnit4TestReference.java:38)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>  TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>  RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>  RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>  RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>  RemoteTestRunner.java:196)
>  Caused by: org.apache.jackrabbit.core.cluster.ClusterException: Unable to
>  create connection.
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :238)
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :209)
>     at org.apache.jackrabbit.core.RepositoryImpl.createClusterNode(
>  RepositoryImpl.java:647)
>     ... 25 more
>  Caused by: java.lang.NullPointerException
>     at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)
>     at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:952)
>     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
>  OracleStatement.java:1168)
>     at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(
>  OracleStatement.java:1614)
>     at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java
>  :1579)
>     at org.apache.jackrabbit.core.journal.DatabaseJournal.checkSchema(
>  DatabaseJournal.java:617)
>     at org.apache.jackrabbit.core.journal.DatabaseJournal.init(
>  DatabaseJournal.java:204)
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :233)
>     ... 27 more
>  org.apache.jackrabbit.core.cluster.ClusterException: Unable to create
>  connection.
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :238)
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :209)
>     at org.apache.jackrabbit.core.RepositoryImpl.createClusterNode(
>  RepositoryImpl.java:647)
>     at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java
>  :288)
>     at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java
>  :557)
>     at
>  com.cerner.system.configuration.repository.jcr.ConnectionClusterTest.testOracleClusterConnection
>  (ConnectionClusterTest.java:25)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
>  NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>  DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
>     at org.junit.internal.runners.MethodRoadie.runTestMethod(
>  MethodRoadie.java:98)
>     at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
>     at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(
>  MethodRoadie.java:87)
>     at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
>     at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>     at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(
>  JUnit4ClassRunner.java:88)
>     at org.junit.internal.runners.JUnit4ClassRunner.runMethods(
>  JUnit4ClassRunner.java:51)
>     at org.junit.internal.runners.JUnit4ClassRunner$1.run(
>  JUnit4ClassRunner.java:44)
>     at org.junit.internal.runners.ClassRoadie.runUnprotected(
>  ClassRoadie.java:27)
>     at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java
>  :37)
>     at org.junit.internal.runners.JUnit4ClassRunner.run(
>  JUnit4ClassRunner.java:42)
>     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
>  JUnit4TestReference.java:38)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
>  TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>  RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
>  RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
>  RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
>  RemoteTestRunner.java:196)
>  Caused by: java.lang.NullPointerException
>     at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)
>     at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:952)
>     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
>  OracleStatement.java:1168)
>     at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(
>  OracleStatement.java:1614)
>     at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java
>  :1579)
>     at org.apache.jackrabbit.core.journal.DatabaseJournal.checkSchema(
>  DatabaseJournal.java:617)
>     at org.apache.jackrabbit.core.journal.DatabaseJournal.init(
>  DatabaseJournal.java:204)
>     at org.apache.jackrabbit.core.cluster.ClusterNode.init(ClusterNode.java
>  :233)
>     ... 27 more
>
>  [1] - http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.2.0.2.0/
>

Mime
View raw message