I get the stack trace below when running start.ps1 to start the Discovery service in the powershell. The database is running on my local MSSQLSERVER instance which I have confirmed is on port 1433.
My storage configuration looks like this:
<Storage Type="persistence" Id="defaultdb" dialect="MSSQL"
Class="com.tridion.storage.persistence.JPADAOFactory">
<Pool Type="jdbc" Size="10"
MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
<Property Name="serverName" Value="(local)" />
<Property Name="portNumber" Value="1433" />
<Property Name="databaseName" Value="Tridion_DiscoveryService"/>
<Property Name="user" Value="TridionBrokerUser" />
<Property Name="password" Value="It's a secret" />
</DataSource>
</Storage>
I can connect to the database and execute SQL from a Powershell script that uses the same values as in the properties of the data source.
The exception seems to be telling me that there is a problem making a connection to the database. Having checked the basic details, I am now looking for suggestions as to what else might cause this failure.
Here is the stack trace:
java.exe : Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceFactoryImpl': Injection of autowired dependencies failed; nested exception is org.springframework.bean s.factory.BeanCreationException: Could not autowire field: private java.util.List com.sdl.odata.processor.datasource.fa ctory.DataSourceFactoryImpl.dataSourceProviders; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'tridionConfigDataSourceProvider': Injection of autowired dependencies failed; nes ted exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sdl.web .discovery.datalayer.TridionConfigDataSource com.sdl.web.discovery.datalayer.TridionConfigDataSourceProvider.dataSource ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tridionCo nfigDataSource': Invocation of init method failed; nested exception is javax.persistence.PersistenceException: org.hibe rnate.exception.JDBCConnectionException: Could not open connection At C:\SDLWebCDServices\Discovery\bin\start.ps1:42 char:5 + & $java_run $jvmoptions -cp $classpath $className $arguments + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Exception in th...open connection:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(Auto wiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapabl eBeanFactory.java:1210) at ===================== Lots more lines of stack trace... removed for clarity ===================== at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1300) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449) ... 54 more Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host (local), port 1433 has fa iled. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host a nd accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall." . at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:191) at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.j ava:242) at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2280) at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:493) at ============================= More trimmed here