App Engine - Unit testing with MySQL - Too Many Connection - mysql

My unit testing fail from time to time and more often since the testing part are getting bigger i get the following error:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1104)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at vidaao.DataBase.getInstance(DataBase.java:30)
at vidaao.DataBase.getLastInseredId(DataBase.java:57)
at db.DbLocation.add(DbLocation.java:39)
at testDb.DbSkillUnitTestCase.setUp(DbSkillUnitTestCase.java:47)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1104)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at vidaao.DataBase.getInstance(DataBase.java:30)
at db.DbUser.delete(DbUser.java:51)
at testDb.DbSkillUnitTestCase.tearDown(DbSkillUnitTestCase.java:77)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:36)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

The solution is to close all opened statement after a query,
like this for example:
PreparedStatement stmt = DataBase.getInstance().prepareStatement(sql);
//code
//close statement
stmt.close();

Related

The MySQL server is running with the --super-read-only option so it cannot execute this statement

I am using MySQL single master multi salve cluster 5.7 in kubernetes cluster v1.16. I install the cluster using helm chart like this:
./helm install report incubator/mysqlha -n middleware
So I configure the connection link in my app like this:
jdbc:mysql://report-mysqlha.middleware.svc.cluster.local:3306/hub_pro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&useSSL=false&verifyServerCertificate=false&allowMultiQueries=true
when I start my application,shows this error log:
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: The MySQL server is running with the --super-read-only option so it cannot execute this statement
### The error may exist in class path resource [mybatis/mapper/illidan/TenantOverviewMapper.xml]
### The error may involve com.sportswin.soa.illidan.hub.dao.TenantOverviewMapper.updateByPrimaryKeySelective-Inline
### The error occurred while setting parameters
### SQL: update h_tenant_overview SET tenant_name = ?, start_access_time = ?, create_account = ?, user_spent = ?, tenant_revenue = ?, agent_take_ratio = ?, agent_revenue = ?, tenant_code = ?, reg_count = ?, tenant_id = ?, statistic_time = ?, updated_time = ? where id = ?
### Cause: java.sql.SQLException: The MySQL server is running with the --super-read-only option so it cannot execute this statement
; uncategorized SQLException; SQL state [HY000]; error code [1290]; The MySQL server is running with the --super-read-only option so it cannot execute this statement; nested exception is java.sql.SQLException: The MySQL server is running with the --super-read-only option so it cannot execute this statement
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) ~[mybatis-spring-2.0.2.jar!/:2.0.2]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) ~[mybatis-spring-2.0.2.jar!/:2.0.2]
at com.sun.proxy.$Proxy145.update(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:287) ~[mybatis-spring-2.0.2.jar!/:2.0.2]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67) ~[mybatis-3.5.2.jar!/:3.5.2]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy147.updateByPrimaryKeySelective(Unknown Source) ~[na:na]
at com.sportswin.soa.illidan.service.impl.HomeService.insertOrUpdate(HomeService.java:84) ~[classes!/:na]
at com.sportswin.soa.illidan.service.impl.HomeService$$FastClassBySpringCGLIB$$51f41045.invoke(<generated>) ~[classes!/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72) ~[druid-1.1.9.jar!/:1.1.9]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.sportswin.soa.illidan.service.impl.HomeService$$EnhancerBySpringCGLIB$$777629ab.insertOrUpdate(<generated>) ~[classes!/:na]
at com.sportswin.soa.illidan.service.impl.HomeService$$FastClassBySpringCGLIB$$51f41045.invoke(<generated>) ~[classes!/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72) ~[druid-1.1.9.jar!/:1.1.9]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at com.sportswin.soa.illidan.service.impl.HomeService$$EnhancerBySpringCGLIB$$624d3217.insertOrUpdate(<generated>) ~[classes!/:na]
at com.sportswin.soa.illidan.hub.controller.impl.analysis.TenantOverviewController.generateTenantOverviewInfo(TenantOverviewController.java:113) ~[classes!/:na]
at com.sportswin.soa.illidan.hub.controller.impl.analysis.TenantOverviewController.statistic(TenantOverviewController.java:80) ~[classes!/:na]
at com.sportswin.soa.illidan.hub.controller.impl.analysis.TenantOverviewController.g(TenantOverviewController.java:62) ~[classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) [spring-context-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) [spring-context-5.1.13.RELEASE.jar!/:5.1.13.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_212]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_212]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
Caused by: java.sql.SQLException: The MySQL server is running with the --super-read-only option so it cannot execute this statement
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute$original$z6ncbhXt(ClientPreparedStatement.java:370) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute$original$z6ncbhXt$accessor$r1XOtRdH(ClientPreparedStatement.java) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.mysql.cj.jdbc.ClientPreparedStatement$auxiliary$6xe4F6qJ.call(Unknown Source) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:93) ~[skywalking-agent.jar:6.5.0]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.filter.FilterAdapter.preparedStatement_execute(FilterAdapter.java:1080) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167) ~[druid-1.1.9.jar!/:1.1.9]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.9.jar!/:1.1.9]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy232.execute(Unknown Source) ~[na:na]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) ~[mybatis-3.5.2.jar!/:3.5.2]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.5.2.jar!/:3.5.2]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.2.jar!/:3.5.2]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sportswin.soa.misc.interceptor.db.DefaultTimeInterceptor.invokeUpdate(DefaultTimeInterceptor.java:97) ~[soa-misc-1.0.0-SNAPSHOT.jar!/:na]
at com.sportswin.soa.misc.interceptor.db.DefaultTimeInterceptor.intercept(DefaultTimeInterceptor.java:59) ~[soa-misc-1.0.0-SNAPSHOT.jar!/:na]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy230.update(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sportswin.soa.misc.interceptor.db.DynamicDataSourceInterceptor.intercept(DynamicDataSourceInterceptor.java:98) ~[soa-misc-1.0.0-SNAPSHOT.jar!/:na]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy230.update(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy230.update(Unknown Source) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.5.2.jar!/:3.5.2]
at com.sun.proxy.$Proxy230.update(Unknown Source) ~[na:na]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.2.jar!/:3.5.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.2.jar!/:2.0.2]
... 39 common frames omitted
for a moment this error disappeared, I execute the update statement period. I checked the pod and no MySQL node restart. What situation may cause this problem?
Now I force the app using the master node to avoid this problem:
spring.datasource.druid.illidan.master.url = jdbc:mysql://report-mysqlha-0.middleware.svc.cluster.local:3306/report_pro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&useSSL=false&verifyServerCertificate=false
report-mysqlha-0 is the master node service name of MySQL in kubernetes cluster.

