-
1. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
adrian.brock May 1, 2003 10:13 AM (in response to kishore)Remove the / from ejb-name
Regards,
Adrian -
2. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
deepaksumani May 1, 2003 10:53 PM (in response to kishore)Kishore ,
use test_TestEntity instead of test/TestEntity and replace this everywhere with ejb name .
Cheers
Dee -
3. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
sunsphoto Jun 17, 2003 6:29 AM (in response to kishore)Dear,
I face the same problem!
I find that "test/TestEntity" is not appear in the original java. It is by generation.
Have you fix the problems?
Thank you! -
4. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
mmeany Jun 19, 2003 10:25 AM (in response to kishore)I also find this very frustrating. This must be one of the slowest Quick Starts I have tried.
I am new to JBoss and am sure it has lots to offer. I want to get up to speed, but at the moment can't even get started!
What is required is a Quick Start that inspires confidence in the product, not one that leaves the developer baffled and facing the task of fixing the example and suggested Template.
Does anyone have a fixed, buildable, deployable and testable version of the Template that is available for download, email?
Cheers, Mark -
5. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
sundaram Jun 30, 2003 12:24 PM (in response to kishore)I am also having the same problem. Is there any fixed version of example code
-SR -
6. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
admiyo Jul 1, 2003 1:31 PM (in response to kishore)We'll it worked with previous versions of JBoss. The problem is as they try to get JBoss J2EE compliant, they tend to fix things that worked before but should not have. I'm working on a fix right now and will post when I get it working.
-
7. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
admiyo Jul 1, 2003 1:55 PM (in response to kishore)This works:
In TestEntityBean
@ejb:bean name="TestEntity"
In TestSessionBean
* @ejb:ejb-ref ejb-name="TestEntity"
In index.jsp:
TestSessionHome lHome = (TestSessionHome) lContext.lookup(
"ejb/test/TestSession"
);
I am not sure why the java:comp/ prefix doesn't resolve. Anyone know why? -
8. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
eberhaas Jul 8, 2003 8:58 AM (in response to kishore)The fix above didn't work for me. I then got another error during deployment.
I changed from jboss-3.2.0_tomcat-4.1.24 to jboss-3.0.7_jakarta-tomcat-4.1.24.
Now it works. -
9. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
juhalindfors Jul 9, 2003 4:59 AM (in response to kishore)Yes the quick start applies to 3.0.x series only! Not 3.2.x, 4.0.x or anything that has been released after 3.0.x
-
10. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
javapda Jul 10, 2003 7:39 PM (in response to kishore)Juha Lindfors,
Many thanks...I had the same issue as we've all experienced.
In the "Template Project" portion of the JBoss Quick Start it indicates JBoss 3.0 or higher. Your clarification explains things :-) -
11. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
ssjoshi Jul 19, 2003 6:48 AM (in response to kishore)I faced the same problem. However I went ahead to modify the TestEntity*Bean and session beans by hand and with some tweaking in the ejb-jar.xml I got the stuff to deployed on to the Jboss 3.2 server. I got rid of names liek test/TestEntity and simply used TestEntity (same for TestBMPENtity and files in session) . Pulled down the directories entity and session one level down (adjusted the package the file accordingly). Got rid of PackageSubstitution part. REmoved all referenced to test.interfaces ro simply "entity" or "session" as appropriate. Added following section in the ejb-jar.xml for entity bean TestEntity .
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String </method-param>
<method-param>java.lang.String </method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT * FROM TestEntity WHERE First_Name = ?1 AND Last_Name = ?2]]>
</ejb-ql>
<query-method>
<method-name>findAnotherByName</method-name>
<method-params>
<method-param>int </method-param>
<method-param>java.lang.String </method-param>
<method-param>java.lang.String </method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT * FROM TestEntity WHERE Id = ?1 AND First_Name = ?2 AND Last_Name = ?3]]>
</ejb-ql>
Added a method "public java.util.COllection ejbFindAll " to the TestBMPEntityBean.
Howevere once the bean gets deployed a SQL error is given in JBOSS log and "TestEntity" fails to get in "start" phase (others are fine). Following error comes. ANy idea how to get past this (I tried to remove "SELECT * FROM TestEntity" as well as "SELECT *" but did not work)
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT * FROM TestEntity WHERE Id = ?1 AND First_Name = ?2 AND Last_Name = ?3'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "" at line 1, column 77.
Was expecting one of:
"AS" ...
...
)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:53)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:218)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:505)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:410)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:170) -
12. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
juhalindfors Jul 19, 2003 7:20 AM (in response to kishore)Should be SELECT OBJECT(t) FROM TestEntity AS t WHERE First_Name = ?1 AND Last_Name = ?2
-
13. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
ssjoshi Jul 19, 2003 9:05 PM (in response to kishore)Thanks Juha,
With this change and few more I finally got it runnign on JBoss 3.2 . The added changes are as follows
a) (wonder if there is soem directive in ejbdoclet to add following autoatically to ejb-jar.xml for TestEntity)
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String </method-param>
<method-param>java.lang.String </method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(t) FROM TestEntity AS t WHERE t.firstName = ?1 AND t.lastName = ?2]]>
</ejb-ql>
<query-method>
<method-name>findAnotherByName</method-name>
<method-params>
<method-param>int </method-param>
<method-param>java.lang.String </method-param>
<method-param>java.lang.String </method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(t) FROM TestEntity AS t WHERE t.id = ?1 AND t.firstName = ?2 AND t.lastName = ?3]]>
</ejb-ql>
b) Change the lookup (has even lookup mechanism changed between JBoss 3.0 and 3.2) in TestSessionBean and TestEntityBean (basically remove "ejb" from the lookup key [see ejb-jar.xml] )
String lSequenceName = (String) lContext.lookup(
"java:comp/env/SequenceName"
);
SequenceGeneratorHome lHome = (SequenceGeneratorHome) PortableRemoteObject.narrow(
lContext.lookup(
"java:comp/env/ejb/SequenceGenerator"
),
SequenceGeneratorHome.class
);
------------------------
TestEntityHome lHome = (TestEntityHome) PortableRemoteObject.narrow(
lContext.lookup(
"java:comp/env/mytest/TestEntity"
),
TestEntityHome.class
);
c) Add localhomeinterface and localhome directives to the build.xml for ejbdoclet (forgot to post this earlier)
(I also removed the lookup for java:comp/test/env/Mail but it may be unnecessary)
Cheers ...
Shrikant -
14. Re: ERROR: The ejb-name for a CMP2.x Entity must be a valid
juhalindfors Jul 20, 2003 3:51 AM (in response to kishore)> b) Change the lookup (has even lookup mechanism
> changed between JBoss 3.0 and 3.2)
Nope. The private bean ENC lookup name is defined by your ejb-jar.xml file.
Glad you got it working though.
-- Juha