搭建JavaEE项目是遇到的几个问题

问题描述:无法读取spring mvc的xsd文件

参考http://eric-yan.iteye.com/blog/1908470

schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd', because 1)  could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

可能是eclipse的问题,代码没问题,只需要格式化一下,alt+s+f

 

问题2:

问题描述:No mapping found for HTTP request with URI

参考:http://blog.sina.com.cn/s/blog_534f69a00101332u.html

在springMVC配置文件中加入:<mvc:default-servlet-handler/>

 

问题3:

问题描述:Cannot create JDBC driver of class ''

读取到的jdbc driver class name为空

用Dbcp2的BasicDataSource,  配置如下:

#driver=oracle.jdbc.OracleDriver
driverClassName=oracle.jdbc.OracleDriver
# driver.OracleDriver is compatible with oracle 8i
url=jdbc:oracle:thin:@localhost:1521/xe
# former name jdbc.user is i    nappropriate, use jdbc.username instead. BasicDataSource swallow a properties file that must conform to this naming.
username=louis
password=louis

 

pro.load(DBUtil.class.getClassLoader().getResourceAsStream("/config/db/db.properties"));

ds = BasicDataSourceFactory.createDataSource(pro);//得到一个连接池对象
但是传入的参数pro中配置的driver而不是driverClassName而导致的问题

转载于:https://www.cnblogs.com/longwaytogo/p/7586888.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值