本帖最后由 jack_test1 于 2011-05-24 11:25:20 编辑

解决方案 »

  1.   

    可能是你的包的问题 ,仔细的看看 如果你的配置文件没错 我看就没错了  我看是你的Factory的配置 看看
      

  2.   

    不打包在eclipse 里面运行是没有问题的:我导入的包如下:
    antlr-2.7.6.jar
    cglib-2.2.jar
    commons-collections-3.1.jar
    dom4j-1.6.1.jar
    hibernate3.jar
    hibernate-entitymanager.jar
    hibernate-jpa-2.0-api-1.0.0.Final.jar
    javassist-3.12.0.GA.jar
    jta-1.1.jar
    log4j-1.2.16.jar
    slf4j-api-1.6.1.jar
    slf4j-log4j12-1.6.1.jar
    sqljdbc4.jar
    sqljdbc.jar
      

  3.   

    还有没有人回复呀,等待。急速来高手回复吧。我搞了一天了问了很多人都不知道。天呀现在项目要给别人用了,eclipse里面运行是没有问题的,但是打成执行jar  去运行就错了,我不可能在别人的机器上面也装个eclipse在跑程序运行吧。求。解。非常感激了。
      

  4.   

    [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.annotations.common.Version | Method = <clinit> | Line = 37 ] | Hibernate Commons Annotations 3.2.0.Final |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Environment | Method = <clinit> | Line = 593 ] | Hibernate 3.6.3.Final |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Environment | Method = <clinit> | Line = 626 ] | hibernate.properties not found |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Environment | Method = buildBytecodeProvider | Line = 804 ] | Bytecode provider name : javassist |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Environment | Method = <clinit> | Line = 685 ] | using JDK 1.4 java.sql.Timestamp handling |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.ejb.Version | Method = <clinit> | Line = 42 ] | Hibernate EntityManager 3.6.3.Final |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Configuration | Method = addResource | Line = 762 ] | Reading mappings from resource : META-INF/hql_orm.xml |
     [ERROR] [2011-05-24 15:12:16]  [ Class = org.hibernate.util.xml.ErrorLogger | Method = error | Line = 57 ] | Error parsing XML (2) : cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '2.0'. |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.Configuration | Method = addResource | Line = 762 ] | Reading mappings from resource : META-INF/hql_jack_orm.xml |
     [ERROR] [2011-05-24 15:12:16]  [ Class = org.hibernate.util.xml.ErrorLogger | Method = error | Line = 57 ] | Error parsing XML (2) : cvc-complex-type.3.1: Value '1.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '2.0'. |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.annotations.QueryBinder | Method = bindQuery | Line = 86 ] | Binding Named query: grade.getWaferAll => SELECT a FROM GradeEntity a |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.annotations.QueryBinder | Method = bindQuery | Line = 86 ] | Binding Named query: grade.getWaferID => SELECT i FROM GradeEntity i WHERE i.waferTypeId = :longId |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.annotations.QueryBinder | Method = bindQuery | Line = 86 ] | Binding Named query: workplace.getWaferAll => SELECT i FROM WorkplaceEntity i |
     [INFO] [2011-05-24 15:12:16]  [ Class = org.hibernate.cfg.annotations.QueryBinder | Method = bindQuery | Line = 86 ] | Binding Named query: workplace.getWaferID => SELECT i FROM WorkplaceEntity i WHERE i.plantNumId= :longId |
      

  5.   

    少jar包了吧,项目从新整合一下也好!
      

  6.   

    此贴成了百度搜索这个异常:排名第一了;汗看来很多人都有这个异常咯高手们出来指点下吧:没有少jar包呀。如果少了的话,是那个包呢,
    我eclipse里面运行是没有问题的,也没有错误;
    但是打成jar后去运行就报上面的错误;DaoPublic :(getAll) javax.persistence.PersistenceException: Unable to configureEntityManagerFactory反正就是讲:链接hibernate配置文件错误,链接不到;
    我反复的去把那些配置文件重新放置位置,还是一样。
    急求解。。我昨天都搞了一天了,今天又是一天了还是没有发现原因。
      

  7.   

      今天我高兴,终于发现是什么问题了,发现原来是hibernate  源代码的一个bug,
     hibernate源代码判断获取配置文件路径错误。