Using log4jdbc gives a "user lacks privilege or object not found"

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Using log4jdbc gives a "user lacks privilege or object not found"

stephaneeybert
Hi,

I have a data source that works fine with these settings:

hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl.auto=create
dataSource.driverClassName=org.hsqldb.jdbcDriver
dataSource.url=jdbc:hsqldb:mem:db_integration
dataSource.username=sa
dataSource.password=

Now, if I want to output the sql statements with log4jdbc with the following settings:

hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl.auto=create
dataSource.driverClassName=net.sf.log4jdbc.DriverSpy
#org.hsqldb.jdbcDriver
dataSource.url=jdbc:log4jdbc:hsqldb:mem:db_integration
dataSource.username=sa
dataSource.password=

I get the exception:

Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: PUBLIC.ELEARNING_ASSIGNMENT

Note that my log4jdbc works fine when I run the build against MySql or Oracle.

Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

Fred Toussi-2
It seems the log4jdbc.DriverSpy class is misbehaving.

Does your program create a table called PUBLIC.ELEARNING_ASSIGNMENT?  If
so, then the table is not getting created.

Fred

On Sun, Dec 9, 2012, at 19:32, Stephane Eybert wrote:

>
> Hi,
>
> I have a data source that works fine with these settings:
>
> hibernate.dialect=org.hibernate.dialect.HSQLDialect
> hibernate.hbm2ddl.auto=create
> dataSource.driverClassName=org.hsqldb.jdbcDriver
> dataSource.url=jdbc:hsqldb:mem:db_integration
> dataSource.username=sa
> dataSource.password=
>
> Now, if I want to output the sql statements with log4jdbc with the
> following
> settings:
>
> hibernate.dialect=org.hibernate.dialect.HSQLDialect
> hibernate.hbm2ddl.auto=create
> dataSource.driverClassName=net.sf.log4jdbc.DriverSpy
> #org.hsqldb.jdbcDriver
> dataSource.url=jdbc:log4jdbc:hsqldb:mem:db_integration
> dataSource.username=sa
> dataSource.password=
>
> I get the exception:
>
> Caused by: org.hsqldb.HsqlException: user lacks privilege or object not
> found: PUBLIC.ELEARNING_ASSIGNMENT
>
> Note that my log4jdbc works fine when I run the build against MySql or
> Oracle.
>
>
> --
> View this message in context:
> http://old.nabble.com/Using-log4jdbc-gives-a-%22user-lacks-privilege-or-object-not-found%22-tp34777124p34777124.html
> Sent from the HSQLDB - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Hsqldb-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

stephaneeybert
Hi,

Yes, there are 117 tables in the schema and they get created fine when I run the Maven build without log4jdbc against the in memory HSQLDB database instance.

But when log4jdbc in being used I get the above error message for each and every table of the schema.

Kind Regards,
Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

stephaneeybert
Hi Fred,

Sorry for not exactly having answered your question on my first reading a while ago.

Here is a more detailed message I get in the log:

2. alter table admin_module drop constraint FKEB79195CD69CB436
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PUBLIC.ADMIN_MODULE

And one more:

2. alter table admin_option drop constraint FKEEF7FB65D69CB436
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PUBLIC.ADMIN_OPTION

I get a handful of these listed in the log but this does not prevent the build to succeed.

Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

stephaneeybert
In reply to this post by Fred Toussi-2
Hello,

Here is more on the error message if that gives some hint...

2013-02-07 13:55:53,506 DEBUG  [DriverManagerDataSource] Creating new JDBC DriverManager Connection to [jdbc:log4jdbc:hsqldb:mem:db_integration]
2013-02-07 13:55:53,513 DEBUG  [sqlonly]  org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
2. alter table admin_module drop constraint FKEB79195CD69CB436
2013-02-07 13:55:53,538 ERROR  [sqlonly]  org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
2. alter table admin_module drop constraint FKEB79195CD69CB436
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PUBLIC.ADMIN_MODULE
  at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
  at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
  at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
  at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source)
  at net.sf.log4jdbc.StatementSpy.executeUpdate(StatementSpy.java:694)
  at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
  at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:396)
  at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:269)
  at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219)
  at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:372)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
  at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
  at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)

Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: PUBLIC.ADMIN_MODULE
  at org.hsqldb.error.Error.error(Unknown Source)
  at org.hsqldb.error.Error.error(Unknown Source)
  at org.hsqldb.SchemaManager.getUserTable(Unknown Source)
  at org.hsqldb.ParserDDL.compileAlterTable(Unknown Source)
  at org.hsqldb.ParserDDL.compileAlter(Unknown Source)
  at org.hsqldb.ParserCommand.compilePart(Unknown Source)
  at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
  at org.hsqldb.Session.executeDirectStatement(Unknown Source)
  at org.hsqldb.Session.execute(Unknown Source)

Kind Regards,

Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

Fred Toussi-2
These statements are issued by Hibernate. They may be unnecessary. The
JDBC logger is showing the exceptions but Hibernate must be catching and
ignoring them.

Fred

On Thu, Feb 7, 2013, at 13:41, stephaneeybert wrote:

> Hello,
>
> Here is more on the error message if that gives some hint...
>
> 2013-02-07 13:55:53,506 DEBUG  [DriverManagerDataSource] Creating new
> JDBC
> DriverManager Connection to [jdbc:log4jdbc:hsqldb:mem:db_integration]
> 2013-02-07 13:55:53,513 DEBUG  [sqlonly]
> org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
> 2. alter table admin_module drop constraint FKEB79195CD69CB436
> 2013-02-07 13:55:53,538 ERROR  [sqlonly]
> org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
> 2. alter table admin_module drop constraint FKEB79195CD69CB436
> java.sql.SQLSyntaxErrorException: user lacks privilege or object not
> found:
> PUBLIC.ADMIN_MODULE
>   at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
>   at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
>   at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
>   at org.hsqldb.jdbc.JDBCStatement.executeUpdate(Unknown Source)
>   at net.sf.log4jdbc.StatementSpy.executeUpdate(StatementSpy.java:694)
>   at
>   org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:421)
>   at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:396)
>   at
>   org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:269)
>   at
>   org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219)
>   at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:372)
>   at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
>   at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
>   at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
>
> Caused by: org.hsqldb.HsqlException: user lacks privilege or object not
> found: PUBLIC.ADMIN_MODULE
>   at org.hsqldb.error.Error.error(Unknown Source)
>   at org.hsqldb.error.Error.error(Unknown Source)
>   at org.hsqldb.SchemaManager.getUserTable(Unknown Source)
>   at org.hsqldb.ParserDDL.compileAlterTable(Unknown Source)
>   at org.hsqldb.ParserDDL.compileAlter(Unknown Source)
>   at org.hsqldb.ParserCommand.compilePart(Unknown Source)
>   at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
>   at org.hsqldb.Session.executeDirectStatement(Unknown Source)
>   at org.hsqldb.Session.execute(Unknown Source)
>
> Kind Regards,
>
>
>
>
>
> --
> View this message in context:
> http://hsqldb.10974.n7.nabble.com/Using-log4jdbc-gives-a-user-lacks-privilege-or-object-not-found-tp1775p3829.html
> Sent from the HSQLDB - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Hsqldb-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: Using log4jdbc gives a "user lacks privilege or object not found"

stephaneeybert
Okay, thanks for the enlightenment Fred