Tomcat 7 connect to remote MySQL host

I am trying to connect Tomcat 7.0.54 to a remote MySQL host - I have enabled remote access on the remote MySQL server and I can ping the remote MySQL server and can connect and list tables etc remotely from the Tomcat host.
When I try and connect in Tomcat application I get an error:
Communications link failure The last packet sent successfully to the
server was 0 milliseconds ago. The driver has not received any packets
from the server.
and then further down in the dump I get:
Inner error: Message: Connection refused
I am a complete newbie to Tomcat so I am struggling to know where to go with this - I can connect to MySQL so it doesn't seem to be the remote MySQL server or networking which means something in Tomcat or the Java app is causing the problem. There is nothing in the Tomcat log files nor the application itself pointing to an issue - what else can I try?
Trace dump:
Inner error: Message: Communications link failure The last packet
sent successfully to the server was 0 milliseconds ago. The driver has
not received any packets from the server. Source: Stack Trace: at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:355) at
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2461)
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2498)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822) at
com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404) at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at
Mainsoft.Data.Jdbc.Providers.GenericProvider$JdbcUrlConnector.get_Connection(GenericProvider.cs:183)
at
Mainsoft.Data.Jdbc.Providers.GenericProvider.GetConnection(GenericProvider.cs:336)
at
system.Data.ProviderBase.AbstractDBConnection.Open(AbstractDBConnection.cs:495)
at rdServer.rdSqlReader.(Unknown Source) at
rdServer.rdDb.access$4300(Unknown Source) at
rdServer.rdDb.CreateDataReader(Unknown Source) at
rdServer.rdDb.ProcessData(Unknown Source) at
rdServer.rdDb.ProcessDataLayerElement(Unknown Source) at
rdServer.rdDb.xmlGetData(Unknown Source) at
rdServer.rdDb9.xmlGetData(Unknown Source) at
rdServer.rdAnalysisGrid10.ResetData(Unknown Source) at
rdServer.rdAnalysisGrid10.BuildAnalysisGrid(Unknown Source) at
rdServer.PageBuilder.sProcess_AnalysisGrid(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElementChildren(Unknown Source)
at rdServer.PageBuilder.sProcess_Body(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElementChildren(Unknown Source)
at rdServer.PageBuilder.sProcess_Report(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.BuildHtml(Unknown Source) at
rdServer.ResponseBuilder.BuildResponse(Unknown Source) at
ASP.rdpage_aspx.__Render__control1(rdPage.aspx:4) at
ASP.rdpage_aspx$__Impl0.Invoke(Unknown Source) at
system.Web.UI.Control.RenderChildren(Control.cs:1101) at
system.Web.UI.Control.Render(Control.cs:1090) at
system.Web.UI.Page.Render(Page.cs:1095) at
system.Web.UI.Control.RenderControl(Control.cs:1254) at
system.Web.UI.Page.RenderPage(Page.cs:1621) at
system.Web.UI.Page.encodeChildren(Page.jvm.cs:159) at
Mainsoft.Web.Hosting.BaseFacesViewHandler.renderView(BaseFacesViewHandler.cs:58)
at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at
Mainsoft.Web.Hosting.ServletFacesPageHandler.ProcessRequest(ServletFacesPageHandler.cs:116)
at
Mainsoft.Web.Hosting.SessionWrapper$SessionWrapperHandler.ProcessRequest(SessionWrapper.cs:40)
at
system.Web.HttpApplication$Pipelined__7.MoveNext$Z$$$Pipeline$$d__7$$(HttpApplication.cs:1033)
at system.Web.HttpApplication.Tick(HttpApplication.cs:705) at
system.Web.HttpApplication.Start(HttpApplication.cs:1217) at
system.Web.HttpApplication.System_Web_IHttpAsyncHandler_BeginProcessRequest(HttpApplication.cs:1319)
at system.Web.HttpRuntime.RealProcessRequest(HttpRuntime.cs:482) at
system.Web.HttpRuntime.ProcessRequest(HttpRuntime.cs:523) at
Mainsoft.Web.Hosting.BaseHttpServlet.service(BaseHttpServlet.cs:200)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Inner error: Message: Connection refused Source: Stack Trace: at
java.net.PlainSocketImpl.socketConnect(Native Method) at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at
java.net.Socket.connect(Socket.java:579) at
java.net.Socket.connect(Socket.java:528) at
java.net.Socket.(Socket.java:425) at
java.net.Socket.(Socket.java:241) at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:259)
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:305) at
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2461)
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2498)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822) at
com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404) at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at
Mainsoft.Data.Jdbc.Providers.GenericProvider$JdbcUrlConnector.get_Connection(GenericProvider.cs:183)
at
Mainsoft.Data.Jdbc.Providers.GenericProvider.GetConnection(GenericProvider.cs:336)
at
system.Data.ProviderBase.AbstractDBConnection.Open(AbstractDBConnection.cs:495)
at rdServer.rdSqlReader.(Unknown Source) at
rdServer.rdDb.access$4300(Unknown Source) at
rdServer.rdDb.CreateDataReader(Unknown Source) at
rdServer.rdDb.ProcessData(Unknown Source) at
rdServer.rdDb.ProcessDataLayerElement(Unknown Source) at
rdServer.rdDb.xmlGetData(Unknown Source) at
rdServer.rdDb9.xmlGetData(Unknown Source) at
rdServer.rdAnalysisGrid10.ResetData(Unknown Source) at
rdServer.rdAnalysisGrid10.BuildAnalysisGrid(Unknown Source) at
rdServer.PageBuilder.sProcess_AnalysisGrid(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElementChildren(Unknown Source)
at rdServer.PageBuilder.sProcess_Body(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElementChildren(Unknown Source)
at rdServer.PageBuilder.sProcess_Report(Unknown Source) at
rdServer.PageBuilder.sProcessDefinitionElement(Unknown Source) at
rdServer.PageBuilder.BuildHtml(Unknown Source) at
rdServer.ResponseBuilder.BuildResponse(Unknown Source) at
ASP.rdpage_aspx.__Render__control1(rdPage.aspx:4) at
ASP.rdpage_aspx$__Impl0.Invoke(Unknown Source) at
system.Web.UI.Control.RenderChildren(Control.cs:1101) at
system.Web.UI.Control.Render(Control.cs:1090) at
system.Web.UI.Page.Render(Page.cs:1095) at
system.Web.UI.Control.RenderControl(Control.cs:1254) at
system.Web.UI.Page.RenderPage(Page.cs:1621) at
system.Web.UI.Page.encodeChildren(Page.jvm.cs:159) at
Mainsoft.Web.Hosting.BaseFacesViewHandler.renderView(BaseFacesViewHandler.cs:58)
at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at
Mainsoft.Web.Hosting.ServletFacesPageHandler.ProcessRequest(ServletFacesPageHandler.cs:116)
at
Mainsoft.Web.Hosting.SessionWrapper$SessionWrapperHandler.ProcessRequest(SessionWrapper.cs:40)
at
system.Web.HttpApplication$Pipelined__7.MoveNext$Z$$$Pipeline$$d__7$$(HttpApplication.cs:1033)
at system.Web.HttpApplication.Tick(HttpApplication.cs:705) at
system.Web.HttpApplication.Start(HttpApplication.cs:1217) at
system.Web.HttpApplication.System_Web_IHttpAsyncHandler_BeginProcessRequest(HttpApplication.cs:1319)
at system.Web.HttpRuntime.RealProcessRequest(HttpRuntime.cs:482) at
system.Web.HttpRuntime.ProcessRequest(HttpRuntime.cs:523) at
Mainsoft.Web.Hosting.BaseHttpServlet.service(BaseHttpServlet.cs:200)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

SQLException on opening DB connection Tomcat 7

Getting the exception when tried opening connection from local. But works fine if run on some other machine.
Exception:
java.sql.SQLException: Can't enable noDatetimeStringSync and useTimezone configuration properties at the same time
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
at com.mysql.jdbc.ConnectionImpl.initializeDriverProperties(ConnectionImpl.java:3512)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:823)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.amadeus.selenium.utils.external.nrecampaigner.PublishTestResults.openDBConnection(PublishTestResults.java:289)
at com.amadeus.selenium.utils.external.nrecampaigner.PublishTestResults.publishData(PublishTestResults.java:59)
at com.amadeus.selenium.runner.SeleniumSEPTest.postExecutionSEP(SeleniumSEPTest.java:593)
at com.amadeus.selenium.runner.junit.SEPJUnitListener.testFinished(SEPJUnitListener.java:26)
at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:191)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:61)
at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:188)
at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:39)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:277)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at com.amadeus.selenium.runner.junit.SEPJunit4ClassRunner.runChild(SEPJunit4ClassRunner.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
The issue is not on any other machine. Got to know about timezone sync but both my machine and db are on same timezone! [just different machine..but that should not be any issue]

JobTrackerNotYetInitializedException

I'm using Mac. When I run the below command, it throws an exception. I tried the jar from Hadoop examples, it throws the same exception.
"jps" gives following output:
5103 NameNode
5613 Jps
5343 JobTracker
5277 SecondaryNameNode
5430 TaskTracker
So my JobTracker should be already running.
When I execute:
bin/hadoop jar hadoop-cookbook-chapter1.jar chapter1.WordCount input output
I get following exception:
PriviledgedActionException as:shuuseiyi cause:org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.mapred.**JobTrackerNotYetInitializedException: JobTracker is not yet RUNNING**
at org.apache.hadoop.mapred.JobTracker.checkJobTrackerState(JobTracker.java:5189)
at org.apache.hadoop.mapred.JobTracker.getNewJobId(JobTracker.java:3533)
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:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
Exception in thread "main" org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.mapred.JobTrackerNotYetInitializedException: JobTracker is not yet RUNNING
at org.apache.hadoop.mapred.JobTracker.checkJobTrackerState(JobTracker.java:5189)
at org.apache.hadoop.mapred.JobTracker.getNewJobId(JobTracker.java:3533)
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:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
at org.apache.hadoop.ipc.Client.call(Client.java:1107)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:229)
at org.apache.hadoop.mapred.$Proxy2.getNewJobId(Unknown Source)
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:597)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:85)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:62)
at org.apache.hadoop.mapred.$Proxy2.getNewJobId(Unknown Source)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:944)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:550)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
at chapter1.WordCount.main(WordCount.java:103)
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:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

