2009-11-12 15:07:41 net.sf.hajdbc.sql.AbstractDatabaseCluster preRegister
信息: Initializing HA-JDBC 2.0.16-rc-1 from file:/C:/Work/CT-
BON/PoC/JPA/out/production/HA-JDBC/ha-jdbc-test.xml
2009-11-12 15:07:42 net.sf.hajdbc.local.LocalStateManager getInitialState
信息: No initial cluster state found.
2009-11-12 15:07:43 net.sf.hajdbc.sql.AbstractDatabaseCluster preRegister
严重: Failed to start database cluster test.
java.lang.IllegalStateException: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:215)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.start(AbstractDatabaseCluster.jav
a:697)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.preRegister(AbstractDatabaseClust
er.java:1052)
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:83)
at
com.sun.jmx.mbeanserver.MetaDataImpl.preRegisterInvoker(MetaDataImpl.java:237)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Defaul
tMBeanServerInterceptor.java:923)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Default
MBeanServerInterceptor.java:337)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
at net.sf.hajdbc.DatabaseClusterFactory.getDatabaseCluster(DatabaseClusterFact
ory.java:118)
at net.sf.hajdbc.sql.Driver.getDatabaseCluster(Driver.java:180)
at net.sf.hajdbc.sql.Driver.connect(Driver.java:84)
at Test_JDBC_SQL.beforeTest(Test_JDBC_SQL.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfter
Runner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRu
nner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java
:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClas
sMethodsRunner.java:75)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunne
r.java:36)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner
.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTest
Runner.java:22)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitSt
arter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
Caused by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:210)
... 32 more
Caused by: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.test(AbstractDatabaseCluster.java
:252)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.isAlive(AbstractDatabaseCluster.j
ava:230)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:192)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:189)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
ava:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
675)
at java.lang.Thread.run(Thread.java:595)
javax.management.RuntimeMBeanException: RuntimeException thrown in preRegister
method
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:86)
at
com.sun.jmx.mbeanserver.MetaDataImpl.preRegisterInvoker(MetaDataImpl.java:237)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Defaul
tMBeanServerInterceptor.java:923)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Default
MBeanServerInterceptor.java:337)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
at net.sf.hajdbc.DatabaseClusterFactory.getDatabaseCluster(DatabaseClusterFact
ory.java:118)
at net.sf.hajdbc.sql.Driver.getDatabaseCluster(Driver.java:180)
at net.sf.hajdbc.sql.Driver.connect(Driver.java:84)
at Test_JDBC_SQL.beforeTest(Test_JDBC_SQL.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfter
Runner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRu
nner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java
:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClas
sMethodsRunner.java:75)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunne
r.java:36)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner
.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
Caused by: java.lang.IllegalStateException:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:215)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.start(AbstractDatabaseCluster.jav
a:697)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.preRegister(AbstractDatabaseClust
er.java:1052)
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:83)
... 29 more
Caused by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:210)
... 32 more
Caused by: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.test(AbstractDatabaseCluster.java
:252)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.isAlive(AbstractDatabaseCluster.j
ava:230)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:192)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:189)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
ava:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
675)
at java.lang.Thread.run(Thread.java:595)
======== Exit =============
Disconnected from the target VM, address: '127.0.0.1:59955', transport:
'socket'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm - this stack trace seems to imply that the dialect of the cluster is null
during start(). This should have been populated by JiBX during registration of
the cluster mbean. What dialect did you specify in you ha-jdbc configuration
file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I can not start by HA-JDBC by ha-jdbc-2.0.16-rc-1-jdk1.5.jar .
My Code:
Class.forName("net.sf.hajdbc.sql.Driver");
Properties prop=new Properties();
prop.setProperty("config", "ha-jdbc-test.xml");
Driver driver = DriverManager.getDriver("jdbc:ha-jdbc:test");
_conn= driver.connect("jdbc:ha-jdbc:test",prop);
and got exception:
2009-11-12 15:07:41 net.sf.hajdbc.sql.AbstractDatabaseCluster preRegister
信息: Initializing HA-JDBC 2.0.16-rc-1 from file:/C:/Work/CT-
BON/PoC/JPA/out/production/HA-JDBC/ha-jdbc-test.xml
2009-11-12 15:07:42 net.sf.hajdbc.local.LocalStateManager getInitialState
信息: No initial cluster state found.
2009-11-12 15:07:43 net.sf.hajdbc.sql.AbstractDatabaseCluster preRegister
严重: Failed to start database cluster test.
java.lang.IllegalStateException: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:215)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.start(AbstractDatabaseCluster.jav
a:697)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.preRegister(AbstractDatabaseClust
er.java:1052)
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:83)
at
com.sun.jmx.mbeanserver.MetaDataImpl.preRegisterInvoker(MetaDataImpl.java:237)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Defaul
tMBeanServerInterceptor.java:923)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Default
MBeanServerInterceptor.java:337)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
at net.sf.hajdbc.DatabaseClusterFactory.getDatabaseCluster(DatabaseClusterFact
ory.java:118)
at net.sf.hajdbc.sql.Driver.getDatabaseCluster(Driver.java:180)
at net.sf.hajdbc.sql.Driver.connect(Driver.java:84)
at Test_JDBC_SQL.beforeTest(Test_JDBC_SQL.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfter
Runner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRu
nner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java
:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClas
sMethodsRunner.java:75)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunne
r.java:36)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner
.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTest
Runner.java:22)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitSt
arter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
Caused by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:210)
... 32 more
Caused by: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.test(AbstractDatabaseCluster.java
:252)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.isAlive(AbstractDatabaseCluster.j
ava:230)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:192)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:189)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
ava:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
675)
at java.lang.Thread.run(Thread.java:595)
javax.management.RuntimeMBeanException: RuntimeException thrown in preRegister
method
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:86)
at
com.sun.jmx.mbeanserver.MetaDataImpl.preRegisterInvoker(MetaDataImpl.java:237)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(Defaul
tMBeanServerInterceptor.java:923)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(Default
MBeanServerInterceptor.java:337)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
at net.sf.hajdbc.DatabaseClusterFactory.getDatabaseCluster(DatabaseClusterFact
ory.java:118)
at net.sf.hajdbc.sql.Driver.getDatabaseCluster(Driver.java:180)
at net.sf.hajdbc.sql.Driver.connect(Driver.java:84)
at Test_JDBC_SQL.beforeTest(Test_JDBC_SQL.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfter
Runner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRu
nner.java:50)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:33)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java
:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClas
sMethodsRunner.java:75)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunne
r.java:36)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner
.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter
Runner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
Caused by: java.lang.IllegalStateException:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:215)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.start(AbstractDatabaseCluster.jav
a:697)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.preRegister(AbstractDatabaseClust
er.java:1052)
at com.sun.jmx.mbeanserver.BaseMetaDataImpl.preRegisterInvoker(BaseMetaDataImp
l.java:83)
... 29 more
Caused by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.getAliveMap(AbstractDatabaseClust
er.java:210)
... 32 more
Caused by: java.lang.NullPointerException
at net.sf.hajdbc.sql.AbstractDatabaseCluster.test(AbstractDatabaseCluster.java
:252)
at net.sf.hajdbc.sql.AbstractDatabaseCluster.isAlive(AbstractDatabaseCluster.j
ava:230)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:192)
at net.sf.hajdbc.sql.AbstractDatabaseCluster$2.call(AbstractDatabaseCluster.ja
va:189)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
ava:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
675)
at java.lang.Thread.run(Thread.java:595)
======== Exit =============
Disconnected from the target VM, address: '127.0.0.1:59955', transport:
'socket'
Hello,
May be you use :
DriverManager.getConnection(url,User,Pass);
instead of
Hello
May be you use :
DriverManager.getConnection(url,User,Pass);
instead of
DriverManager.getDriver(url).connect(url,info);
Hmm - this stack trace seems to imply that the dialect of the cluster is null
during start(). This should have been populated by JiBX during registration of
the cluster mbean. What dialect did you specify in you ha-jdbc configuration
file?