Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Error connecting Liferay DXP to SQL Server 2017
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)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3888)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(JDBCConnection.java:641)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:309)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
... 173 more
Caused by: org.hsqldb.HsqlException: unexpected token: WITH
at org.hsqldb.error.Error.parseError(Error.java:101)
at org.hsqldb.ParserBase.unexpectedToken(ParserBase.java:815)
at org.hsqldb.ParserCommand.compileStatement(ParserCommand.java:74)
at org.hsqldb.Session.compileStatement(Session.java:933)
at org.hsqldb.StatementManager.compile(StatementManager.java:375)
at org.hsqldb.Session.execute(Session.java:1037)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3885)
... 188 more
</init></init>
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.
What made you assume that you're connecting to SqlServer?
And please mention the full unabbreviated version that you're running.
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!
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!
Attachments:
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.