8 Replies Latest reply on Feb 25, 2008 5:53 PM by Wouter Hartog

    Rather simple but doesn't work

    John Wooten Newbie

      I cd'd to my jboss-seam-1.2.1.GA directory and typed:

      seam setup
      then
      seam new-project
      then
      seam explode

      It all appeared to work, to create ear app to access some existing mySQL tables. The console in which JBoss app server was running gave me a dump however with the pertinent lines...

      15:08:46,674 INFO [EARDeployer] Init J2EE application: file:/Applications/jboss-4.0.5.GA/server/default/deploy/seam_queuedb.ear/
      15:08:47,441 ERROR [MainDeployer] Could not create deployment: file:/Applications/jboss-4.0.5.GA/server/default/deploy/seam_queuedb.ear/seam_queuedb.jar/
      org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right xml schema or define a valid DOCTYPE!


      Now, I followed directions so why the failure? Also, I read that the ejb-jar.xml file is OPTIONAL. I followed the instructions, so why is it being asked for and what do I do about it?

        • 1. Re: Rather simple but doesn't work
          Peter Johnson Master

          I suspect that either

          1) You did not install EJB3 into JBoss AS 4.0.5
          2) You have the wrong EJB3 version installed in JBoss AS 4.0.5

          My recommendation is to use JBoss AS 4.2.1.

          • 2. Re: Rather simple but doesn't work
            John Wooten Newbie

            Did check this and confirmed that I did "default" installation. Uninstalled and reinstalled using EJB3 option. This allowed seam gen to create project and deploy it. It created a login page, but when I did the seam generate-entities, it created new classes for accessing the tables, but upon restarting the server, I get an error during startup of
            10:25:57,996 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

            --- MBeans waiting for other MBeans ---
            ObjectName: persistence.units:ear=seam_queuedb.ear,unitName=seam_queuedb
            State: FAILED
            Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: NEXT_ENTRY, expected: tinyblob
            I Depend On:
            jboss.jca:service=DataSourceBinding,name=seam_queuedbDatasource

            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
            ObjectName: persistence.units:ear=seam_queuedb.ear,unitName=seam_queuedb
            State: FAILED
            Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: NEXT_ENTRY, expected: tinyblob
            I Depend On:
            jboss.jca:service=DataSourceBinding,name=seam_queuedbDatasource


            And in the browser,
            Cannot get value for expression '#{queueList.firstResult}'

            How do I "fix" this? For this to be useful, it should handle these automatic generation things correctly.

            • 3. Re: Rather simple but doesn't work
              John Wooten Newbie

              NEXT_ENTRY is a number, BTW

              • 4. Re: Rather simple but doesn't work
                John Wooten Newbie

                Following generated by seam generate-entities
                The name in the table is a string and the other two entries
                are ints, like 9050, and 10 ( this is in MySQL )

                It trys to treat them as Serializeable and fails somehow.
                How do I change this to use integers (i.e. provide the correct mapping)? I would think this would be straightforward for this simple table.

                package com.shoulderscorp.queuedb;
                // Generated Oct 1, 2007 4:04:08 PM by Hibernate Tools 3.2.0.b9

                import java.io.Serializable;
                import javax.persistence.Column;
                import javax.persistence.Entity;
                import javax.persistence.Id;
                import javax.persistence.Table;
                import org.hibernate.validator.Length;
                import org.hibernate.validator.NotNull;

                /**
                * Queue generated by hbm2java
                */
                @Entity
                @Table(name = "queue", catalog = "queue_db")
                public class Queue implements java.io.Serializable {

                private String name;
                private Serializable nextEntry;
                private Serializable entryIncr;

                public Queue() {
                }

                public Queue(String name, Serializable nextEntry, Serializable entryIncr) {
                this.name = name;
                this.nextEntry = nextEntry;
                this.entryIncr = entryIncr;
                }

                @Id
                @Column(name = "NAME", unique = true, nullable = false, length = 32)
                @NotNull
                @Length(max = 32)
                public String getName() {
                return this.name;
                }

                public void setName(String name) {
                this.name = name;
                }

                @Column(name = "NEXT_ENTRY", nullable = false)
                @NotNull
                public Serializable getNextEntry() {
                return this.nextEntry;
                }

                public void setNextEntry(Serializable nextEntry) {
                this.nextEntry = nextEntry;
                }

                @Column(name = "ENTRY_INCR", nullable = false)
                @NotNull
                public Serializable getEntryIncr() {
                return this.entryIncr;
                }

                public void setEntryIncr(Serializable entryIncr) {
                this.entryIncr = entryIncr;
                }

                }

                • 5. Re: Rather simple but doesn't work
                  Peter Johnson Master

                  Sorry, but I don't know that much about Seam. You might want to take this to the Seam forum http://www.jboss.com/index.html?module=bb&op=viewforum&f=231

                  • 6. Re: Rather simple but doesn't work
                    John Wooten Newbie

                    Thanks for hint before about EJB3. that really helped.

                    • 7. Re: Rather simple but doesn't work
                      morten Matras Newbie

                      I have the exact same problem.

                      Jboss 4.2.2 no special setup or configuration.

                      How did you solve the problem?

                      • 8. Re: Rather simple but doesn't work
                        Wouter Hartog Newbie

                        Me too; exact same problem.

                        Curious to know how this got solved...