4 Replies Latest reply on Jan 4, 2007 10:05 PM by matt.drees

    dvdstore example on mysql & tomcat

    matt.drees

      I'm fairly new to this, so forgive me if my terminology and/or conclusions are wrong.

      I spent the morning getting the dvdstore example (in jboss-seam-1.1.0.GA) to run using mysql and tomcat/embeddable EJB.

      Some things that got in the way:

      1.
      The example (out of the box, before switching to mysql from hsql) failed to start on tomcat; I got a "javax.naming.NamingException: Local server is not initialized" error. I figured out it was trying to start jbpm (org.jboss.seam.core.jbpm) before ejb (org.jboss.seam.core.ejb). This failed because jbpm initializes hibernate which failed to find the datasource in jndi (it gets bound during ejb initialization).

      So I reordered the component definitions in components.xml, placing <core:ejb.../> before <core:jbpm.../>. This solved it.

      2.
      The import.sql loading failed for 2 reasons. First, mysql apparently interprets

      insert into ACTORS (ID, NAME) values (0, 'Audrey Hepburn')
      as
      insert into ACTORS (NAME) values ('Audrey Hepburn')

      and gives it an id of 1. This causes the second insert to fail the primary key constraint.
      Second, PRODUCTS.TITLE is defined to be a varchar(50) in Product.java, but product 67's title is 59 characters ("The Life Aquatic with Steve Zissou - Criterion Collection ").
      I changed import.sql, replacing Audrey's id of 0 with 68 throughout. I then changed Product.java, line 90 from
      @Column(name="TITLE",nullable=false,length=50)

      to
      @Column(name="TITLE",nullable=false,length=100)

      This solved it.

      With those fixed, it runs fine.

      Should I put one or more of these issues in jira?

      Also, I noticed that (out of the box) the dvdstore tests (which use the Embedded EJB container) correctly load ejb and then jbpm. Why would the behavior be any different on tomcat?

        • 1. Re: dvdstore example on mysql & tomcat

          I've fixed the data issues you mentioned. The title length was an obvious bug, and there is certainly no harm in starting actor ids at 1 instead 1 of 0.

          I just tried and had no problem running the DVD Store on tomcat. I didn't switch to mysql, so that could be a factor. I'll have to play with it a bit as I want to understand the issue rather than just hacking at the config files.

          • 2. Re: dvdstore example on mysql & tomcat

            I switched to mysql and did not encounter any startup issues.

            • 3. Re: dvdstore example on mysql & tomcat
              matt.drees

              I think the issue with starting jbpm before ejb is not as straightforward as I thought. I found that if I switched the order in the config file back to the way it was originally and redeployed, it worked fine. The only way I could reproduce the error was by completely replacing the dvdstore directory with the one from the seam download - starting from scratch.

              I'll try to play more with it to see if I can find specifically which file is causing problems.

              Thanks for updating the demo.

              -Matt

              • 4. Re: dvdstore example on mysql & tomcat
                matt.drees

                Well, nuts. I can't reproduce it at all now. No idea what was different before.

                Nevermind, I guess. Thanks for your time.