when i am trying to run jnit test file it showing following error message

Wanted but not invoked this message has been displayed when i am trying to execute junit test file,
Wanted but not invoked:
dbUtilMockProxy.getArrayListHM(
[01-01-2012, 1, edit, 2],
"bc_pos_dist_list"
);
-> at test.bc_hierarchy.action.NodeMaintenanceActionTest.testDistributionList(NodeMaintenanceActionTest.java:409)
Actually, there were zero interactions with this mock.
at test.bc_hierarchy.action.NodeMaintenanceActionTest.testDistributionList(NodeMaintenanceActionTest.java:409)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
assertThat(actualActionForward).isEqualTo(expectedActionForward);
verify(requestMockProxy).getSession(false);
verify(appParams).getSQLQuery(raSqlViewName, raSqlId);
verify(componentsFactoryMock).getDBUtil();
verify(componentsFactoryMock).getDBFetchBean();
verify(sessionMockProxy).getAttribute(tradingDateSessionKey);
verify(requestMockProxy).getParameter(nodeIdKey);
verify(requestMockProxy).getParameter(saveFlagKey);
verify(requestMockProxy).getParameter(levelIndicatorKey);
verify(dbUtilMockProxy).getArrayListHM(givenArgs, expectedProcName);
verify(dbFetchBeanMock).manipulateSQL(givenQuerry, givenArgs);
verify(requestMockProxy).setAttribute("JSON_RESULT", givenJsonObject);
verify(mappingMockProxy).findForward("bcJsonOutput");
You have
verify(dbUtilMockProxy).getArrayListHM(givenArgs, expectedProcName);
This assertion has not been satisfied as getArrayListHN has not been called or has not been called with the parameters supplied.