RE: Error connecting Liferay DXP to SQL Server 2017

Vishnu S Kumar, modified 6 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
I got the follwing error when connecting  liferay to the SQL Server for the first time.
[4/24/19 11:29:04:314 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.314 INFO  [WebContainer : 0][HikariDataSource:95] HikariPool-17 - Starting...
[4/24/19 11:29:04:454 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.454 INFO  [WebContainer : 0][PoolBase:491] HikariPool-17 - Driver does not support get/set network timeout for connections. (This operation is not supported.)
[4/24/19 11:29:04:454 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.454 INFO  [WebContainer : 0][HikariDataSource:107] HikariPool-17 - Start completed.
[4/24/19 11:29:04:454 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.454 INFO  [WebContainer : 0][HikariDataSource:317] HikariPool-17 - Shutdown initiated...
[4/24/19 11:29:04:454 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.454 INFO  [WebContainer : 0][HikariDataSource:319] HikariPool-17 - Shutdown completed.
[4/24/19 11:29:04:610 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.610 ERROR [WebContainer : 0][JDBCExceptionReporter:234] unexpected token: WITH
[4/24/19 11:29:04:610 EDT] 00000113 SystemOut     O 2019-04-24 11:29:04.610 WARN  [WebContainer : 0][PortalImpl:6872] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.kernel.model.Counter]
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.kernel.model.Counter]
    at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:270)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:391)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.createCounterRegister(CounterFinderImpl.java:233)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.createCounterRegister(CounterFinderImpl.java:197)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.getCounterRegister(CounterFinderImpl.java:258)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.increment(CounterFinderImpl.java:109)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.increment(CounterFinderImpl.java:100)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl.increment(CounterFinderImpl.java:95)
    at com.liferay.counter.service.impl.CounterLocalServiceImpl.increment(CounterLocalServiceImpl.java:42)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:508)
   
Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.kernel.model.Counter]
    at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:39)
    at com.liferay.portal.dao.orm.hibernate.SessionImpl.get(SessionImpl.java:205)
    at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.get(ClassLoaderSession.java:326)
    at com.liferay.counter.service.persistence.impl.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:369)
    ... 159 more
Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.kernel.model.Counter]
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2041)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3294)
    at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
    at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
   
    ... 161 more
Caused by: java.sql.SQLSyntaxErrorException: unexpected token: WITH
    at org.hsqldb.jdbc.JDBCUtil.sqlException(JDBCUtil.java:376)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(JDBCUtil.java:247)
&nbsp;&nbsp; &nbsp;at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3888)
&nbsp;&nbsp; &nbsp;at org.hsqldb.jdbc.JDBCConnection.prepareStatement(JDBCConnection.java:641)
&nbsp;&nbsp; &nbsp;at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:309)
&nbsp;&nbsp; &nbsp;at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
&nbsp;&nbsp; &nbsp;at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
&nbsp;&nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
&nbsp;&nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:508)
&nbsp;&nbsp; &nbsp;at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
&nbsp;&nbsp; &nbsp;at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
&nbsp;&nbsp; &nbsp;at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
&nbsp;&nbsp; &nbsp;... 173 more
Caused by: org.hsqldb.HsqlException: unexpected token: WITH
&nbsp;&nbsp; &nbsp;at org.hsqldb.error.Error.parseError(Error.java:101)
&nbsp;&nbsp; &nbsp;at org.hsqldb.ParserBase.unexpectedToken(ParserBase.java:815)
&nbsp;&nbsp; &nbsp;at org.hsqldb.ParserCommand.compileStatement(ParserCommand.java:74)
&nbsp;&nbsp; &nbsp;at org.hsqldb.Session.compileStatement(Session.java:933)
&nbsp;&nbsp; &nbsp;at org.hsqldb.StatementManager.compile(StatementManager.java:375)
&nbsp;&nbsp; &nbsp;at org.hsqldb.Session.execute(Session.java:1037)
&nbsp;&nbsp; &nbsp;at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3885)
&nbsp;&nbsp; &nbsp;... 188 more

</init></init>
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Well, "connect to SqlServer for the first time", combined with an HSQLDB error message, doesn't sound like a convincing case for the first part of the sentence.
What made you assume that you're connecting to SqlServer?
And please mention the full unabbreviated version that you're running.
Vishnu S Kumar, modified 6 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts
The following attachment has all my connection properties and a full error stack.

I'm running Liferay DXP sp10 on Websphere 8.5.5.15.  My database is SQL Server 2017 Developer Edition 14.0 and JDBC connector sqljdbc41-6.0.8112.jar

Please let me know if you need more info. Thanks for the support!
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
I've been missing this answer. As you have support with DXP, the best is to just open a ticket. Support staff will either have seen the problem already, or help you figure out the root cause. I can't reproduce as I don't have any SqlServer available, but the supported environments are part of the deal that you get with DXP. Use it.