SonarQube with MySql setup error - mysql

I have checked this similar issue here but it didnt work in my case.
I am trying to setup SonarQube Server locally on Windows OS[non English language] however i am getting this error on http://localhost:8000:
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109:in `create_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252:in `create_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371:in `initialize_schema_migrations_table'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441:in `initialize'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73:in `automatic_setup'
from C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272:in `(root)'
from org/jruby/RubyKernel.java:1094:in `load'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29)
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98)
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jruby.exceptions.RaiseException: (StatementInvalid) ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
at RUBY.log(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227)
at RUBY.execute(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183)
at RUBY.create_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109)
at RUBY.create_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252)
at RUBY.initialize_schema_migrations_table(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371)
at RUBY.initialize(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441)
at RUBY.up(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401)
at RUBY.migrate(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383)
at RUBY.upgrade_and_start(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62)
at RUBY.automatic_setup(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73)
at RUBY.(root)(C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272)
at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1094)
at RUBY.(root)(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1)
at RUBY.load_environment(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25)
at RUBY.load_environment(file:/C:/Users/s/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79)
Tried:
Checked User Priviledges and Database
Changed default
port no of Sonar in sonar.properties[sonar.web.port=8000] in
case another service is using it
Restarted sonar service
Wrote JDK path manually on wrapper.config(wrapper.java.command=C:\Program Files\Java\jdk1.8.0_60)
[none of the above worked]
Here are my configs sonar.properties:
# User credentials.
# Permissions to create tables, indices and triggers must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
#----- Embedded Database (default)
# It does not accept connections from remote hosts, so the
# server and the analyzers must be executed on the same host.
#sonar.jdbc.url=jdbc:h2:tcp://localhost:9092/sonar
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092
#----- MySQL 5.x
# Only InnoDB storage engine is supported (not myISAM).
# Only the bundled driver is supported.
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
# - If you need to set the schema, please refer to http://jira.codehaus.org/browse/SONAR-5000
#sonar.jdbc.url=jdbc:oracle:thin:#localhost/XE
#----- PostgreSQL 8.x/9.x
# If you don't use the schema named "public", please refer to http://jira.codehaus.org/browse/SONAR-5000
#sonar.jdbc.url=jdbc:postgresql://localhost/sonar
#...
#--------------------------------------------------------------------------------------------------
# WEB SERVER
# Web server is executed in a dedicated Java process. By default heap size is 768Mb.
# Use the following property to customize JVM options.
# Recommendations:
#
# The HotSpot Server VM is recommended. The property -server should be added if server mode
# is not enabled by default on your environment: http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html
#
# Set min and max memory (respectively -Xms and -Xmx) to the same value to prevent heap
# from resizing at runtime.
#
#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError
# Same as previous property, but allows to not repeat all other settings like -Xmx
#sonar.web.javaAdditionalOpts=
# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=127.0.0.1
# Web context. When set, it must start with forward slash (for example /sonarqube).
# The default value is root context (empty value).
#sonar.web.context=/
# TCP port for incoming HTTP connections. Disabled when value is -1.
sonar.web.port=8000
Script used to create Sonar DB:
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'#'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'#'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
here is full sonar.log:
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2015.09.28 09:49:27 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: C:\Program Files\Java\jre1.8.0_60\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\Users\SS~1\AppData\Local\Temp\sq-process5996908890443263390properties
2015.09.28 09:49:28 INFO es[o.s.p.ProcessEntryPoint] Starting search
2015.09.28 09:49:28 INFO es[o.s.s.SearchServer] Starting Elasticsearch[sonarqube] on port 9001
2015.09.28 09:49:29 INFO es[o.elasticsearch.node] [sonar-1443422966104] version[1.4.4], pid[8044], build[c88f77f/2015-02-19T13:05:36Z]
2015.09.28 09:49:29 INFO es[o.elasticsearch.node] [sonar-1443422966104] initializing ...
2015.09.28 09:49:29 INFO es[o.e.plugins] [sonar-1443422966104] loaded [], sites []
2015.09.28 09:49:34 INFO es[o.elasticsearch.node] [sonar-1443422966104] initialized
2015.09.28 09:49:34 INFO es[o.elasticsearch.node] [sonar-1443422966104] starting ...
2015.09.28 09:49:36 INFO es[o.e.transport] [sonar-1443422966104] bound_address {inet[/0.0.0.0:9001]}, publish_address {inet[/192.168.1.103:9001]}
2015.09.28 09:49:36 INFO es[o.e.discovery] [sonar-1443422966104] sonarqube/JRwVvtz7Qb2Nfq2TD0uGeQ
2015.09.28 09:49:39 INFO es[o.e.cluster.service] [sonar-1443422966104] new_master [sonar-1443422966104][JRwVvtz7Qb2Nfq2TD0uGeQ][ss-pc][inet[/192.168.1.103:9001]]{rack_id=sonar-1443422966104}, reason: zen-disco-join (elected_as_master)
2015.09.28 09:49:39 INFO es[o.elasticsearch.node] [sonar-1443422966104] started
2015.09.28 09:49:40 INFO es[o.e.gateway] [sonar-1443422966104] recovered [1] indices into cluster_state
2015.09.28 09:49:40 INFO app[o.s.p.m.Monitor] Process[search] is up
2015.09.28 09:49:40 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: C:\Program Files\Java\jre1.8.0_60\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp -cp ./lib/common/*;./lib/server/*;C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\lib\jdbc\mysql\mysql-connector-java-5.1.34.jar org.sonar.server.app.WebServer C:\Users\SELAHA~1\AppData\Local\Temp\sq-process3295624311748506992properties
2015.09.28 09:49:42 INFO web[o.s.p.ProcessEntryPoint] Starting web
2015.09.28 09:49:42 INFO web[o.s.s.app.Webapp] Webapp directory: C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\web
2015.09.28 09:49:43 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.09.28 09:49:43 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2015.09.28 09:49:50 INFO web[o.e.plugins] [sonar-1443422966104] loaded [], sites []
2015.09.28 09:49:51 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:51 INFO web[o.s.c.p.Database] Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2015.09.28 09:49:54 INFO web[o.s.s.p.DefaultServerFileSystem] SonarQube home: C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Install plugins
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Core / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Email notifications / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Java / 3.0 / 65396a609ddface8b311a6a665aca92a7da694f1
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin Git / 1.0 / 9ce9d330c313c296fab051317cc5ad4b26319e07
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin English Pack / 5.1.2 / 2a52a7106b2bfbd659c591c2d6fc09ad0ab2db5c
2015.09.28 09:49:55 INFO web[o.s.s.p.ServerPluginJarsInstaller] Deploy plugin SVN / 1.0 / 213fc8a8b582ff530b12dd4a59a6512be1071234
2015.09.28 09:49:55 INFO web[o.s.s.p.RailsAppsDeployer] Deploy Ruby on Rails applications
2015.09.28 09:49:55 INFO web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_60-b27 [Windows 7-amd64]
2015.09.28 09:49:55 INFO web[jruby.rack] using a shared (threadsafe!) runtime
2015.09.28 09:50:14 INFO web[jruby.rack] An exception happened during JRuby-Rack startup
ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
--- System
jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_60-b27 [Windows 7-amd64]
Time: Mon Sep 28 09:50:14 +0300 2015
Server: Apache Tomcat/8.0.18
jruby.home: file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home
--- Context Init Parameters:
jruby.compat.version = 1.8
jruby.max.runtimes = 1
jruby.min.runtimes = 1
jruby.rack.logging = slf4j
process.index = 1
process.key = web
process.sharedDir = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp
process.terminationTimeout = 60000
public.root = /
rails.env = production
sonar.cluster.name = sonarqube
sonar.jdbc.driverPath = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\lib\jdbc\mysql\mysql-connector-java-5.1.34.jar
sonar.jdbc.maxActive = 50
sonar.jdbc.maxIdle = 5
sonar.jdbc.maxWait = 5000
sonar.jdbc.minEvictableIdleTimeMillis = 600000
sonar.jdbc.minIdle = 2
sonar.jdbc.password = sonar
sonar.jdbc.timeBetweenEvictionRunsMillis = 30000
sonar.jdbc.url = jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.jdbc.username = sonar
sonar.node.name = sonar-1443422966104
sonar.path.data = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\data
sonar.path.home = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2
sonar.path.logs = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\logs
sonar.path.temp = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\temp
sonar.path.web = C:\Users\ss\Desktop\SonarQube\sonarqube-5.1.2\web
sonar.search.javaAdditionalOpts =
sonar.search.javaOpts = -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError
sonar.search.port = 9001
sonar.search.type = TRANSPORT
sonar.web.javaAdditionalOpts =
sonar.web.javaOpts = -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true
--- Backtrace
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
log at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227
execute at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183
create_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109
create_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252
initialize_schema_migrations_table at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371
initialize at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441
up at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401
migrate at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383
upgrade_and_start at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62
automatic_setup at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73
(root) at C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272
load at org/jruby/RubyKernel.java:1094
(root) at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1
load_environment at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25
load_environment at file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79
--- RubyGems
Gem.dir: C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems
Gem.path:
C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems
Activated gems:
activesupport-2.3.15
activerecord-2.3.15
rack-1.1.6
actionpack-2.3.15
rails-2.3.15
color-tools-1.3.0
i18n-0.4.2
json-jruby-1.2.3-universal-java-1.6
activerecord-jdbc-adapter-1.1.3
fastercsv-1.4.0
--- Bundler
undefined method `bundle_path' for Bundler:Module
--- JRuby-Rack Config
compat_version = RUBY1_8
default_logger = org.jruby.rack.logging.StandardOutLogger#5a8f2e80
equals = <error: >
err = java.io.PrintStream#7e976a6c
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_memory_buffer_size =
initial_runtimes = 1
jms_connection_factory =
jms_jndi_properties =
logger = org.jruby.rack.logging.Slf4jLogger#55699f6e
logger_class_name = slf4j
logger_name = jruby.rack
maximum_memory_buffer_size =
maximum_runtimes = 1
num_initializer_threads =
out = java.io.PrintStream#4365d1bf
rackup =
rackup_path =
rewindable = true
runtime_arguments =
runtime_environment =
runtime_timeout_seconds =
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade#7a015703
throw_init_exception = false
2015.09.28 09:50:14 ERROR web[jruby.rack] initialization failed
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109:in `create_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252:in `create_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371:in `initialize_schema_migrations_table'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441:in `initialize'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73:in `automatic_setup'
from C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272:in `(root)'
from org/jruby/RubyKernel.java:1094:in `load'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1:in `(root)'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment'
from file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29) ~[jruby-rack-1.1.13.2.jar:na]
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98) ~[jruby-rack-1.1.13.2.jar:na]
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50) ~[jruby-rack-1.1.13.2.jar:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399) [tomcat-embed-core-8.0.18.jar:8.0.18]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_60]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_60]
Caused by: org.jruby.exceptions.RaiseException: (StatementInvalid) ActiveRecord::JDBCError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin' at line 1: CREATE TABLE `schema_migrations` (`version` varchar NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
at RUBY.log(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227) ~[na:na]
at RUBY.execute(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183) ~[na:na]
at RUBY.create_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:109) ~[na:na]
at RUBY.create_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/mysql/adapter.rb:252) ~[na:na]
at RUBY.initialize_schema_migrations_table(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb:371) ~[na:na]
at RUBY.initialize(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:441) ~[na:na]
at RUBY.up(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401) ~[na:na]
at RUBY.migrate(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383) ~[na:na]
at RUBY.upgrade_and_start(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:62) ~[na:na]
at RUBY.automatic_setup(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/../lib/database_version.rb:73) ~[na:na]
at RUBY.(root)(C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/web/WEB-INF/config/environment.rb:272) ~[na:na]
at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1094) ~[jruby-complete-1.7.9.jar:na]
at RUBY.(root)(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:1) ~[na:na]
at RUBY.load_environment(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25) ~[na:na]
at RUBY.load_environment(file:/C:/Users/ss/Desktop/SonarQube/sonarqube-5.1.2/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79) ~[na:na]
2015.09.28 09:50:15 INFO web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2015.09.28 09:50:15 INFO web[o.s.s.a.TomcatAccessLog] Web server is started
2015.09.28 09:50:15 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2015.09.28 09:50:15 INFO app[o.s.p.m.Monitor] Process[web] is up
What am i missing?[From the MySql Error seems that length of the varchar is missing]

The problem was on schema_migrationquery where VARCHAR had no length. I created that table manually with the following query:
CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin
and it solved that problem.
Note:
[After the problem is gone, it creates other required tables automatically when the server is launched, however this time you will face upgrading/migrating message. This means that when you will try to access the server(ex: localhost), it will redirect you to the maintenance page(localhost/maintenance). Change that to move to setup page(localhost/setup) and continue with upgrade]

Related

Error while trying to run connector class 'io.debezium.connector.mysql.MySqlConnector'

We have a Java 11 Spring boot app integrated with Kafka/Debezium.
On a Mysql (5.7) database database change is made (user dropped/ tables recreated with data) Debezium's binlogreader starts to read the bin logs, but then logs the following Exception
2021-07-22 10:05:08.584 INFO 24570 --- [debyte.com:3306] i.d.r.history.DatabaseHistoryMetrics : Already applied 10969 database changes
2021-07-22 10:05:10.134 ERROR 24570 --- [debyte.com:3306] i.debezium.connector.mysql.BinlogReader : Error while deserializing binlog event at offset {ts_sec=1626941231, file=mysql-bin.000532, pos=75496603, server_id=2001, event=876}.
Use the mysqlbinlog tool to view the problematic event: mysqlbinlog --start-position=82610388 --stop-position=82618497 --verbose mysql-bin.000532
2021-07-22 10:05:10.135 ERROR 24570 --- [debyte.com:3306] i.debezium.connector.mysql.BinlogReader : Error during binlog processing. Last offset stored = {ts_sec=1626941227, file=mysql-bin.000532, pos=71066122, row=272, server_id=2001, event=518}, binlog reader near position = mysql-bin.000532/82610388
2021-07-22 10:05:10.150 ERROR 24570 --- [debyte.com:3306] i.debezium.connector.mysql.BinlogReader : Failed due to error: Error processing binlog event
org.apache.kafka.connect.errors.ConnectException: com.github.shyiko.mysql.binlog.event.deserialization.EventDataDeserializationException: Failed to deserialize data of EventHeaderV4{timestamp=1626941231000, eventType=EXT_WRITE_ROWS, serverId=2001, headerLength=19, dataLength=8090, nextPosition=82618497, flags=0}
at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:536) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1158) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:1005) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.BinaryLogClient.connectWithTimeout(BinaryLogClient.java:517) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.BinaryLogClient.access$1100(BinaryLogClient.java:90) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:881) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: java.lang.RuntimeException: com.github.shyiko.mysql.binlog.event.deserialization.EventDataDeserializationException: Failed to deserialize data of EventHeaderV4{timestamp=1626941231000, eventType=EXT_WRITE_ROWS, serverId=2001, headerLength=19, dataLength=8090, nextPosition=82618497, flags=0}
at io.debezium.connector.mysql.BinlogReader.handleServerIncident(BinlogReader.java:604) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:519) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
... 6 common frames omitted
Caused by: com.github.shyiko.mysql.binlog.event.deserialization.EventDataDeserializationException: Failed to deserialize data of EventHeaderV4{timestamp=1626941231000, eventType=EXT_WRITE_ROWS, serverId=2001, headerLength=19, dataLength=8090, nextPosition=82618497, flags=0}
at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.deserializeEventData(EventDeserializer.java:300) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.nextEvent(EventDeserializer.java:223) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at io.debezium.connector.mysql.BinlogReader$1.nextEvent(BinlogReader.java:239) ~[debezium-connector-mysql-1.0.0.Final.jar:1.0.0.Final]
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:984) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
... 4 common frames omitted
Caused by: java.io.EOFException: null
at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.read(ByteArrayInputStream.java:190) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at java.base/java.io.InputStream.read(InputStream.java:271) ~[na:na]
at java.base/java.io.InputStream.skip(InputStream.java:531) ~[na:na]
at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.skipToTheEndOfTheBlock(ByteArrayInputStream.java:216) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
at com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer.deserializeEventData(EventDeserializer.java:296) ~[mysql-binlog-connector-java-0.21.0.jar:0.21.0]
... 7 common frames omitted
2021-07-22 10:05:10.150 INFO 24570 --- [debyte.com:3306] i.debezium.connector.mysql.BinlogReader : Error processing binlog event, and propagating to Kafka Connect so it stops this connector. Future binlog events read before connector is shutdown will be ignored.
2021-07-22 10:05:10.152 INFO 24570 --- [debyte.com:3306] i.debezium.connector.mysql.BinlogReader : Stopped reading binlog after 167936 events, last recorded offset: {ts_sec=1626941227, file=mysql-bin.000532, pos=71066122, row=272, server_id=2001, event=518}
2021-07-22 10:05:37.521 INFO 24570 --- [pool-1-thread-1] i.d.connector.mysql.MySqlConnectorTask : Stopping MySQL connector task
This also is logged on application startup.
The suggested mysqlbinlog command:
mysqlbinlog --start-position=82610388 --stop-position=82618497 --verbose mysql-bin.000532
Returns
/*!50530 SET ##SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET #OLD_COMPLETION_TYPE=##COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#210722 8:06:26 server id 2001 end_log_pos 123 CRC32 0xc7bff6dc Start: binlog v 4, server v 5.7.19-log created 210722 8:06:26
BINLOG '
Aif5YA/RBwAAdwAAAHsAAAAAAAQANS43LjE5LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
Adz2v8c=
'/*!*/;
# at 82610388
#210722 8:07:11 server id 2001 end_log_pos 82618497 CRC32 0xd2561ccc Write_rows: table id 43469
WARNING: The range of printed events ends with a row event or a table map event that does not have the STMT_END_F flag set. This might be because the last statement was not fully written to the log, or because you are using a --stop-position or --stop-datetime that refers to an event in the middle of a statement. The event(s) from the partial statement have not been written to output.
SET ##SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=#OLD_COMPLETION_TYPE*/;
/*!50530 SET ##SESSION.PSEUDO_SLAVE_MODE=0*/;
I have no idea why this is happening or how to code around it. The error is not thrown up to the app.
Has anyone else had a similar issue?
I found a solution on debezium's doc:
What is causing intermittent EventDataDeserializationExceptions with the MySQL connector?
When you run into intermittent deserialization exceptions around 1 minute after starting connector, with a root cause of type EOFException or java.net.SocketException: Connection reset:
Caused by: com.github.shyiko.mysql.binlog.event.deserialization.EventDataDeserializati>onException: Failed to deserialize data of EventHeaderV4{timestamp=1542193955000, eventType=GTID, serverId=91111, headerLength=19, dataLength=46, nextPosition=1058898202, flags=0}
Caused by: java.lang.RuntimeException: com.github.shyiko.mysql.binlog.event.deserialization.EventDataDeserializationException: Failed to deserialize data of EventHeaderV4{timestamp=1542193955000, eventType=GTID, serverId=91111, headerLength=19, dataLength=46, nextPosition=1058898202, flags=0}
Caused by: java.io.EOFException
or
Caused by: java.net.SocketException: Connection reset
Then updating these MySQL server global properties like this will fix it:
set global slave_net_timeout = 120; (default was 30sec)
set global thread_pool_idle_timeout = 120;

HikariCP trying to obtain connection to pool with different user id than provided

I have a Java app (running Java 11) using HikariCP v3.3.1, with MySQL Connector/J version 8.0.17. I have specified username = 'foo' and password = 'password' and Hikari opens up a connection to the DB with these credentials. This all works.
There is a problem that I see in my logs, however. I have debugging enabled for Hikari and I see stack traces like so:
2019-09-10 01:35:13.452 DEBUG 4941 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Cannot acquire connection from data source
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 10 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:897) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:822) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:447) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.17.jar!/:8.0.17]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.access$100(HikariPool.java:71) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:727) ~[HikariCP-3.3.1.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator.call(HikariPool.java:713) ~[HikariCP-3.3.1.jar!/:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'administrator'#'localhost' (using password: YES)
It looks like it is trying to open a connection in the pool with user = 'administrator'. This naturally fails - because there is no such user in the database.
My question is this: why did Hikari open up one connection successfully to the db with user = 'foo' and password = 'password' but then try to open another connection with a different user = 'administrator'? 'administrator' by the way is the name of user that is running the Java process.
Here is the datasource bean. No other data source bean defined, I think.
#Bean
#ConfigurationProperties
public DataSource myDataSource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(dburl);
config.setUsername(dbuser);
config.setPassword(password);
return new HikariDataSource(config);
}
The datasource - as I mentioned does get created with the correct username and password.
We get the values of the various attributes dburl and dbuser from #Value declarations that pull values from the properties files as follows:
#Value("${myorg.dburl}"
String dburl;
#Value("${myorg.dbusername"}"
String dbuser;
String password; //this comes from cloud secret store per org policy
The application properties has the following relevant lines
myorg.dbhost=localhost
myorg.dburl=jdbc:mysql://${myorg.dbhost}:3306/jobs?useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&useServerPrepStmts=false&rewriteBatchedStatements=true&useUnicode=true&characterEncoding=UTF-8
myorg.dbusername=axcode
Thanks in advance!
Updated with new user experiment. So it gets even more curious. I created a new user on my Linux server 'foouser' - and ran the identical spring boot fat jar app. And, it works correctly with no exceptions thrown. Here is what I see from the periodic Hikari logs:
2019-09-12 12:30:46.685 DEBUG 3280 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2019-09-12 12:31:16.685 DEBUG 3280 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
But when I run same app as 'administrator', then I see only 1 connection made to the db and an exception thrown when Hikari tries to open a second connection this time as user 'administrator'
2019-09-12 12:37:31.195 DEBUG 3514 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2019-09-12 12:37:46.091 DEBUG 3514 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Cannot acquire connection from data source

Use selenium under ubuntu machine with no display

I'm not able to find a way to run selenium under ubuntu machine with no display.
I have the following java code:
public static void main(String args[]){
String url = args[0];
WebDriver driver = new ChromeDriver();
String scriptToExecute = "var network = performance.getEntries() || {}; return network;";
driver.navigate().to(url);
String netData = ((JavascriptExecutor)driver).executeScript(scriptToExecute).toString();
System.out.println(netData);
}
This code works fine on my local machine but it does not work on my ubuntu server.
This is the exception raised on "driver.navigate().to(url);":
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.openqa.selenium.NoSuchSessionException: no such session
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.8.0-51-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 37 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'craw-temp', ip: '10.132.0.56', os.name: 'Linux', os.arch: 'amd64', os.version: '4.8.0-51-generic', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.8.0-51-generic x86_64), platform=ANY}]
Session ID: de392db337e4adbd5876d2b8c5ca105c
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:902)
at it.thirdplace.crawlertag_be.SeleniumChrome2.main(SeleniumChrome2.java:45)
... 5 more
I suppose the problem is related to the absence of the display on my ubuntu server.
This is the dependencies I installed on my ubuntu server:
libnss3
GConf-2.4
libfontconfig
google-chrome-stable
Is there a way to overcome this problem?

