Connection Problem - WAS 6.1, Hibernate, OS Authentication

Status
Nicht offen für weitere Antworten.

gegel

Mitglied
Hi all,

Meine App läuft auf WAS6.1. Ich setze Hibernate, Spring und EHCache ein. Die Connection läuft über eine DataSource welche auf meine Oracle DB zeigt. Ich verwende den OCI8 Treiber. Nun möchte ich meinen User auf der DB identified externally machen, also OS authentication aktivieren. Ich gebe nun also bei meiner datasource weder benutzername noch passwort an. Die eingerichtete DataSource funktioniert aus der Websphere Admin Console (Test Connection). Aus dem Programm heraus, also über hibernate, krieg ich keine Connection. Folgende Exception wird geraist. Kann mir jemand weiterhelfen? Unterstützt hibernate überhaupt OS Authentication? Meiner Meinung nach sollte das hibernate eigentlich nicht interessieren wenn die connection von einer DataSource kommt...

herzlichen Dank für eure Hinweise.

Gruss, gegel

Code:
[7/21/08 10:40:49:976 MEST] 00000025 FreePool      E   J2CA0046E: Method createManagedConnectionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/apkMetaDS, throwing ResourceAllocationException.  Original exception: <=================================>Exception Message -> null
java.lang.NullPointerException
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:94)
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:70)
        at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper$1.run(InternalGenericDataStoreHelper.java:884)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledConnection(InternalGenericDataStoreHelper.java:921)
        at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:1392)
        at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1069)
        at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1815)
        at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1546)
        at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2287)
        at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:896)
        at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:596)
        at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:439)
        at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:408)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:825)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:751)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
        at com.ubs.swidapk.SpringUtil.<clinit>(SpringUtil.java:47)
        at com.ubs.swidapk.business.services.ServiceFactory.getHibernateUtil(ServiceFactory.java:223)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getInstance(HibernateUtil.java:61)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getSession(HibernateUtil.java:149)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getConnectionFromSession(HibernateUtil.java:395)
        at com.ubs.swidapk.admin.beans.SsrdJMX.getConnectionUrl(SsrdJMX.java:212)
        at com.ubs.swidapk.servlets.WelcomeServlet.doPost(WelcomeServlet.java:152)
        at com.ubs.swidapk.servlets.WelcomeServlet.doGet(WelcomeServlet.java:45)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1074)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:543)
        at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3357)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
        at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
<=================================>
[7/21/08 10:40:49:995 MEST] 00000025 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file /app/WAS/dyn/was61/6.1.0.13.0/profiles/Node_Mit01/logs/ffdc/as_apkapl_00000025_08.07.21_10.40.49_1.txt
[7/21/08 10:40:50:030 MEST] 00000025 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file /app/WAS/dyn/was61/6.1.0.13.0/profiles/Node_Mit01/logs/ffdc/as_apkapl_00000025_08.07.21_10.40.49_1.txt
[7/21/08 10:40:53:954 MEST] 00000025 FreePool      E   J2CA0046E: Method createManagedConnectionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/apkMetaDS, throwing ResourceAllocationException.  Original exception: <=================================>Exception Message -> null
java.lang.NullPointerException
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:94)
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:70)
        at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper$1.run(InternalGenericDataStoreHelper.java:884)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledConnection(InternalGenericDataStoreHelper.java:921)
        at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:1392)
        at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1069)
        at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1815)
        at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1546)
        at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2287)
        at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:896)
        at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:596)
        at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:439)
        at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:408)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50)
        at $Proxy4.createStatement(Unknown Source)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getSession(HibernateUtil.java:163)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getConnectionFromSession(HibernateUtil.java:395)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getInstance(HibernateUtil.java:64)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getSession(HibernateUtil.java:149)
        at com.ubs.swidapk.persistency.hibernate.HibernateUtil.getConnectionFromSession(HibernateUtil.java:395)
        at com.ubs.swidapk.admin.beans.SsrdJMX.getConnectionUrl(SsrdJMX.java:212)
        at com.ubs.swidapk.servlets.WelcomeServlet.doPost(WelcomeServlet.java:152)
        at com.ubs.swidapk.servlets.WelcomeServlet.doGet(WelcomeServlet.java:45)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1074)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:543)
        at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3357)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
        at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
<=================================>
 

dongfang_xu

Neues Mitglied
Hi,

Have same problem here.

It seems that:

1) OracleConnectionPoolDataSource crashes at getPooledConnection, if the setters for username and password have not been called in the past.

2) WebSphere 6 does not call the setters if the configured username and password are empty.

I have reproduced the problem without WebSphere, to confirm 1).

I have patched up the problem temporarily, by making my own extention of OracleConnectionPoolDataSource, which calls setUser("") and setPassword("") in its constructor. Since WebSphere does not recognize it as an Oracle DataSource, and then you cannot enter an URL in the configuration. The DataSource will then crash again, this time because no URL is set.... .... So I also set the URL in the constructor.

Not nice, but it works....

Did you find a complete solution?

Regards
Soren
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
X [Hibernate] Connection Pool - MinSize ? Data Tier 2
X [Hibernate] Anderen Connection Pool - Vorschläge? Data Tier 3
foobar Connection Pool mit unterschiedlichen Verbindungen Data Tier 8
N java.sql.SQLException: Error in allocating a connection. Cau Data Tier 5
N Problem beim initialisieren des Caches Data Tier 0
S JPA Problem mit Cascading Data Tier 1
M Eclipse 4 RCP Hibernate Problem Data Tier 3
C JPA FetchType.LAZY, Relation @OneToMany und Problem mit dem update Data Tier 1
K Problem mit EJBs und Transaktionen Data Tier 0
G JPA: Entity Klasse @JoinColumns Problem Data Tier 2
M JPA Problem: java.sql.SQLSyntaxErrorException: Data Tier 7
H Hibernate Problem mit Lazy Loading bei @OneToMany Collections Data Tier 5
M MySql und JPA-Timestamp Problem Data Tier 8
J Hibernate Problem bei Master-Detail-Tabellen Data Tier 5
A JPA - ManyToMany Problem - keine Unique Mehrfachzuweisungen Data Tier 4
M Problem beim Laden von Objekten, die von anderen Applikationen in eine DB eingefügt wurden Data Tier 5
M Problem mit @Temporal Mapping und SQL Server Data Tier 3
P JPA - HashMap mit Many-to-Many Relation Problem Data Tier 4
B Problem mit @ManyToMany und CascadeType.ALL Data Tier 3
Blackskyliner [JPA][Anfänger] Problem mit Wertzuweisung aus Verbundtabelle Data Tier 2
B Problem mit org.hibernate.LazyInitializationException Data Tier 11
B DatenquellenUpdater extends Thread - Problem mit PermGenSpace Data Tier 5
S Problem beim Insert mit Hibernate Data Tier 9
Y [openJPA] Problem mit Transaktion? Data Tier 2
A @SecondaryTable Problem Data Tier 9
N Problem beim session.flush(); Data Tier 17
Y Postgres und JPA - Primärschlüssel Problem Data Tier 3
P SQL PRoblem Hibernate? Data Tier 8
Y EJB Problem mit Transaktionen Data Tier 7
M Transaction / Session Problem Data Tier 4
G JPA 2.0 Query Problem Data Tier 3
P CORBA Problem bei EJB 3.0 Anwendung in Glassfish v3 Data Tier 7
F Problem mit Hibernate Schema Update Data Tier 2
S Lazy loading Problem Data Tier 2
M Insert-Problem mit JPA/Hibernate Data Tier 4
megachucky JPA - Problem mit Persistence Unit / Context Data Tier 1
H Hibernate Problem Data Tier 4
D Performance Problem mit Prepared Statement Data Tier 6
T Problem mit openJPA Data Tier 7
P Problem mit Data Tier 9
GilbertGrape Cascade Problem (Hibernate) Data Tier 3
C JPA Problem mit attributeOverride und mehrspaltigem PK Data Tier 2
B select "neu" statement Problem (jpql) Data Tier 8
boxi Hibernate Lazy Loading Problem Data Tier 2
M Problem mit Hibernate und SLF4J - NoSuchMethodException Data Tier 3
K Hibernate update-Problem Data Tier 36
J hibernate problem Data Tier 14
N Hibernate - Problem mit Update/Insert Data Tier 4
B Problem mit @PersistenceContext Data Tier 4
G Problem with mapped of the tables at one to one relationship Data Tier 8
I Hibernate / JPA: Eine Datenbank und pro User ein Schema Data Tier 9
T Hibernate/Spring JPA: eigene ID generieren Data Tier 5
Avalon @ManyToOne Hibernate oder JPA? Data Tier 5
D Hibernate Hibernate mit MariaDB Data Tier 1
ToBJo Hibernate Glassfish deploy mit Hibernate schlägt fehl Data Tier 1
C JPA Hibernate Map<String,String> richtig mappen Data Tier 2
S JPA Hibernate Search & EclipseLink (oder OpenJPA) Data Tier 0
R JPA Probleme mit Wechsel von EclipseLink auf Hibernate Data Tier 4
ARadauer Hibernate Entität readonly laden... Data Tier 1
G Hibernate SQL in Hibernate: Keine Parameter mit Index? Data Tier 2
P Wildfly + Hibernate + SQL Server Data Tier 0
E JPA Hibernate Query mit Timestamp hat seltsames Verhalten Data Tier 1
C Hibernate ProgressBar updaten mit Daten aus Hibernate Data Tier 4
B Hibernate und MySQL testen Data Tier 8
I Hibernate HQL: generiertes SQL ausgeben Data Tier 1
R mapping-file für hibernate zum Überschreiben der Annotationen Data Tier 7
R Hibernate Hibernate und Logback Data Tier 2
R Hibernate möchte Schema zwei mal undeployen Data Tier 2
F Hibernate Hibernate / JPA Data Tier 4
E Hibernate: Session vs EntityManager Data Tier 3
C Hibernate Hibernate Code Generation Data Tier 3
S Hibernate Mehrfachverbindung mit Hibernate Data Tier 3
M Hibernate Einstiegsfrage Data Tier 5
M Exception in thread "main" org.hibernate.MappingException: java.lang.ClassNotFoundException: Message Data Tier 4
S Hibernate Einstieg in Hibernate 3.2 sinnvoll? Data Tier 8
P JPA Eigene Vererbungsstrategie mit JPA / Hibernate Data Tier 2
Y Jboss seam-hibernate-jpa Data Tier 5
RaoulDuke Hibernate Map<String,String> mit Annotations mappen Data Tier 2
M Hibernate Hibernate with GWT Data Tier 4
C Hibernate JPA mysql db erstellen Data Tier 4
M Hibernate Hibernate liest Daten zu oft aus! Data Tier 16
pg1337 Hibernate Fragen Data Tier 11
D Probleme bei Left Joins mit Hibernate createCriterias() Data Tier 2
D Hibernate probleme mit Verlinkungstabelle Data Tier 4
2 Hibernate Annotations Data Tier 7
G Hibernate select update no wait Data Tier 8
Z Hibernate: Many-To-Many nur eine bestimmte Spalte Data Tier 3
K Hibernate - Envers - Erzeugung der SQL Skripte Data Tier 4
G Hibernate 1:n Beziehung mit Vererbung Data Tier 5
D Hibernate-Criteria-API (Projections und MAX-Funktion) Data Tier 6
L Hibernate: failed to lazily initialize a collection of role Data Tier 3
S Hibernate hibernate.cfg.xml Data Tier 14
D JPA vs Hibernate.cfg und Entitymanager Data Tier 6
H Hibernate - Mapping für Enumeration Data Tier 1
R Hibernate Criteria Abfrageproblem Data Tier 2
A Hibernate und jdbc zusammen Data Tier 4
D Mit Hibernate aus JUnit ein DB-Schema erzeugen Data Tier 6
S [Hibernate] No Persistence provider for EntityManager Data Tier 5
G Hibernate HQL und Interface Data Tier 4
G JSF Hibernate no session or session was closed Data Tier 12

Ähnliche Java Themen


Oben