Please update the 3.0 Template and Examples for JBoss 3.2
gil Aug 7, 2003 7:08 AMProblem:
When using JBoss 3.0 Template And Examples on JBoss 3.2, the sample app "template" fails to deploy, with various cryptic errors.
This is a major pain for new JBoss users. Most newbies work through the QuickStart document
to learn the ropes. Since QuickStart-30x is the only startup document in town, many, like me, have run straight into this quagmire, and wasted hours/days troubleshooting the sample files (see details below).
This creates a bad impression of JBoss, and inspires no confidence in new users. But it could be solved by releasing an updated template/examples package that works with JBoss 3.2.
In the short term, a warning message should be added to the QuickStart document - "the 3.0 example code will not work with JBoss 3.2 and above".
Here are some more details about the problem, and how to fix it.
Typical deployment error messages:
"Error in ejb-jar.xml for Entity Bean test/TestEntity: The ejb-name for a CMP2.x Entity must be a valid Java Identifier"
"Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor."
Fix:
1. edit TestEntityBean.java, modifying @ejb:bean and @ejb:ejb-ref tags
remove the illegal "test/" prefix, eg.
@ejb:bean name="test/TestEntity" becomes
@ejb:bean name="TestEntity"
[note 1: leave the jndi-name attributes alone]
[note 2: repeat this step for all the example beans (entity/*.java, message/*.java & session/*.java)]
2. modify the TestEntityBean.java finder tags
delete the @ejb:finder and @jboss:finder-query tags, and replace with the following:
* @ejb:finder signature="java.util.Collection findAll()"
*
* @ejb:finder signature="test.interfaces.TestEntity findByName( java.lang.String pSurname, java.lang.String pLastName )"
* query="SELECT OBJECT(t) FROM TestEntity t WHERE t.firstName = ?1 AND t.lastName = ?2"
*
* @ejb:finder signature="test.interfaces.TestEntity findAnotherByName( int pId, java.lang.String pSurname, java.lang.String pLastName )"
* query="SELECT OBJECT(t) FROM TestEntity t WHERE t.id <> ?1 AND t.firstName = ?2 AND t.lastName = ?3"
*
3. modify the TestEntityBean.java @ejb:ejb-ref tag (the 2nd line is missing, causing run-client to fail)
* @ejb:ejb-ref ejb-name="SequenceGenerator"
* ref-name="ejb/test/SequenceGenerator"
4. rebuild
Other Forum Ref: http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=