java.sql.SQLException: Error in allocating a connection. Cau

Status
Nicht offen für weitere Antworten.

nimo22

Aktives Mitglied
Habe nun folgenden Fehler,

verwende JPA mit DB2. Die Bibs von DB2 sind unter "Libraries" des aktuellen Projekts. Leider fehlt dem JAVA-Projekt die DLL(?!) "db2jcct2", welches sich im Programmordner "DB2" befindet. Was muss ich tun?

Code:
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failure in loading T2 native library db2jcct2

dank vorab
 

nimo22

Aktives Mitglied
Habe nun unter

forums.java.net/jive/thread.jspa?threadID=27389

und

https://glassfish.dev.java.net/javaee5/docs/AG/ablih.html#beanc


herausgefunden, dass ich die theoretisch die "db2jcct2.dll" nicht benötige, wenn ich Driver-Class "4" einstelle, das hab ich getan in "sun-resources.xml" :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
  <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.sun.sql.jdbcx.db2.DB2DataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="connectionPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
    <property name="URL" value="jdbc:db2://localhost:..."/>
    <property name="User" value="..."/>
    <property name="Password" value="..."/>
    <property name="driverType" value="4"/>
  </jdbc-connection-pool>
</resources>

funzt immer noch net,

Fehlermeldung

Code:
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failure in loading T2 native library db2jcct2

Muss ich die "sun-resources.xml" irgendwo noch registrieren??? (vielleicht in "web.xml").

[/code]
 
M

maki

Gast
Komisch, Type 4 JDBC Treiber sind eigentlich 100% Java, hne irgendwelche DLLS oder SOs.

Gibt es noch einen richtigen Type 4 Treiber für DB2?
 

nimo22

Aktives Mitglied
Das is es ja. Driver 4 hab ich angegeben, um auf die DLL "db2jcct2.dll" zu verzichten, leider verlangt der Server mit ""Glassfish" immer noch die DLL, aber die Fehlermeldung

Code:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failure in loading T2 native library db2jcct2
Error Code: 0

erscheint immer noch.

[/code]
 

benders

Aktives Mitglied
Hi!

Hast Du den Treiber (*.jar) in das lib-Verzeichnis vom Glassfish kopiert?
Danach muss Glasssfish neu gestartet werden.

Bernd
 
Status
Nicht offen für weitere Antworten.

Ähnliche Java Themen

Neue Themen


Oben