Getting SQL Profiler errors while using Hibernate and MySQL

1,480 views
Skip to first unread message

vikramaditya rathore

unread,
Apr 7, 2014, 5:24:32 AM4/7/14
to dropwiz...@googlegroups.com
Hi,

I have been getting these exceptions as soon as I run my dropwizard project and every few minutes after that. Although it doesn't affect any of the services I wrote but it makes debugging very difficult. I have used Hibernate with MySQL database and I think the errors are related to MySQL's Profiler events. Any clue how I can get rid of this exception.

INFO  [2014-04-04 04:59:53,265] org.hibernate.annotations.common.Version: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
INFO  [2014-04-04 04:59:53,278] org.hibernate.Version: HHH000412: Hibernate Core {4.0.0.Final}
INFO  [2014-04-04 04:59:53,279] org.hibernate.cfg.Environment: HHH000206: hibernate.properties not found
INFO  [2014-04-04 04:59:53,281] org.hibernate.cfg.Environment: HHH000021: Bytecode provider name : javassist
INFO  [2014-04-04 04:59:53,301] com.yammer.dropwizard.hibernate.SessionFactoryFactory: Entity classes: [com.example.atmservices.core.ATM, com.example.atmservices.core.Bank, com.example.atmservices.core.Prediction]
Thu Apr 03 23:59:53 CDT 2014 INFO: Profiler Event: [QUERY]

** BEGIN NESTED EXCEPTION **

java.lang.Throwable

STACKTRACE:

java.lang.Throwable
        at com.mysql.jdbc.log.LogUtils.expandProfilerEventIfNecessary(LogUtils.java:49)
        at com.mysql.jdbc.log.StandardLogger.logInternal(StandardLogger.java:295)
        at com.mysql.jdbc.log.StandardLogger.logInfo(StandardLogger.java:198)
        at com.mysql.jdbc.profiler.LoggingProfilerEventHandler.consumeEvent(LoggingProfilerEventHandler.java:47)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2925)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768)
        at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1651)
        at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:4198)
        at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3592)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2541)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
        at com.mysql.jdbc.JDBC4Connection.<init>(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:416)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:187)
        at org.apache.tomcat.dbcp.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:78)
        at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
        at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1185)
        at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
        at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:227)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:113)
        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
        at com.yammer.dropwizard.hibernate.SessionFactoryFactory.buildSessionFactory(SessionFactoryFactory.java:77)
        at com.yammer.dropwizard.hibernate.SessionFactoryFactory.build(SessionFactoryFactory.java:35)
        at com.yammer.dropwizard.hibernate.HibernateBundle.run(HibernateBundle.java:38)
        at com.yammer.dropwizard.hibernate.HibernateBundle.run(HibernateBundle.java:13)
        at com.yammer.dropwizard.config.Bootstrap.runWithBundles(Bootstrap.java:64)
        at com.yammer.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:37)
        at com.yammer.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:58)
        at com.yammer.dropwizard.cli.Cli.run(Cli.java:53)
        at com.yammer.dropwizard.Service.run(Service.java:61)
        at com.fisglobal.atmservices.AppService.main(AppService.java:38)


** END NESTED EXCEPTION **

 duration: 1 ms, connection-id: 7481, statement-id: 1, resultset-id: 1, message: /* mysql-connector-java-5.1.28 ( Revision: alexander...@oracle.com-20131125092425-yvejy3xvci77ru3k ) */SHOW VARIABLES WHERE Variable_name ='language' OR Variable_name = 'net_write_timeout' OR Variable_name = 'interactive_timeout' OR Variable_name = 'wait_timeout' OR Variable_name = 'character_set_client' OR Variable_name = 'character_set_connection' OR Variable_name = 'character_set' OR Variable_name = 'character_set_server' OR Variable_name = 'tx_isolation' OR Variable_name = 'transaction_isolation' OR Variable_name = 'character_set_results' OR Variable_name = 'timezone' OR Variable_name = 'time_zone' OR Variable_name = 'system_time_zone' OR Variable_name = 'lower_case_table_names' OR Variable_name = 'max_allowed_packet' OR Variable_name = 'net_buffer_length' OR Variable_name = 'sql_mode' OR Variable_name = 'query_cache_type' OR Variable_name = 'query_cache_size' OR Variable_name = 'init_connect'
Thu Apr 03 23:59:53 CDT 2014 INFO: Profiler Event: [FETCH]


Here's my yaml file:

# Database settings.
database:

  # the name of your JDBC driver
  driverClass: com.mysql.jdbc.Driver

  # the username
  user: user

  # the password
  password: password

  # the JDBC URL
  url: jdbc:mysql://localhost:3306/Cashforecasting?profileSQL=true 
  
  properties:
    charSet: UTF-8
    hibernate.dialect: org.hibernate.dialect.MySQL5InnoDBDialect
    # validate | update | create | create-drop
    
   # whether or not idle connections should be validated
  checkConnectionWhileIdle: false

http:
  rootPath: /service/*  # Default is /*
  port: 8181
  adminPort: 8090
  
  
  
Regards,
Vikram


Matt Veitas

unread,
Apr 7, 2014, 6:01:06 AM4/7/14
to dropwizard-user
Doing a quick Google search, it looks like this is a MySQL driver issue: http://bugs.mysql.com/bug.php?id=70677.


--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vikramaditya rathore

unread,
Apr 7, 2014, 10:15:43 AM4/7/14
to dropwiz...@googlegroups.com, mve...@gmail.com
Thanks Matt. Yes, MySQL query profiling seems to be the culprit. I have disabled the profileSQL property for now. Hopefully they release a patch for this.
Reply all
Reply to author
Forward
0 new messages