[JBoss Seam] - dvdstore example on mysql & tomcat
by 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?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998079#3998079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998079
19 years, 3 months
[JBoss Seam] - seam-gen problems and solutions
by codelion
Several suggestions listed below.
Using jboss-seam-CVS.20070102.zip, jems-installer-1.2.0.CR1.jar and JBossIDE-2.0.0.Beta2-Bundle-win32.zip.
Following seam_reference.pdf Chapter 2. Getting started with Seam using seam-gen.
In 2.1 it says "add your JBoss installation to the JBoss Server View".
There are two choices, JBoss / JBoss v4.0 and JBoss Inc / JBoss AS 4.0.
Suggestion 1)
Would be nice if documentation says which to use.
I pick JBoss Inc / JBoss AS 4.0.
In 2.2 it says "add the project using New -> Project... -> Java Project." The leads to a problem for me. (Some error message about a directory.)
So I try "New -> Project... -> Java Project for Existing Ant Buildfile". That almost works.
Suggestion 2)
If correct, please say "New -> Project... -> Java Project for Existing Ant Buildfile".
There is still a problem. In build.xml (the last delete task in target "clean") ... myproject/exploded-archives/myproject.jar not found. The problem persists through attempts to build and clean.
When I run ant from the command line I get som success. It deploys.
The root cause appears in target "clean" the last delete with the fileset not finding the dir of the fileset.
Suggestion 3)
In target name="clean" for the last delete add a failonerror="no".
Still more problems... I find out things are done differently within versus outside Eclipse.
So when I run ant outside Eclipse it deploys (by target "deploy") a file myproject.ear, when I run ant inside Eclipse it deploys (by target "explode") a directory myproject.ear.
In target "unexplode" the delete of ear.deploy.dir fails if it encounters the file.
My workaround hopefully will be to clean or undeploy or unexplode with ant from outside Eclipse if I deployed (or exploded) from outside Eclipse, and from inside if from inside.
Suggestion 4)
Document that command line and Eclipse deployment don't mix. Reason: One uses archive files, the other uses exploded directories, which makes Ant tasks choke if they collide. Workaround: Must undeploy one (command line or Eclipse) before deploying the other. After deploy must undeploy, after explode must unexplode.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998076#3998076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998076
19 years, 3 months