Java目录总结(一.相同目录和WEB-INF目录)

首先,看两个例子:

例子一:普通项目

在上面的图片中:src目录和config目录是同一个目录最终编译都是编译到同一个classes目录下

所以,它们对于程序而言实际上是同一个目录。

 

读取文件的时候,我们要看把config目录放在哪个目录下,才能进行相应的读取。

如果是和classes目录同级,就是:
new File("../config/myConfig.properites");

如果在classes目录里(与src同级),就是:
new File("config/myConfig.properites");

如果在src目录里,就是:(/表示src根目录)
new File("/config/myConfig.properites");


例子二:Maven项目

在上面的图片中,java目录和resource目录是同一个目录最终编译都是编译到同一个classes目录下

所以,它们对于程序而言实际上是同一个目录。如下所示:

而对于web项目而言,编译之后,该classes目录存在于WEB-INF目录下,与WEB-INF下的配置文件以及存放所有jar包的lib目录同属于WEB-INF目录,如下所示:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.support.ScheduledMethodRunnable#0': Cannot resolve reference to bean 'sysTask' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysTask': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ecp.crm.service.SaleTrackingService com.ecp.system.task.SysTask.saleTrackingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'saleTrackingServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ecp.crm.dao.SaleTrackingDao com.ecp.crm.service.impl.SaleTrackingServiceImpl.fDao; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'saleTrackingDao' defined in file [D:\�����ļ�\soyogit\epm\trunk\target\epm-1.0.0\WEB-INF\classes\com\ecp\crm\dao\SaleTrackingDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in URL [file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/classes/spring.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/lib/ecp-platform-extend-1.9.4.jar!/com/ecp/attachment/dao/mysql/AttachmentAssociateMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: XML fragments parsed from previous mappers already contains value for com.ecp.attachment.dao.AttachmentAssociateMapper.table-name; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/classes/spring.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'URL [jar:file:/D:/�����ļ�/soyogit/epm/trunk/target/epm-1.0.0/WEB-INF/lib/ecp-platform-extend-1.9.4.jar!/com/ecp/attachment/dao/mysql/AttachmentAssociateMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: XML fragments parsed from previous mappers already contains value for com.ecp.attachment.dao.AttachmentAssociateMapper.table-name
最新发布
07-22

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值