How to set a bucket password with spring-data couchbase

I have followed the tutorial for spring-data couchbase and have a succesfull example project with unit tests for persisting a number of custom entities with a range of views implemented to query the entities.
This works correctly in both a local dev environment and a ci environment when using the "default" bucket name and no password as the authentication.
Moving beyond the example, I want to make use of a different bucket and ultimately make use of a password.
When I create a new bucket (named "test_bucket"), and update the property injected into the CouchbaseConfig (extends AbstractCouchbaseConfiguration) to use this new bucket inplace of the "default" I get the following exception when running the unit tests.
I also tried adding a password to the creation script and adding the same password ("psswd" string in both cases) to the properties used in the CouchbaseConfig but get the same exception shown below.
So is it possible to use another bucket than "default" (and its no-authorisation required) and how do I configure a password for use on this bucket ?
I have verified that the bucket(s) and the expected views have been created correctly in couchbase from the Admin GUI.
2015-06-09 16:41:40 INFO ClasspathLoggingApplicationListener:55 - Application failed to start with classpath: [file:/C:/tools/cmd/cygwin64/home/akirby/workspaces/repos/blackjack/persistence/target/surefire/surefirebooter7615727324811258159.jar]
2015-06-09 16:41:40 INFO AutoConfigurationReportLoggingInitializer:107 -
Error starting ApplicationContext. To display the auto-configuration report enabled debug logging (start with --debug)
2015-06-09 16:41:40 ERROR SpringApplication:338 - Application startup failed
java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String([B)Ljava/lang/String;
at com.couchbase.client.http.HttpUtil.buildAuthHeader(HttpUtil.java:55)
at com.couchbase.client.ViewConnection.addOp(ViewConnection.java:205)
at com.couchbase.client.CouchbaseClient.addOp(CouchbaseClient.java:803)
at com.couchbase.client.CouchbaseClient.asyncGetView(CouchbaseClient.java:342)
at com.couchbase.client.CouchbaseClient.getView(CouchbaseClient.java:430)
at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:223)
at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:220)
at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:244)
at org.springframework.data.couchbase.core.CouchbaseTemplate.queryView(CouchbaseTemplate.java:220)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.deleteAll(SimpleCouchbaseRepository.java:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:416)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:401)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:373)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$DefaultMethodInvokingMethodInterceptor.invoke(RepositoryFactorySupport.java:486)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.couchbase.repository.support.ViewPostProcessor$ViewInterceptor.invoke(ViewPostProcessor.java:87)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy50.deleteAll(Unknown Source)
at com.pubtech.cms.persistence.RepositoryService.doWork(RepositoryService.java:47)
at com.pubtech.cms.persistence.ApplicationRepository.lambda$commandLineRunner$0(ApplicationRepository.java:83)
at com.pubtech.cms.persistence.ApplicationRepository$$Lambda$9/594916129.run(Unknown Source)
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:672)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:101)
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:170)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:110)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:259)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:261)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:219)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
2015-06-09 16:41:40 INFO GenericWebApplicationContext:862 - Closing org.springframework.web.context.support.GenericWebApplicationContext#6302bbb1: startup date [Tue Jun 09 16:41:33 BST 2015]; root of context hierarchy
2015-06-09 16:41:40 INFO CouchbaseConnection:87 - Shut down Couchbase client
2015-06-09 16:41:40 INFO ViewConnection:87 - I/O reactor terminated
when using a bucket name that requires a password (bucket "t1", password "pswd") I see this authentication error in the logs, is there some format. other than plain text that the passsord should be encoded with ?
2015-06-10 10:55:58 INFO DefaultListableBeanFactory:822 - Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2015-06-10 10:55:59 INFO Version:27 - HV000001: Hibernate Validator 5.1.3.Final
2015-06-10 10:56:00 ERROR SASLStepOperationImpl:93 - Error: Auth failure
2015-06-10 10:56:00 WARN BinaryMemcachedNodeImpl:90 - Discarding partially completed op: SASL steps operation
2015-06-10 10:56:00 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: cancelled}
2015-06-10 10:56:02 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: Invalid arguments}
2015-06-10 10:56:02 WARN AuthThread:90 - Authentication failed to localhost/127.0.0.1:11210, Status: {OperationStatus success=false: Invalid arguments}
I use the couchbase-cli to create the buckets from a script, using the same script to create the working "default" and not working "test_bucket", (properties are correctly injected using mvn filter) :
# Create Bucket
couchbase-cli bucket-create -c $COUCHBASE_HOST:$COUCHBASE_PORT -u $CB_REST_USERNAME -p $CB_REST_PASSWORD \
--bucket=$BUCKET_NAME \
--bucket-type=couchbase \
--bucket-ramsize=200 \
--bucket-replica=1 \
--wait
CouchbaseConfig class:
..
#Configuration
#EnableCouchbaseRepositories(basePackages = {"com.persistence.db"})
#EnableAutoConfiguration
public class CouchbaseConfig extends AbstractCouchbaseConfiguration {
#Value("${couchbase.bucket:boris}")
private String bucketName;
#Value("${couchbase.bucket.password:nopwd}")
private String password;
#Value("${couchbase.host:127.0.0.1}")
private String ip;
..
I think you got a similar issue to what i was experiencing, the issue for me was using #Value in an #Configuration class has a slight special requirement. I was using YAML for my properties file if that matters at all.
add this to your class (must be static as well)
/**
* this is required for some reason: https://jira.spring.io/browse/SPR-11773
*
* #return
*/
#Bean
public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();

Linux Mandriva: Tomcat can not get MySQL database connection, why?

I installed Tomcat 7 and MySQL database on Linux Mandriva, but the application is deployed in the container can not get a connection.
I wrote two simple tests, and when to run them from the client, I get the connection -
public class TestHibernate {
/**
* #param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
User user = new User();
user.setName("userName");
user.setPassword("userPassword");
Session session = HibernateUtil.
getSessionFactory().openSession();
session.beginTransaction();
session.save(user);
session.getTransaction().commit();
session.close();
}
}
Part of HibernateUtil -
...
cnf.setProperty("hibernate.connection.url", "jdbc:mysql://ip:3306/gibrid");
cnf.setProperty("hibernate.connection.username", "java");
cnf.setProperty("hibernate.connection.password", "java");
...
Jdbc test -
public class TestJdbc {
public static void main(String[] args) {
Connection conn = null;
String url = "jdbc:mysql://ip:3306/";
String dbName = "gibrid";
String driver = "com.mysql.jdbc.Driver";
String userName = "java";
String password = "java";
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connected to the database");
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
e.printStackTrace();
}
}
}
In these cases, I get a connection and can work with the database. But when I request from the client browser, I get a timeout. Why is that?
I would be very grateful for the information.
Here is the catalina.out -
...
INFO: Server startup in 5315 ms
17.10.2012 15:36:52 com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/themes/web13theme/favicon.ico] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
17.10.2012 15:36:58 com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/themes/projtheme/img/cancel.png] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
3 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA
25 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1
39 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - hibernate.properties not found
44 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
50 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
148 [http-bio-8081-exec-7] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA
176 [http-bio-8081-exec-7] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
247 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Incoming
313 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Incoming on table INCOMING
397 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Outcoming
397 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Outcoming on table OUTCOMING
400 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.User
400 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.User on table USER
402 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Cable
402 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Cable on table CABLE
497 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
509 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
510 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
510 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
514 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://---ip here----/gibrid
514 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=java, password=****}
189691 [http-bio-8081-exec-7] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection timed out
STACKTRACE:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.ssi.hbnutils.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.ssi.windows.RegWindow.check(RegWindow.java:167)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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 com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
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:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
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:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
** END NESTED EXCEPTION **
Last packet sent to the server was 6 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.ssi.hbnutils.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.ssi.windows.RegWindow.check(RegWindow.java:167)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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 com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
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:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
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:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
190005 [http-bio-8081-exec-7] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
190066 [http-bio-8081-exec-7] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
190090 [http-bio-8081-exec-7] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
190092 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
190092 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
190114 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: disabled
190115 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
190116 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
190125 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
190127 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
190127 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
190128 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
190128 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
190129 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
190167 [http-bio-8081-exec-7] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
190169 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
190169 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
190170 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
190171 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
190171 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
190173 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
190174 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
190239 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
190250 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
190250 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
190260 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
190260 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
190761 [http-bio-8081-exec-7] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
191112 [http-bio-8081-exec-7] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
380252 [http-bio-8081-exec-7] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
380252 [http-bio-8081-exec-7] ERROR org.hibernate.util.JDBCExceptionReporter - Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection timed out
STACKTRACE:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
at com.ssi.windows.RegWindow.check(RegWindow.java:168)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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 com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
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:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
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:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
** END NESTED EXCEPTION **
Last packet sent to the server was 5 ms ago.
I'm not familiar with Hibernate, so I don't know if this is relevant:
"hibernate.properties not found"
"using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://---ip here----/gibrid"
Is the IP and port the same as in your test programs?
This blog hints at configuration problems with C3PO. One comment hints at different timeout settings between Mysql and C3PO. HTH
Editing your mysql configuration file to bind on 0.0.0.0 or your ip instead of 127.0.0.1 might work.