Friday 16 January 2009

Change a JHeadstart Workspace for another Jdeveloper Setup on Windows

Aonther problem I ran into in my latest JHeadstart project was that I'm using Linux on my laptop. So all the paths to libraries in my JDeveloper environment are following my setup under Linux. All of my co-workers on the project use Windows. I know, I said it earlier, I'm somewhat stubborn in this.

In the JHeadstart developers guide is stated that in a multi-developer-JHeadstart-project you should ensure that all the developers have the same Developer setup. In my case I turned out to be the only developer on this sub-project. But leaving the project others should be able to go further with it.

So I started my Windows Virtual Machine and took the time to setup a JDeveloper, Tortoise SVN client, download the Working copy of the workspace from SVN. That took me most of the time. Changing the workspace then was done in about a quarter.

JDeveloper Startup Path

JHeadstart and JDeveloper have absolute paths to libraries in the projects. It turns out to be quite handy to have all team members the same path to the libraries (as stated in the JHeartart Developers Guide). To enable that without the need to have each member physically install JDeveloper and the workingcopy of SVN in to the same directory, I crated a batch-file that creates two drives that map to the physical location.

I named the file drives.bat. It sets the s: drive to the folder that contains the trunk folder of your working copy and the w: drive to the home directory of jdeveloper (the root folder that contains the jdeveloper.exe):
subst s: e:\svn
subst w: e:\oracle\product\jdeveloper

Create a shortcut to the jdeveloper.exe on w:\ and start jDeveloper from that shortcut.
Install JHeadstart if not done allready:
In Jdeveloper goto Help=>Check for upates
Click next and choose install from local file.
Choose JHS10.1.3.3.85-INSTALL.ZIP and finisch the wizard.

Edit custom library
I used BPEL libraries because I needed to kickstart a BPEL process from a button in one of the screens. This library turned invalid since it could not find the jar-files following the original paths.
In Model Project properties goto libraries. Edit your custom OraBPEL Library. In my case I added the entries:
  • W:\integration\lib\orabpel-boot.jar
  • W:\integration\lib\orabpel-common.jar
  • W:\integration\lib\orabpel-thirdparty.jar
  • W:\integration\lib\orabpel.jar
  • W:\j2ee\home\lib\ejb.jar
  • W:\j2ee\home\oc4jclient.jar
Rebuild the Application
Right click on the ViewController project and run Jheadstart Application Generator (JAG). The JAG will change the paths to the JHeadstart libraries according to the startup path of Jdeveloper.

Recompile the Model and the ViewController project.

This ensures you that the changes are applied correctly and the code compiles correctly. Now you can deploy it to your App-server and you should be able to run it using the Embedded OC4J server.

Run the ViewController project
If you add an appropriate ConnectionPool and DataSource in the Embedded OC4J Server (You can do that via Tools => Embedded OC4J Preferences) then you’ll be able to run the SchedulerUI in the Embedded OC4J. If you do so then you're sure the workspace is correct again.

No comments :