org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl#localhost.localdomain/computer/(master)//test/7]; uncategorized SQLException for SQL [select builddetai0_.id as id78_1_, builddetai0_.duration as duration78_1_, builddetai0_.endDate as endDate78_1_, builddetai0_.fullName as fullName78_1_, builddetai0_.name as name78_1_, builddetai0_.node_url as node10_78_1_, builddetai0_.result as result78_1_, builddetai0_.startDate as startDate78_1_, builddetai0_.userId as userId78_1_, builddetai0_.userName as userName78_1_, buildnodei1_.url as url80_0_, buildnodei1_.description as descript2_80_0_, buildnodei1_.displayName as displayN3_80_0_, buildnodei1_.label as label80_0_, buildnodei1_.masterAddress as masterAd5_80_0_, buildnodei1_.masterHostName as masterHo6_80_0_, buildnodei1_.name as name80_0_ from JENKINS_BUILD_DETAILS builddetai0_ left outer join JENKINS_BUILD_NODE buildnodei1_ on builddetai0_.node_url=buildnodei1_.url where builddetai0_.id=?]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.SQLException: No database selected

Jenkins JIRA | Kevin Cheng | 1 year ago
  1. 0

    Tried to use the plugin with MYSQL. Created the db on localhost mysql named "audit2DB" in global configuration: I have the following for the audit2db configuration: JDBC Driver class: com.mysql.jdbc.Driver JDBC Url: jdbc:mysql://127.0.0.1:3306/audit2db User: root Password: <NULL> I can Test the connection successful. I used the script window to generate the DDL file and run it against my db "audit2db" Now, after saving the config and add "audit to db" post build step, and run the build, I got the following error: Not sure why it says DB is not selected. ====================================================== ERROR: Build step failed with exception org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl#localhost.localdomain/computer/(master)//test/7]; uncategorized SQLException for SQL [select builddetai0_.id as id78_1_, builddetai0_.duration as duration78_1_, builddetai0_.endDate as endDate78_1_, builddetai0_.fullName as fullName78_1_, builddetai0_.name as name78_1_, builddetai0_.node_url as node10_78_1_, builddetai0_.result as result78_1_, builddetai0_.startDate as startDate78_1_, builddetai0_.userId as userId78_1_, builddetai0_.userName as userName78_1_, buildnodei1_.url as url80_0_, buildnodei1_.description as descript2_80_0_, buildnodei1_.displayName as displayN3_80_0_, buildnodei1_.label as label80_0_, buildnodei1_.masterAddress as masterAd5_80_0_, buildnodei1_.masterHostName as masterHo6_80_0_, buildnodei1_.name as name80_0_ from JENKINS_BUILD_DETAILS builddetai0_ left outer join JENKINS_BUILD_NODE buildnodei1_ on builddetai0_.node_url=buildnodei1_.url where builddetai0_.id=?]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.SQLException: No database selected at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506) at org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsById(BuildDetailsHibernateRepository.java:121) at org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsForBuild(BuildDetailsHibernateRepository.java:307) at org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl.perform(DbAuditPublisherImpl.java:108) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.cleanUp(Build.java:195) at hudson.model.Run.execute(Run.java:1788) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: java.sql.SQLException: No database selected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2002) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1869) at org.hibernate.loader.Loader.doQuery(Loader.java:718) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270) at org.hibernate.loader.Loader.loadEntity(Loader.java:1953) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990) at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) ... 14 more Build step 'Audit job info to Database' marked build as failure Finished: FAILURE

    Jenkins JIRA | 1 year ago | Kevin Cheng
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl#localhost.localdomain/computer/(master)//test/7]; uncategorized SQLException for SQL [select builddetai0_.id as id78_1_, builddetai0_.duration as duration78_1_, builddetai0_.endDate as endDate78_1_, builddetai0_.fullName as fullName78_1_, builddetai0_.name as name78_1_, builddetai0_.node_url as node10_78_1_, builddetai0_.result as result78_1_, builddetai0_.startDate as startDate78_1_, builddetai0_.userId as userId78_1_, builddetai0_.userName as userName78_1_, buildnodei1_.url as url80_0_, buildnodei1_.description as descript2_80_0_, buildnodei1_.displayName as displayN3_80_0_, buildnodei1_.label as label80_0_, buildnodei1_.masterAddress as masterAd5_80_0_, buildnodei1_.masterHostName as masterHo6_80_0_, buildnodei1_.name as name80_0_ from JENKINS_BUILD_DETAILS builddetai0_ left outer join JENKINS_BUILD_NODE buildnodei1_ on builddetai0_.node_url=buildnodei1_.url where builddetai0_.id=?]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.SQLException: No database selected
  2. 0

    Tried to use the plugin with MYSQL. Created the db on localhost mysql named "audit2DB" in global configuration: I have the following for the audit2db configuration: JDBC Driver class: com.mysql.jdbc.Driver JDBC Url: jdbc:mysql://127.0.0.1:3306/audit2db User: root Password: <NULL> I can Test the connection successful. I used the script window to generate the DDL file and run it against my db "audit2db" Now, after saving the config and add "audit to db" post build step, and run the build, I got the following error: Not sure why it says DB is not selected. ====================================================== ERROR: Build step failed with exception org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl#localhost.localdomain/computer/(master)//test/7]; uncategorized SQLException for SQL [select builddetai0_.id as id78_1_, builddetai0_.duration as duration78_1_, builddetai0_.endDate as endDate78_1_, builddetai0_.fullName as fullName78_1_, builddetai0_.name as name78_1_, builddetai0_.node_url as node10_78_1_, builddetai0_.result as result78_1_, builddetai0_.startDate as startDate78_1_, builddetai0_.userId as userId78_1_, builddetai0_.userName as userName78_1_, buildnodei1_.url as url80_0_, buildnodei1_.description as descript2_80_0_, buildnodei1_.displayName as displayN3_80_0_, buildnodei1_.label as label80_0_, buildnodei1_.masterAddress as masterAd5_80_0_, buildnodei1_.masterHostName as masterHo6_80_0_, buildnodei1_.name as name80_0_ from JENKINS_BUILD_DETAILS builddetai0_ left outer join JENKINS_BUILD_NODE buildnodei1_ on builddetai0_.node_url=buildnodei1_.url where builddetai0_.id=?]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.SQLException: No database selected at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506) at org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsById(BuildDetailsHibernateRepository.java:121) at org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsForBuild(BuildDetailsHibernateRepository.java:307) at org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl.perform(DbAuditPublisherImpl.java:108) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.cleanUp(Build.java:195) at hudson.model.Run.execute(Run.java:1788) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: java.sql.SQLException: No database selected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2002) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1869) at org.hibernate.loader.Loader.doQuery(Loader.java:718) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270) at org.hibernate.loader.Loader.loadEntity(Loader.java:1953) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990) at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) ... 14 more Build step 'Audit job info to Database' marked build as failure Finished: FAILURE

    Jenkins JIRA | 1 year ago | Kevin Cheng
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [org.jenkins.plugins.audit2db.internal.model.BuildDetailsImpl#localhost.localdomain/computer/(master)//test/7]; uncategorized SQLException for SQL [select builddetai0_.id as id78_1_, builddetai0_.duration as duration78_1_, builddetai0_.endDate as endDate78_1_, builddetai0_.fullName as fullName78_1_, builddetai0_.name as name78_1_, builddetai0_.node_url as node10_78_1_, builddetai0_.result as result78_1_, builddetai0_.startDate as startDate78_1_, builddetai0_.userId as userId78_1_, builddetai0_.userName as userName78_1_, buildnodei1_.url as url80_0_, buildnodei1_.description as descript2_80_0_, buildnodei1_.displayName as displayN3_80_0_, buildnodei1_.label as label80_0_, buildnodei1_.masterAddress as masterAd5_80_0_, buildnodei1_.masterHostName as masterHo6_80_0_, buildnodei1_.name as name80_0_ from JENKINS_BUILD_DETAILS builddetai0_ left outer join JENKINS_BUILD_NODE buildnodei1_ on builddetai0_.node_url=buildnodei1_.url where builddetai0_.id=?]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.SQLException: No database selected
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    CronTrigger with JobStoreTX - No database selected error

    terracotta.org | 1 year ago
    org.quartz.JobPersistenceException: Couldn't determine job existence (DEFAULT.job1): No database selected [See nested exception: java.sql.SQLException: No database selected]
  5. 0

    CronTrigger with JobStoreTX - No database selected error

    Terracotta | 5 years ago | tparamas
    org.quartz.JobPersistenceException: Couldn't determine job existence (DEFAULT.job1): No database selected [See nested exception: java.sql.SQLException: No database selected]

  1. Kialandei 1 times, last 2 weeks ago
  2. poroszd 1 times, last 1 year ago
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    No database selected

    at com.mysql.jdbc.SQLError.createSQLException()
  2. MySQL jdbc
    PreparedStatement.executeQuery
    1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)
    2. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
    3. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
    4. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
    5. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
    6. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
    7. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
    8. com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2002)
    8 frames
  3. c3p0:JDBC DataSources/Resource Pools
    NewProxyPreparedStatement.executeQuery
    1. com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
    1 frame
  4. Hibernate
    AbstractEntityPersister.load
    1. org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    2. org.hibernate.loader.Loader.getResultSet(Loader.java:1869)
    3. org.hibernate.loader.Loader.doQuery(Loader.java:718)
    4. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
    5. org.hibernate.loader.Loader.loadEntity(Loader.java:1953)
    6. org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
    7. org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
    8. org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
    8 frames
  5. Hibernate
    SessionImpl.get
    1. org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
    2. org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
    3. org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
    4. org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
    5. org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
    6. org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
    7. org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
    8. org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
    8 frames
  6. Hibernate
    HibernateTemplate.get
    1. org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519)
    2. org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
    3. org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    4. org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512)
    5. org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506)
    5 frames
  7. org.jenkins.plugins
    DbAuditPublisherImpl.perform
    1. org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsById(BuildDetailsHibernateRepository.java:121)
    2. org.jenkins.plugins.audit2db.internal.data.BuildDetailsHibernateRepository.getBuildDetailsForBuild(BuildDetailsHibernateRepository.java:307)
    3. org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl.perform(DbAuditPublisherImpl.java:108)
    3 frames
  8. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    4. hudson.model.Build$BuildExecution.cleanUp(Build.java:195)
    5. hudson.model.Run.execute(Run.java:1788)
    6. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    7. hudson.model.ResourceController.execute(ResourceController.java:98)
    8. hudson.model.Executor.run(Executor.java:381)
    8 frames