code has no resources but signature indicates they must be present?

I'm trying to follow the instructions provided by Oracle for packaging a Java App for distribution on a Mac.

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

I'm using a Mac running OS 10.11.6. Everything works fine until I get to the code signing step. After scouring the net I have created the following Ant script snippet.

<property name="MyApp.app" location="dist/ButtonDemo.app"/>

<property name="jdk" value="jdk1.8.0_101.jdk"/>

<exec executable="chmod">

<arg line="-R a+w ${MyApp.app}"/>

</exec>

<apply executable="codesign">

<arg line="-f -s 'Developer ID Application: MyName'"/>

<fileset dir="${MyApp.app}/Contents/PlugIns/${jdk}" />

</apply>

<exec executable="codesign">

<arg line="-f -s 'Developer ID Application: MyName' ${MyApp.app}"/>

</exec>

<!-- verify codesign -->

<exec executable="codesign" failonerror="true">

<arg line="-d --verbose=4 --strict ${MyApp.app}"/>

</exec>

<!-- verify gatekeeper -->

<exec executable="spctl" failonerror="true">

<arg line="--assess --verbose=4 --type execute ${MyApp.app}"/>

</exec>

I get the following output.

clean:

[delete] Deleting directory /Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app

bundle-buttonDemo:

[bundleapp] Creating app bundle: ButtonDemo

sign:

[exec] Executable=/Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app/Contents/MacOS/JavaAppLauncher

[exec] Identifier=components.ButtonDemo

[exec] Format=app bundle with Mach-O thin (x86_64)

[exec] CodeDirectory v=20200 size=341 flags=0x0(none) hashes=5+3 location=embedded

[exec] Hash type=sha256 size=32

[exec] CandidateCDHash sha1=8e4ec99904729d3faf45b8d5f26048d16a9f11c5

[exec] CandidateCDHash sha256=1feeb3eb8479ddfdf25e09cc5660e992f52bda06

[exec] Hash choices=sha1,sha256

[exec] CDHash=1feeb3eb8479ddfdf25e09cc5660e992f52bda06

[exec] Signature size=8919

[exec] Authority=Developer ID Application: MyName (XXXX)

[exec] Authority=Developer ID Certification Authority

[exec] Authority=Apple Root CA

[exec] Timestamp=Sep 13, 2016, 2:47:41 AM

[exec] Info.plist entries=16

[exec] TeamIdentifier=XXXX

[exec] Sealed Resources version=2 rules=12 files=4

[exec] Internal requirements count=1 size=184

[exec] /Users/mike/ButtonDemo/components-ButtonDemoProject/dist/ButtonDemo.app: code has no resources but signature indicates they must be present

BUILD FAILED

/Users/mike/ButtonDemo/components-ButtonDemoProject/build.xml:46: exec returned: 1

A simple check of the application bundle at dist/ButtonDemo.app/Contents/Resources shows that there are resources. Why do I get this error?

FWIW, I am embarrassed to say that I made things much more difficult than they had to be. Simply codesigning the jdk plug-in before signing the application itself is needed. This is the only change needed to make the ButtonDemo.app work.

code has no resources but signature indicates they must be present?
 
 
Q