Enumerator
Mitglied Kamel
Abend!
Wie der Titel des Threads erahnen lässt, bekomme ich es einfach nicht hin, mit Java auf eine MySQL Datenbank zuzugreifen.
Ok, bis hierhin langweilig, quasi ein alter Hut. Doch damit würde ich Euch ja nie belästigen: es liegt nicht am Passwort.
Nein, auch nicht an IP, Port oder was-weis-ich. Glaubt's mir einfach.
Die Sache ist ein wenig verzwickt, von daher komme ich erst einmal zum Setup:
- Server 1: Java (1.)5 / Tomcat 5.5
- Server 2: Java (1.)6 / Tomcat 6
- Server 3: MySQL 5.0.67
- Server 4: MySQL 5.0.51
- OS: FreeBSD 6.1
1 und 2 haben identische Konfiguration, ebenso 3 und 4 (soweit das bei unterschiedlichen Software-Versionen und Hardware-Instanzen möglich ist, klar).
Verbindungen nach MySQL auf Server 4 sind problemlos möglich, bei Server 3 erhalte ich nur Fehlermeldungen (siehe unten).
Merkwürdig ist, das nur Java sich nicht verbinden kann. Via Kommandozeile, Perl, C, PHP - alles kein Problem.
Nach stundenlangem Googlen und Probieren komme ich zu dem Schluss: entweder ich bin saudoof, oder das ist ein Bug in einer der Bibliotheken.
Jetzt suche ich dringend jemanden, der eine beiden Optionen einwandfrei bestätigen und begründen kann...
Irgendwelche Ideen?
Greetz
Enum
PS: Fehlermeldung, Backtrace und evtl.relevante SQL-Tabellen (aus Sicherheitsgründen überarbeitet):
Wie der Titel des Threads erahnen lässt, bekomme ich es einfach nicht hin, mit Java auf eine MySQL Datenbank zuzugreifen.
Ok, bis hierhin langweilig, quasi ein alter Hut. Doch damit würde ich Euch ja nie belästigen: es liegt nicht am Passwort.
Nein, auch nicht an IP, Port oder was-weis-ich. Glaubt's mir einfach.
Die Sache ist ein wenig verzwickt, von daher komme ich erst einmal zum Setup:
- Server 1: Java (1.)5 / Tomcat 5.5
- Server 2: Java (1.)6 / Tomcat 6
- Server 3: MySQL 5.0.67
- Server 4: MySQL 5.0.51
- OS: FreeBSD 6.1
1 und 2 haben identische Konfiguration, ebenso 3 und 4 (soweit das bei unterschiedlichen Software-Versionen und Hardware-Instanzen möglich ist, klar).
Verbindungen nach MySQL auf Server 4 sind problemlos möglich, bei Server 3 erhalte ich nur Fehlermeldungen (siehe unten).
Merkwürdig ist, das nur Java sich nicht verbinden kann. Via Kommandozeile, Perl, C, PHP - alles kein Problem.
Nach stundenlangem Googlen und Probieren komme ich zu dem Schluss: entweder ich bin saudoof, oder das ist ein Bug in einer der Bibliotheken.
Jetzt suche ich dringend jemanden, der eine beiden Optionen einwandfrei bestätigen und begründen kann...
Irgendwelche Ideen?
Greetz
Enum
PS: Fehlermeldung, Backtrace und evtl.relevante SQL-Tabellen (aus Sicherheitsgründen überarbeitet):
Code:
org.hibernate.exception.GenericJDBCException: could not initialize a collection: [com.xXxXx.db.data.Item.itemData#52794]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2001)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:139)
at com.xXxXx.db.PersistenceManager.searchHotelData(PersistenceManager.java:279)
at com.xXxXx.ws.searchTask.PartnerSearchTask.searchHotels(PartnerSearchTask.java:69)
at com.xXxXx.ws.searchTask.RegionSearchTask.processData(RegionSearchTask.java:89)
at com.xXxXx.ws.searchTask.SearchTask.run(SearchTask.java:36)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Access denied for user 'userVier'@'%' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1912)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
Code:
+-----------------+------------+-----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections |
+-----------------+------------+-----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| localhost | root | # | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 |
| db1.xXxXxXx.com | root | # | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 |
| 127.0.0.1 | root | # | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 |
| % | root | # | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 |
| % | userEins | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| % | userVier | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| 10.2.1.2 | repl | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| % | userZwei | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| % | userDrei | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| 10.2.1.3 | repl | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| 10.2.1.1 | repl | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | Y | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
| 10.2.1.30 | nagios | # | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 |
+-----------------+------------+-----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
Code:
+------+---------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv |
+------+---------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
| % | xXxXxXx | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | xXxXxXx | userVier | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | test | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | xXxXxXx\_archiv | userVier | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | xXxXxXx\_archiv | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | information\_schema | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | innodb | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | innodblogs | userEins | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | mysql | user | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| % | xXxXxXx\_archiv | userZwei | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
| % | xXxXxXx | userZwei | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
| % | xXxXxXx | userDrei | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
| % | xXxXxXx\_archiv | userDrei | Y | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N |
+------+---------------------+------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
Zuletzt bearbeitet: