(Answer) (Category) FAQ-O-Matic : (Category) JBuilder 6 General :
How do I use JBuilder to migrate EJB 1.1 beans to EJB 2.0?
Paul D. Brown writes:

Try following these steps:

1. Rename any methods in your session beans that may be mistaken for getter/setter methods of any fields in those session beans (otherwise the EJB designer screws up your code - we had one example where the ordering of two lines of code were reversed, with one statement being moved to the line after the return).

2. Recompile project.

3. Take a copy of your project - both for emergencies and because you will need to cut & paste from it later.

4. Use the Deployment descriptor (DD) migration wizard in the app server console to migrate your DDs from J2EE 1.2 to 1.3, saving the generated jar.

5. In your project, delete the existing EJB group (ejbgrp) files.

6. In your project, create a new EJB module.

7. Cut & paste the XML from the deployment descriptors generated by the console migration wizard (see point 4 above) into the "DD source" of your new EJB module.

8. Manually edit the new XML Deployment descriptors to remove any mention of the entity beans (remove everything in the each of the entity tags).

9. Import a database schema into the EJB designer.

10. From the lower left pane in JBuilder, right click on a table and choose 'create new entity bean', overwriting the existing bean in the process (hence the backup in step 3).

11. Use the tools in the EJB designer to set properties, etc for that bean.

12. Cut & paste any code from your original entity beans from the copy of your project that you made in step 3. Be sure to press save on a regular basis - it seems to reduce the chances of JBuilder deleting or rejigging your code.

13. Repeat steps 10-12 for each of the entity beans in your project. This should put the entity beans into your deployment descriptors.

I haven't mentioned BMP beans - I guess you just manually edit the XML of the DD.

Throughout and afterwards, you should be vey wary of the EJB designer changing your code. I look forward to Borland releasing a patch to the EJB designer shortly (an EJB migration wizard would also be useful).

PS: If you have a multiple field primary key, don't change the class from that generated by the EJB designer or it sends its code generator into overdrive - we had it put the same class defintion into the file that it wanted to use 3 times aswell as the code from the primary key class that we had produced ourselves.

2002-Jan-09 8:42am gyles19@visi.com

Kevin Dean writes:

You can simplify steps 6 and 7 by using the "Create EJB Module From Descriptors" wizard and selecting the converted descriptors.

Another thing to beware of when hand-rolling the XML is that, if you make a mistake that violates the DTD in some way, the EJB designer may still look like it's parsing the files but you'll start to see some really weird behaviour between the designer and the code (code not being generated is the most frequent problem we found).

To determine if the XML is parsing correctly, install JBLogger from http://www.jpmcgrath.net/opentools/jblogger/, start the log, and watch the output as you open the EJB group and move around. It took us a week before we figured out that we had messed up the XML and the JBuilder was NOT reporting any error.

2002-Jan-11 6:35am gyles19@visi.com

[Append to This Answer]
2002-Jan-11 6:35am
Previous: (Answer) JB6's CVS Checkin/Checkout isn't updating jpx files. Is this a bug, or a feature?
Next: (Answer) I want to use JNDI naming in Tomcat4, but JBuilder 6 turns it off. How can I turn naming back on?
This document is: http://www.visi.com/~gyles19/cgi-bin/fom.cgi?file=324
[Search] [Appearance]
This is a Faq-O-Matic 2.709.
This FAQ administered by gyles19@visi.com.

Other JBuilder Links

Java Community
Java Tools
Code Central
JB OpenTools
Community
Recent
Threads
Borland Chat
Chat FAQ
Feature Matrices
3.0 |  3.5 |  4.0
5.0 |  6.0 |  7.0
Shop for
JBuilder
JBuilder
Downloads
and reg keys
Report Piracy
Online Manuals
4.0 |  5.0 |  6.0
7.0
Borland
DevSupport's
Bug/RFE Form

Quality Central Client
JB Patches &
Updates
JBuilder FAQs TIs
JBuilder
Newsgroups
Tamaracka's
News Archive
Mr. Haki's
JBuilder Machine
JGuru's
JBuilder FAQ
Sun's Bug
Parade
Netring Home - About - Privacy
The
JBuilder Netring Logo
The Borland JBuilder Netring by JBuilder FAQ-O-Matic
[ Join Now | List Sites | Random | << Prev | Next >> ]
[ Previous 5 Sites | Skip Previous | Skip Next | Next 5 Sites ]