Last modified by David Avendasora on 2009/02/05 17:10

Hide last authors
David Avendasora 50.1 1 There are many ways you can deploy WebObjects JavaClient applications. One of the ways to do it is through WebStart. You could manually create a WebStart app, but WebObjects can also do it for you, taking care of JNLP creation, jar organization, and many WebStart nasty bits.
David Avendasora 18.1 2
David Avendasora 54.1 3 There is a problem however. The WOLips incremental builder will not automatically create the required jar of your client-side classes and place it in the project.woa/Contents/WebServerResources/Java/ directory as is required by a WebObjects WebStart Java Client application.
David Avendasora 50.1 4
David Avendasora 34.1 5 Without the client classes placed in WebServerResources, Eclipse's built-in Run... command will not work properly as the client application will not have access to its classes and WebObjects will silently fall-back to EOGenericRecord. This causes the confusing condition of the application launching and likely not generating any errors, but not working correctly either.
David Avendasora 18.1 6
David Avendasora 34.1 7 Below are the steps for adding an additional "Ant Builder" to your project to generate and place the required jar in the right location.
David Avendasora 18.1 8
David Avendasora 54.1 9 1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents:
10 1. {{code 0="xml"}}
David Avendasora 34.1 11 <project name="javaclient" default="javaclient" basedir=".">
12 <target name="setProps">
David Avendasora 54.1 13 <property file="${user.home}${file.separator}build.properties" />
14 <property file="build.properties" />
15 <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties" />
David Avendasora 34.1 16 <condition property="wo.properties.check.failed">
17 <not>
David Avendasora 54.1 18 <and>
19 <isset property="wo.wosystemroot" />
20 <isset property="wo.wolocalroot" />
21 </and>
22 </not>
23 </condition>
24 <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed" />
David Avendasora 34.1 25 </target>
26 <target name="javaclient" depends="setProps">
David Avendasora 54.1 27
28 <!-- project client-side classes -->
29 <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java" />
30 <jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class" jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
David Avendasora 34.1 31 </jar>
Florijan Stamenkovic 52.1 32
David Avendasora 54.1 33 <!-- Launch Scripts and WOBootstrap.jar -->
34 <mkdir dir="build/${project.name}.woa/Contents/MacOS" />
35 <mkdir dir="build/${project.name}.woa/Contents/UNIX" />
36 <mkdir dir="build/${project.name}.woa/Contents/Windows" />
David Avendasora 18.1 37
David Avendasora 54.1 38 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh" tofile="build/${project.name}.woa/Contents/${project.name}" />
39 <chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx" />
40 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" tofile="build/${project.name}.woa/Contents/${project.name}.CMD" />
41 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD" />
42 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar" tofile="build/${project.name}.woa/Contents/WOBootstrap.jar" />
43
44 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh" tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" />
45 <chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx" />
46 <copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt" />
47
48 <!-- D2JC only -->
49 <copy file="user.d2wmodel" tofile="build/${project.name}.woa/Contents/Resources/user.d2wmodel" />
50
51 </target>
52 </project>{{/code}}Right-Click on your project, and select Properties.
53 1. Click on "Builders" on the left side.
54 [[image:attach:Picture 2.png]]
David Avendasora 34.1 55 1. Click the "New" button.
56 1. Select "Ant Build" and click "Okay".
57 1. Name it "Java Client Incremental Builder"
58 1. Under the "Main" tab, click "Browse Workspace".
59 1. Click on your Project, and select the javaclientbuild.xml file you created in step 1, click "Okay".
David Avendasora 54.1 60 [[image:attach:Picture 3.png]]
Florijan Stamenkovic 46.1 61 1. Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource"
David Avendasora 54.1 62 [[image:attach:Picture 4.png]]
63 1. Under the "Targets" tab, set "javaclient" for "After a 'Clean'", "Manual Build" and "Auto Build".
64 [[image:attach:Picture 5.png]]
Florijan Stamenkovic 46.1 65 It will show up as "<Default Target Selected>"
David Avendasora 54.1 66 [[image:attach:Picture 7.png]]
David Avendasora 34.1 67 1. Click okay to close the Builder Properties window.
68 1. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error.
69 1. Click "Okay" to exit Project Properties.
David Avendasora 30.1 70
David Avendasora 34.1 71 Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project.