Java Client-WebStart Distribution Building
Version 21.1 by David Avendasora on 2008/07/17 07:54
Your deployed WebStart-distributed application must have a jar of all the client-side classes (and any subclasses of EOGenericRecord that your client-classes extend) in the Project.woa/Contents/WebServerResources/Java/ directory. If you don't include a jar of your client-side classes in this directory, WebObjects silently uses EOGenericRecord instead. This is made obvious by things like default values, client-side validation and other client-side logic not working in the deployed application.
The following are the instructions when using Ant to build:
- Add the following "javaclient" target to your build.xml file.
<target name="javaclient">
<mkdir dir="${dest.dir}/${project.name}.woa/Contents/WebServerResources/Java"/>
<jar basedir="${classes.dir}" includes="**/client/**/*.class,**/common/**/*.class"
jarfile="${dest.dir}/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
</jar>
<!-- project user.d2wmodel file (D2JC only) -->
<copy file="user.d2wmodel" tofile="${dest.dir}/${project.name}.woa/Contents/Resources/user.d2wmodel"/>
</target>
- Make the "build" and "install" targets depend upon "javaclient" just prior to the "ssdd" target.
<target name="build" depends="setProps,init.build,build.woapp,javaclient,ssdd,war" />
<target name="install" depends="setProps,init.install,build.woapp,javaclient,ssdd,war" />
- If you are using any Frameworks that have client-side jars then you'll need to copy those jars over to the WebServerResources/Java directory as well. Because I don't want to go modifying any of the woproject files, I just copy the client-side jars of all my Local frameworks (Library/Frameworks/) into my app. Ideally it would only copy over the ones for the frameworks actually in the build path, but this works for now. I'll re-address it after the upcoming classpath changes to be rolled into WOLips.
<!-- the Java Client Client-Side Classes -->
<copy todir="${dest.dir}/${project.name}/WEB-INF/${project.name}.woa/Contents/WebServerResources/Java">
<fileset dir="${wo.wolocalroot}/Library/Frameworks">
<include name="**/WebServerResources/Java/*.jar"/>
</fileset>
<mapper type="flatten"/>
</copy>