Tuesday 12 May 2009

8-How to Develop Container-Managed-Relationships


Unable to deploy EJB: OrderARSLineItemEJB from CMRent.jar:

[EJB:011076]Unable to deploy the EJB 'OrderARSLineItemEJB' because the database
table 'orderlineitems' is not accessible. Please ensure that this table exists a
nd is accessible.

This killed me.. I had put an extra ‘ ‘ before the name of my MySQL table orders…
………………………………………..
[EJB:011019]While reading META-INF/weblogic-cmp-rdbms-jar.xml, the persistence l
ayer of the Entity EJB failed to deploy. The error was:
Error in descriptor line 50: Error parsing file at line: 50 column: 25. org.xm
l.sax.SAXParseException: The content of element type "weblogic-rdbms-bean" must
match "(ejb-name,data-source-name,table-map+,field-group*,relationship-caching*,
weblogic-query*,delay-database-insert-until?,use-select-for-update?,lock-order?,
automatic-key-generation?,check-exists-on-method?)"..

You get this message if you play with certain field and delete them from
weblogic-cmp-rdbms-jar.xml
……………………………………..
C:\CMRentity>ant run
Buildfile: build.xml

copy-resources:

compile:

run:
[java] JVM args ignored when same JVM is used.
[java] Starting Client . . .

[java] Looking up the order home via JNDI.

[java] Created a new order:1242066381187 .

[java] Adding some line items to the order.

[java] Retrieving line items of the order.

[java] java.rmi.RemoteException: BEA1-001045C3303C9E472B1E; nested exceptio
n is:
[java] javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrappe
r.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Connect
ion has been administratively destroyed. Reconnect.))
...
The first time I ran the final program it gave these messages. When I ran it again
İt was OK, it may be related to two extra records in the ordrs table which did not have any
Line items???
………………………………………………….
C:\CMRentity>ant run
Buildfile: build.xml

copy-resources:

compile:

run:
[java] JVM args ignored when same JVM is used.
[java] Starting Client . . .

[java] Looking up the order home via JNDI.

[java] Created a new order:1242067364140 .

[java] Adding some line items to the order.

[java] Retrieving line items of the order.

[java] Item id:1242067364578 Course id:3 Fee:300.0
[java] Item id:1242067364312 Course id:1 Fee:200.0
[java] Item id:1242067364484 Course id:2 Fee:300.0
[java] Removing order:1242067364140 .


BUILD SUCCESSFUL
Total time: 8 seconds
C:\CMRentity>
This was the final output of my program, an instance of TINTPB’s.
My appreciations go to her.