hibernate在websphere服务器中出错
HibernateSessionFactory.java,myeclipse自动生成的,本地运行也正常,发布到websphere服务器时出错代码片段
static {
try {
configuration.configure(configFile);
sessionFactory = configuration.buildSessionFactory();
} catch (Exception e) {
System.err
.println("%%%% Error Creating SessionFactory111 %%%%");
e.printStackTrace();
Log.error("%%%% Error Creating SessionFactory1 %%%%"+e);
}
}
运行sessionFactory = configuration.buildSessionFactory();时,跳进异常,报错如下;
XmlWebApplicationContext 是spring的类,我程序中没有用到,为什么会报出这个错误?
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R %%%% Error Creating SessionFactory111 %%%%
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R java.lang.ClassCastException: org.springframework.web.context.support.XmlWebApplicationContext incompatible with java.lang.String
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R at org.hibernate.util.PropertiesHelper.resolvePlaceHolders(PropertiesHelper.java:88)
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1173)
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R at com.aegon_cnooc.dis.factory.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:37)
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R at java.lang.J9VMInternals.initializeImpl(Native Method)
[12-8-15 16:19:23:785 CST] 0000005a SystemErr R at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
--------------------编程问答-------------------- 导入包的时候,引入spring的了吧 --------------------编程问答-------------------- 没有的,最初用了lib包里有spring的包,但是代码里一直没有引用,应该相当于对于的jar包,我程序把spring的包直接删除,也一样运行的,而且本机没问题的,都是部署到websphere才出事的,之前也是运行好好的,最近开始不能用了,代码没改过
补充:Java , Java EE