1

When I try to create TTM Website on Topology Manager by following command, SQLGrammarException occurs at Discovery Service.

 Add-TtmWebsite -Id "test" -CdEnvironmentId "StagingCdEnvironment" -BaseUrls "http://testtest.com"

"java -jar discovery-registration.jar update" command succeeds and configured values are inserted into Discovery DB, so Discovery Service seems fine.

Does any one know how to solve this issue?

Topology Manager error:

Add-TtmWebsite : Unable to save item of type 'WebApplicationData' with id 'test_RootWebApp'.
One or more errors occurred.
An error occurred while communicating with CD Discovery Service 'http://10.0.1.10:8082/discovery.svc' in CD Environment 'StagingCdEnvironment'.
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
An error occurred while processing this request.
{"error":{"code":"9000","message":"javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet"}}
At line:1 char:1
+ Add-TtmWebsite -Id "test" -CdEnvironmentId "StagingCdEnvironment" -Ba ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Tridion.Topolog...dWebsiteCommand:AddWebsiteCommand) [Add-TtmWebsite], DataServiceException
    + FullyQualifiedErrorId : Tridion.TopologyManager.Automation.AddWebsiteCommand

Discovery Service error:

2018-02-09 06:22:13,557 ERROR ODataRendererActor - Unexpected exception during response rendering - javax.persistence.PersistenceException: 'org.hibernate.exception.SQLGrammarException:
could not extract ResultSet'
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
        at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1407)
        at org.hibernate.Query.getResultList(Query.java:417)
        at com.tridion.storage.persistence.JPABaseDAO.executeQueryListResult(JPABaseDAO.java:302)
        at com.sdl.web.discovery.jpa.JPAODataDAO.executeQueryListResult(JPAODataDAO.java:71)
        at com.sdl.web.discovery.datalayer.TridionConfigDataSource.executeQueryListResult(TridionConfigDataSource.java:583)
        at com.sdl.web.discovery.datalayer.TridionConfigDataSourceProvider$1.execute(TridionConfigDataSourceProvider.java:84)
        at com.sdl.odata.processor.ODataQueryProcessorImpl.query(ODataQueryProcessorImpl.java:94)
        at com.sdl.odata.service.actor.ODataQueryProcessorActor$$anonfun$receive$1.applyOrElse(ODataQueryProcessorActor.scala:38)
        at akka.actor.Actor$class.aroundReceive(Actor.scala:480)
        at com.sdl.odata.service.actor.ODataQueryProcessorActor.aroundReceive(ODataQueryProcessorActor.scala:29)
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
        at akka.actor.ActorCell.invoke(ActorCell.scala:495)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
        at akka.dispatch.Mailbox.run(Mailbox.scala:224)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
        at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:2123)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887)
        at org.hibernate.loader.Loader.doQuery(Loader.java:932)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
        at org.hibernate.loader.Loader.doList(Loader.java:2615)
        at org.hibernate.loader.Loader.doList(Loader.java:2598)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2430)
        at org.hibernate.loader.Loader.list(Loader.java:2425)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1460)
        at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1426)
        at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1398)
        ... 16 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '@P0'.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1655)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:440)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:385)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2444)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:297)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
        ... 31 common frames omitted
  • 1
    seems to look config issue, double check your cd_storage config for database connectivity class and attributes are correctly configured, edit your question to share your config – Velmurugan Feb 9 '18 at 11:46
  • I reinstall Discovery Service, then it works. I'll compare config files to figure out what was wrong. – Hirokazu Shikata Feb 13 '18 at 11:46
  • @HirokazuShikata Any updates on what was wrong? Or just reinstall fixed the issue? – Andrew William Ross Jul 2 '18 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.