Cannot create JDBC driver of class '' for connect URL 'null' 解决方法
ssh中jndi的配置方法 在使用jndi的时候出现如下错误
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
解决方法:
1.查看spring中 applicationContext.xml 配置是否正确:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/jdbc/ImageDB" /> <property name="resourceRef" value="true" /> </bean>
2.看web.xml中是否有jndi的配置:
<resource-ref> <description>ImageDB Connection</description> <res-ref-name>jdbc/ImageDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
3.tomcat中的context.xml文件 添加如下配置 jdbc/ImageDB 要注意大小写 ,每个文件中都要一样,
<ResourceLink name="jdbc/ImageDB" global="jdbc/ImageDB" type="javax.sql.DataSource" />
4.tomcat中的 server.xml :
<Resource name="jdbc/ImageDB" auth="Container" driverClassName="org.postgresql.Driver" maxActive="20" maxIdle="10" maxWait="-1" password="123456" type="javax.sql.DataSource" url="jdbc:postgresql://172.26.100.100:5432/imagedb" username="image"/>
来源://作者:/更新时间:2013-02-17
顶
踩
相关文章:
- springmvc form表单提交后台对象获取不到值(解决)
- springmvc form提交使用@ModelAttribute后台取得乱码
- (解决) springmvc jsp界面显示乱码 spring+mybatis+my
- org.apache.ibatis.builder.BuilderException: Error
- java.util.concurrent.ExecutionException: Failed to
- spring jar framework 下载地址(解决)
- HttpHostConnectException: Connection to http://jsj
- Field or property 'jobParameters' cannot be found
- MINA2官方教程翻译(10)与Spring整合
- spring Bean property 'backupService' is not writab