我已经按照此链接mvn install安装了我的 sqljdbc4.jar 。它完全成功,sqljdbc4.jar 加载到我的库中,下面是我在部署时遇到的 spring bean、依赖项和错误。任何人都可以在我失踪的地方帮助我。怎么办?
我的春豆是:
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url" value="jdbc:sqlserver://vinodh-pc:1433" />
<property name="username" value="sa" />
<property name="password" value="vinodh" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我的依赖是:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>${sql.jdbc.version}</version>
<scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
在我部署时出现以下错误:
ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-7) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txmanager' defined in class path resource [db-spring-config.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name …Run Code Online (Sandbox Code Playgroud)