wood burning stoves*
The moose likes Websphere and the fly likes Problems deploying an entity bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Problems deploying an entity bean" Watch "Problems deploying an entity bean" New topic
Author

Problems deploying an entity bean

pjoisha
Ranch Hand

Joined: Mar 06, 2001
Posts: 123
Hi,
When I try to run ejbDeploy (via ANT build.xml)
I get an error to the affect that deploy tool
is not recognizing the "id" field in my VehiclePK
class as one of the attributes from VehicleBean
class. It somehow thinks the hashCode field
in VehiclePK class constitutes one of the
keys. In my VehiclePK class I see the "id"
field public and hashCode private. What am I
doing wrong? I have a feeling one my xmi files
is not telling the whole truth to the ejbDeloy.bat
Here's the transcript from ant .....
Buildfile: build.xml
init:
[echo] Build of ejb started at 1216 on March 18 2002
compile:
[echo] Compiling ejb
[mkdir] Created dir: D:\work\cameo\dev\WAS\RentACar\Iteration3\build\ejb
[javac] Compiling 11 source files to D:\work\cameo\dev\WAS\RentACar\Iteration3\build\ejb
[echo] Finished compiling ejb
package:
[echo] Packaging ejb
[jar] Building jar: D:\work\cameo\dev\WAS\RentACar\Iteration3\modules\RentACar-ejb.jar
deploy:
[echo] Deploying EJB JAR file
[exec] [*Error] /RentACar-ejb.jar: CHKJ2205E: The primary key field hashCode
declared in key class rental.ejb.entity.VehiclePK for enterprise bean
Vehicle is not public. Read section 9.4.7.2 of the EJB 1.1 specification for details.
[exec] [*Error] /RentACar-ejb.jar: CHKJ2206E: The primary key field hashCode
declared in primary key class rental.ejb.entity.VehiclePK uses an
unknown name. The names of the fields in rental.ejb.entity.VehiclePK
must be a subset of the names of the fields in Vehicle. Read section
9.4.7.2 of the EJB 1.1 specification for details.
[exec]
[exec] Execution Halted: Validation Errors Reported
[exec] 2 Errors, 0 Warnings, 0 Informational Messages
[move] Could not find file D:\temp\RentACar-ejb.jar to copy.
BUILD FAILED
D:\work\cameo\dev\WAS\RentACar\Iteration3\src\ejb\build.xml:65: Could not find file D:\temp\RentACar-ejb.jar to copy.
Total time: 30 seconds

Thanks for ur help,
PJ
[ March 18, 2002: Message edited by: Prashanth Joisha ]
Simon Song
Ranch Hand

Joined: Feb 01, 2002
Posts: 217
Use Application Assembly Tool/AAT in WebSphere to verify your ejb jar first. And you may have to post your ejb-jar.xml here, maybe there is some wrong specification in it.


Simon Song
Certified Entperise Developer of Websphere
pjoisha
Ranch Hand

Joined: Mar 06, 2001
Posts: 123
Hi Simon,
Appreciate your quick response.
Here's a little background on what I have been
trying to accomplish:
From a tutorial on websphere.com, I have
been trying to deploy some session + entity beans.
I have been successful in doing so using AAT
and Admin console. However, along with learning
the mechanics of xml and xmi descriptors, my
primary objective is to develop command line
scripts (using ANT) using the skeleton deployment
descriptors (all xml/xmi files) generated by AAT
and this where I'm failing. The build scripts
have worked all along and starts to fail
when I add this CMP Bean (my point here is that
there is nothing wrong with the script)

My Deployed_RentACar.ear (generated by AAT) works
just fine under WAS AEs4.0.1. I now take the
xml/xmi files (that was generated by AAT) and
copy them over to my build directory, build my
ejb jar with them and then run ejbdeploy (via
ANT) and this is when I get that error.
My ejb-jar.xml looks like this ...

Thanks a lot for ur help,
PJ
[ March 19, 2002: Message edited by: Prashanth Joisha ]
Simon Song
Ranch Hand

Joined: Feb 01, 2002
Posts: 217
bad thing in the new XMI based deployment is it is not for human read. It is more suited for machine.
So xmi relies on the extra ID in the xml tag property to associate definitions, you have to be extremely careful.
I have no idea how to define xmi outside of AAT...
pjoisha
Ranch Hand

Joined: Mar 06, 2001
Posts: 123
Thanks for your response.
I happened to resolve the problem. It had to do
with my PK class. It had a declaration to the
effect
private int hashCode = -1;
which I guess is not inline with the
specifications (atleast according to the
EJBDeploy.bat). Commenting this out lead
to a successful install via SEAppInstall.
I need to reread the EJB book to understand
this concept.
Thanks,
PJ

PS: As a side, yeah xmi by itself is pretty
complex without documentation (but that
article by Kyle Brown unravels some of the
mysteries). However, AAT also generates the
xml files which can be tinkered with a text
editor.
[ March 20, 2002: Message edited by: Prashanth Joisha ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems deploying an entity bean
 
Similar Threads
deployment descriptor (ejb-jar.xml) problem
Getting error - Chapter 4 of Ejb3 in action using glassfish server 2.1
creating ejb-jar.xml ??
Getting Error:- Chapter 3 of EJB 3 in action using glassfish server 2.1
Getting error chapter 8 of Ejb 3 in action using glassfish server 2.1