Foros de discusión

JNDI using MsSQL and integratedSecurity

thumbnail
Paul Schmidt, modificado hace 8 años.

JNDI using MsSQL and integratedSecurity

Junior Member Mensajes: 34 Fecha de incorporación: 28/07/10 Mensajes recientes
Hello Community,

I have some troubles setting up a JNDI datasource with integrated security.

Liferay 6.1.0 CE GA1

The old (working) datasource definition in context.xml:
<resource name="jdbc/liferayDS" auth="Container" type="javax.sql.DataSource" maxActive="20" maxIdle="5" maxWait="10000" username="*****" password="*****" validationQuery="select 1;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" logAbandoned="true" url="jdbc:sqlserver://localhost;databaseName=lportal" />


Now I need to set up windows auth. MsSQL Server is configured correct and the login via windows auth is working fine.
The modified (not working) datasource:
<resource name="jdbc/liferayDS" auth="Container" type="javax.sql.DataSource" maxActive="20" maxIdle="5" maxWait="10000" integratedSecurity="true" validationQuery="select 1;" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" logAbandoned="true" url="jdbc:sqlserver://localhost;databaseName=lportal" />


When starting Liferay the following stacktrace occurs:

12:01:33,887 ERROR [DialectDetector:133] org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''. ClientConnectionId:14c28819-b7c0-43a7-b3c1-88ccd29d24a2)
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''. ClientConnectionId:14c28819-b7c0-43a7-b3c1-88ccd29d24a2)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.liferay.portal.dao.jdbc.util.DataSourceWrapper.getConnection(DataSourceWrapper.java:36)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.j
ava:403)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
at $Proxy4.getMetaData(Unknown Source)
at com.liferay.portal.spring.hibernate.DialectDetector.getDialect(DialectDetector.java:65)
at com.liferay.portal.spring.hibernate.DialectDetector.determineDialect(DialectDetector.java:49)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.determineDialect(PortalHibernateConfiguration.java:70)

. . .

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. ClientConnectionId:14c28819-b7c0-43a7-b3c1-88ccd29d24a2
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:84)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2908)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)




12:01:33,934 ERROR [PortalHibernateConfiguration:116] java.lang.RuntimeException: No dialect found
java.lang.RuntimeException: No dialect found
at com.liferay.portal.spring.hibernate.DialectDetector.getDialect(DialectDetector.java:141)
at com.liferay.portal.spring.hibernate.DialectDetector.determineDialect(DialectDetector.java:49)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.determineDialect(PortalHibernateConfiguration.java:70)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.newConfiguration(PortalHibernateConfiguration.java:102)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:60)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)



Do you have any hints?

Best regards,
Paul
thumbnail
David H Nebinger, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
When running as an auto start system service, I don't believe there is a "logged in user" with credentials to pass.
thumbnail
Paul Schmidt, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

Junior Member Mensajes: 34 Fecha de incorporación: 28/07/10 Mensajes recientes
The portal starts as a Windows Task triggered by a specific user who runs the catalina.bat. So there is a logged in user definitly.
Salvatore Farsaci, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

New Member Mensaje: 1 Fecha de incorporación: 1/02/13 Mensajes recientes
Hi Paul,

I'm trying to implement the same thing and I'm getting a similar issue. I was wandering if you made it work eventually?


Thanks,

Sal
thumbnail
Paul Schmidt, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

Junior Member Mensajes: 34 Fecha de incorporación: 28/07/10 Mensajes recientes
Hi,
yes I found a solution. I will post the complete tutorial during this week in our company blog http://www.bigdata-unleashed.com

Best regards,
Paul
thumbnail
Corné Aussems, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

Liferay Legend Mensajes: 1313 Fecha de incorporación: 3/10/06 Mensajes recientes
Hi Paul,

I am interested in this as well.
But i can find it on your blog. Would you please update the exact url,.

Best regards,
Corné
thumbnail
Paul Schmidt, modificado hace 8 años.

RE: JNDI using MsSQL and integratedSecurity

Junior Member Mensajes: 34 Fecha de incorporación: 28/07/10 Mensajes recientes