Configuration config=new Configuration().configure();
SessionFactory session=config.buildSessionFactroy();
SessionFactory session=config.buildSessionFactroy();
解决方案 »
- 禁用cookie后如何用session id取得attribute中的内容
- jsp 输入数字到文本框,点击图片跳到指定的分页里面,怎样实现?
- 急救!!!Jboss 出现 Error setting up static cursor cache
- eclipse查看源码问题(老掉牙的问题)
- #Struts 标签可以封装成一个自己的标签吗?
- QQ登陆不了,只差吐血。。。帮帮忙啊!
- 再问poi问题,在poi里面能不能对图片进行操作?
- ====C++ 和 java 一起学可以吗 !!??====
- weblogci8.1下,jsp修改后,服务器不重新编译。哪位仁兄帮忙
- 发现一个不错的网站,不知道这里去的人多不多?
- 在JBoss4下面部署EJB,发现Sqlserver连接进程很多,导致系统运行一段时间死机,请高手解答:-)
- Hibernate,session.delete不能删除数据问题。解决马上给分
to libin2722(禮物) :sessionFactory=new Configuration().configure().buildSessionFactory();跟你的一样的.有什么区别呀??问题是我的hibernate.cfg.xml 配置文件放在了src的目录下.是不是在启动的tomcat的时候会加载啊?不知道问题出在哪儿.
再有我的hibernate.cfg.xml和hibernate的映射文件都是自动生成的.通过hibernate synchonizer添加mapping reference和synchonize file的
configuration = new Configuration();
//configuration.configure(CONFIG_FILE_LOCATION);
sessionFactory = configuration.configure(CONFIG_FILE_LOCATION).buildSessionFactory();
SessionFactory sf = new Configuration().configure().buildSessionFactory();
时报莫名的异常,而在web中没事是怎么回事啊?
异常为:::
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at net.abe.SimpleTest.main(SimpleTest.java:17)
sessionFactory=new Configuration().configure().buildSessionFactory(“你的路径/配置文件名”)
21718 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.8
21765 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - hibernate.properties not found
21843 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
21859 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
22000 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
22000 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
22031 [http-8081-Processor25] WARN net.sf.hibernate.cfg.Configuration - /hibernate.cfg.xml not found
35313 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.8
35344 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - hibernate.properties not found
35407 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
35407 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
35579 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Configuration - configuring from resource: com/mypro/hibernate/hibernate.cfg.xml
35579 [http-8081-Processor25] INFO net.sf.hibernate.cfg.Configuration - Configuration resource: com/mypro/hibernate/hibernate.cfg.xml
35610 [http-8081-Processor25] WARN net.sf.hibernate.cfg.Configuration - com/mypro/hibernate/hibernate.cfg.xml not found