您的位置:程序门 -> java -> j2ee / ejb / jms



spring + hibernate 問題


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


spring + hibernate 問題
发表于:2007-12-04 14:44:00 楼主
我在   junit   测試   hibernate   +   spring   的功能時,就報錯:  
org.springframework.beans.factory.beancreationexception:   error   creating   bean   with   name   'filter'   defined   in   class   path   resource   [beans.xml]:   cannot   resolve   reference   to   bean   'sessionfactory'   while   setting   bean   property   'sessionfactory';   nested   exception   is   org.springframework.beans.factory.beancreationexception:   error   creating   bean   with   name   'sessionfactory'   defined   in   class   path   resource   [beans.xml]:   invocation   of   init   method   failed;   nested   exception   is   java.lang.noclassdeffounderror:   javax/persistence/entity


但是我在   jboss   deploy   后   运行没有问题,不知为什么就不能在junit   测试

请高手帮我看下
发表于:2007-12-04 14:46:141楼 得分:0
你是不是用了标签@entity,persistence.jar没有添加到classpath中
发表于:2007-12-04 15:19:232楼 得分:0
加了
hibernate-annotations.jar
ejb3-persistence.jar


快速检索

最新资讯
热门点击