• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problems deploying an entity bean

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pjoisha
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Men call me Jim. Women look past me to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic