paip.c3p0 nullpointexcept 配置文件根路径读取bug 解决
windows ok
linux犯错误...
查看loging, 初始化的时候儿jdbcurl,user,pwd都是null...不交的了....
/////////////////////////////////process monitor,查看不见...
widnows bat 方式时候儿,c3p0 property路径,experess monitor,发现寻找lib/*...不个那nae过k,ok...
Linux里面,strace文章上说是能view php 的ini了.三.走十java的c3po查看不到个读本哪个proertys文件了...
strace -o /xoutput.txt -T -tt -e trace=all /usr/java/jdk1.6.0_21/bin/java -Djava.ext.dirs=/imServer/lib -classpath .:/usr/java/jdk1.6.0_21/lib/dt.jar:/usr/java/jdk1.6.0_21/lib/tools.jar:/imServer/WebRoot/WEB-INF/classes com.attilax.util.linuxServiceTest
9999
最后,使用java 获得根路径.../root/...
/usr/java/jdk1.6.0_21/bin/java -Djava.ext.dirs=/imServer/lib -classpath .:/usr/java/jdk1.6.0_21/lib/dt.jar:/usr/java/jdk1.6.0_21/lib/tools.jar:/imServer/WebRoot/WEB-INF/classes com.attilax.io.pathx
///////////////////////change c3p0 version,不生效..
form 0.9.1>>> 0.9.5 .还是中个..
///////////////////////只好查看源码兰..估计ResourcePath的问题..更改累挂.ok..要不不个那试达根路径/是/root/,不个那放的个那哈头大概也新了...
/imServer/src/com/mchange/v2/c3p0/cfg/C3P0Config.java
public final static String PROPS_FILE_RSRC_PATH = "/c3p0.properties";
static Properties findResourceProperties() {
String cfgPath = pathx.classPath() + PROPS_FILE_RSRC_PATH;
core.logger.info("---o3d10:" + cfgPath);
return MPCONFIG().getPropertiesByResourcePath(cfgPath);
}
/imServer/src/com/mchange/v2/cfg/BasicMultiPropertiesConfig.java
public Properties getPropertiesByResourcePath(String path)
{
core.logger.info("---o3d101:"+path);
Properties out = ((Properties) propsByResourcePaths.get( path ));
return (out == null ? new Properties() : out);
}
作者Attilax 艾龙, EMAIL:1466519819@qq.com
来源:attilax的专栏
地址:http://blog.csdn.net/attilax
参考
Linux哈使用.strace 跟踪 ..查看文章,
Linux strace 跟踪进程信息 - Leichelle的专栏 - 博客频道 - CSDN.NET
strace命令小结 - jackyrong - ITeye技术网站
Linux strace 跟踪进程信息 - Leichelle的专栏 - 博客频道 - CSDN.NET