nybon 发表于 2005/5/17 22:52:24 | 今天在做Spring+iBatis的一个部署,本来已经调试好了,但是打包成jar发布的时候发现了使用Spring的ClassPathResource无法找到iBatis的配置文件.在Google上面猛搜了一阵也没有发现到底怎么解决(还搜到一个误导我的message,说是在jar的manifest.mf里面可以声明,害我浪费了一个多小时看),最后搜来搜去搜到了Spring的API doc:
public class ClassPathResourceextends AbstractResource
Resource implementation for class path resources. Uses either the thread context class loader, a given ClassLoader or a given Class for loading resources.
Supports resolution as java.io.File if the class path resource resides in the file system, but not for resources in a JAR. Always supports resolution as URL. 原来用这个ClassPathResource是没可能在Spring里面配出来jar里面的资源访问的,痛.只能再想办法了
|