Version 52.1 by Florijan Stamenkovic on 2008/06/17 18:51

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 50.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.
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 34.1 9 1. Create a "javaclientbuild.xml" file in the root of your project, with the following as its contents:
10
David Avendasora 28.1 11 {{code}}
David Avendasora 18.1 12
David Avendasora 34.1 13 <project name="javaclient" default="javaclient" basedir=".">
14 <target name="setProps">
15 <property file="${user.home}${file.separator}build.properties"/>
16 <property file="build.properties"/>
17 <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/>
18 <condition property="wo.properties.check.failed">
19 <not>
20 <and>
21 <isset property="wo.wosystemroot"/>
22 <isset property="wo.wolocalroot"/>
23 </and>
24 </not>
25 </condition>
26 <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/>
27 </target>
28 <target name="javaclient" depends="setProps">
29 <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/>
Florijan Stamenkovic 52.1 30 <jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class"
David Avendasora 34.1 31 jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
32 </jar>
33 </target>
34 </project>
Florijan Stamenkovic 52.1 35
David Avendasora 18.1 36 {{/code}}
37
David Avendasora 34.1 38 1. Right-Click on your project, and select Properties.
Florijan Stamenkovic 46.1 39 1. Click on "Builders" on the left side.
40 [[image:Picture 2.png]]
David Avendasora 34.1 41 1. Click the "New" button.
42 1. Select "Ant Build" and click "Okay".
43 1. Name it "Java Client Incremental Builder"
44 1. Under the "Main" tab, click "Browse Workspace".
45 1. Click on your Project, and select the javaclientbuild.xml file you created in step 1, click "Okay".
Florijan Stamenkovic 46.1 46 [[image:Picture 3.png]]
47 1. Under the "Refresh" tab, check "Refresh resources upon completion." and select "The project containing the selected resource"
48 [[image:Picture 4.png]]
49 1. Under the "Targets" tab, set "javaclient" for "After a 'Clean'", "Manual Build" and "Auto Build".
50 [[image:Picture 5.png]]
51 It will show up as "<Default Target Selected>"
52 [[image:Picture 7.png]]
David Avendasora 34.1 53 1. Click okay to close the Builder Properties window.
54 1. Make sure your new Builder is checked and executes AFTER the WOLips Incremental Builder, otherwise it will error.
55 1. Click "Okay" to exit Project Properties.
David Avendasora 30.1 56
David Avendasora 34.1 57 Done. You can now use the Eclipse "Run..." command just as you would for any other WOLips project.