不显示删除回复显示所有回复显示星级回复显示得分回复 项目打成jar后 spring的 applicationcontext.xml 路径问题
我现在做了个 spring+hibernate (java Project)项目(或cs项目),打jar 包时指定了主函数。
用Eclipse直接运行 正常,项目无误。
生成jar时,生成失败。
运行时找不到主函数。
初步怀疑引起问题的原因是下面这句话:
factory =new ClassPathXmlApplicationContext("classpath*:spring/dataAccessContext-hibernate.xml");
生成jar时不能正常解析。
首先配置文件没有问题。
生成jar时
把下面的注销掉
factory =new ClassPathXmlApplicationContext("classpath*:spring/dataAccessContext-hibernate.xml");
运行jar正常执行。
加上后 再运行jar就找不到 主函数 。
首先:生成jar时 main方法已经指定
其次:生成时 只把class文件放到jar里。把生产的jar放到和项目引用的lib(jar包)里。
原理上 应该是没有问题,但是运行找不到主函数