Spring SqlServer JDBC Help

Support and Announcements for the Tech Java Web Application Platform (setup, configuration, bugs, feedback).
New Member
Posts: 25
Joined: Tue Feb 01, 2011 5:34 pm
Location: Riverton, UT

Spring SqlServer JDBC Help

Postby tlmaravilla » Mon Dec 02, 2013 4:48 pm

Long story short here - our portfolio wrote our initial firewall activation app in Java/Oracle a few years back. Then our portfolio switched from Java/Spring to C#/.Net and we are now using sqlserver.

I need to be able to have our firewall activations app to write directly to sqlserver DB using Microsoft's sqlserver jdbc 4 driver. I have successfully written a test driver in order to read from the DB, but integrating sqlserver jdbc into spring/stack is more difficult. I am seeing the following error:

Code: Select all

Dec 2, 2013 4:31:57 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/D:/Workspaces/ActivationOld/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mtm-firewall-web/WEB-INF/lib/stack-template-core-2.2.jar!/org/lds/stack/template/service-context/dbServiceContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

I have created a datasource bean in my serviceBeanContext.xml:

Code: Select all

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="${com.microsoft.sqlserver.jdbc.SQLServerDriver}"/>
      <property name="url" value="${jdbc:sqlserver://CHQPVUW7521\\S01:1601;}"/>
      <property name="username" value="${FTM_Dev_PTA}"/>
      <property name="password" value="${*****}"/>

Has anyone ever tried tackling this issue?

Return to “Java Web Project Support (Stack)”

Who is online

Users browsing this forum: No registered users and 1 guest