2 Replies Latest reply on Jan 3, 2009 9:12 PM by Riccardo Serafin

    hbm2ddl fails in JBoss embedded

    Nikolay Elenkov Master

      I have an ear project with Seam 2.0.1.GA. When deployed in JBoss import.sql
      gets executed at deploymen time and I can access/edit the data via the EJB's.


      When I try to test with SeamTest and jboss-embedded (beta3), I get the following
      error:


      java.sql.SQLException: Table not found in statement [insert into MyUser]
      



      I uppded the log level in log4j.xml and found out that hbm2ddl is not executed
      because scanning the ejb jar fails and no entities are found. Here is the error:


      DEBUG [org.hibernate.ejb.Ejb3Configuration] Detect class: true; detect hbm: true
      DEBUG [org.hibernate.ejb.Ejb3Configuration] Detect class: true; detect hbm: true
      DEBUG [org.hibernate.ejb.packaging.JarVisitor] Searching mapped entities in jar/par: jar:file:/C:/Users/nick/.m2/repository/my/package/my-ejb/0.0.1-SNAPSHOT/my-ejb-0.0.1-SNAPSHOT.jar!/
      WARN  [org.hibernate.ejb.packaging.InputStreamZippedJarVisitor] Unable to find file (ignored): jar:file:/C:/Users/nick/.m2/repository/my/package/my-ejb/0.0.1-SNAPSHOT/my-ejb-0.0.1-SNAPSHOT.jar!/
      java.io.IOException: no entry name specified
           at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:129)
      



      (filenames have been slightly changed)



      Any idea what is causing the error?


      And another thing, in the same log file I have:


      INFO  [org.hibernate.cfg.annotations.Version] Hibernate Annotations 3.3.1.Beta1
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      INFO  [org.hibernate.cfg.Environment] Hibernate 3.2.4.sp1
      INFO  [org.hibernate.cfg.Environment] hibernate.properties not found
      INFO  [org.hibernate.cfg.Environment] Bytecode provider name : javassist
      INFO  [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
      INFO  [org.hibernate.ejb.Version] Hibernate EntityManager 3.3.2.Beta1
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      


      I am not using neither Hibernate Annotations 3.3.1.Beta1, nor EntityManager 3.3.2.Beta1.
      (I have EntityMaanger 3.3.2.GA in my pom.xml)


      So where are they coming from? (The error might be due to some bug in the Betas, I think)



      TIA

        • 1. Re: hbm2ddl fails in JBoss embedded
          Nikolay Elenkov Master

          To answer my own question,



          Nikolay Elenkov wrote on Apr 09, 2008 03:45 AM:



          I am not using neither Hibernate Annotations 3.3.1.Beta1, nor EntityManager 3.3.2.Beta1.
          (I have EntityMaanger 3.3.2.GA in my pom.xml)

          So where are they coming from? (The error might be due to some bug in the Betas, I think)



          I had hibernate-all in my root pom. It apperantly includes EntityManager 3.3.2.Beta1,
          which, it seems, has a bug that prevents it from running within jboss embedded.


          I removed the dependency and the tests work now (using EntityManager 3.3.1.GA)


          Now if I could only find a way to generate test coverage...

          • 2. Re: hbm2ddl fails in JBoss embedded
            Riccardo Serafin Newbie

            Nikolay, did you ever found I way to obtain coverage reports? I'm guessing you are having my same failure, that is when embedded jboss is used with cobertura or emma the same error that was originally reported is thrown (org.hibernate.ejb.packaging.InputStreamZippedJarVisitor Unable to find file (ignored)).


            If you have found how to solve the problem, please let me know.


            Best,
            Riccardo.