-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: username is lost from mysql connection using a context.xml
PostPosted: Sat Apr 18, 2015 8:55 pm 
Newbie

Joined: Sat Apr 18, 2015 8:11 pm
Posts: 1
I'm running in tomcat 6 with java 6 using a jndi in the context.xml file.
the following context.xml file works with hibernate 4.1.4, but fails with version 4.2.17. the error shows no username although there is certainly one in the context.xml file.
i created the environment with 4.1.4. tested it. copied the environment, and changed nothing but the hibernate jar files.
can someone tell me what i've done wrong?
the context.xml file is:
<Context>
Code:
   <!-- mysql begin -->
      <Resource name="jdbc/jndiuser" auth="Container"
      description="Mysql DB Connection"
      driverClass="com.mysql.jdbc.Driver"
      jdbcUrl="jdbc:mysql://localhost:3306/thedbname?zeroDateTimeBehavior=convertToNull"
      user="root"
      password="password" debugUnreturnedConnectionStackTraces="true"
      unreturnedConnectionTimeout="15000" idleConnectionTestPeriod="120"
      testConnectionOnCheckout="true"
      acquireRetryAttempts="30" acquireRetryDelay="1000"
      breakAfterAcquireFailure="false"
      preferredTestQuery="SELECT 1" maxIdleTime="1800"
      maxPoolSize="4" minPoolSize="2" acquireIncrement="1"
      factory="org.apache.naming.factory.BeanFactory"
      type="com.mchange.v2.c3p0.ComboPooledDataSource" />
     <!-- end -->

the error received is:
6104944 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - HHH000319: Could not get database metadata
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'thedbname'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:951)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1717)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1276)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2395)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2428)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2213)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:797)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.