Question

I'm wrapping my usage of the Opscode Java cookbook with one for my company.

I've created an attributes\default.rb file with values specific to my usage.

Despite including a value for the windows package, I keep getting the following error:

NoMethodError
------------- 
No resource or method named `windows_package' for `Chef::Recipe "windows"'

Here is my attributes\default.rb file:

default[:java][:install_flavor] = "windows"
default[:java][:jdk_version] = "7"
default[:java][:windows][:url] = "http"
default[:java][:windows][:package_name] = "Java VM"

I am certain that I have uploaded the updated cookbook to my server, and I am certain that the attributes in this file are being loaded as I was previously receiving errors about missing the required windows package URL until I added it (path edited out above).

Was it helpful?

Solution

In the windows recipe of the Java cookbook, there is a call to the windows_package provider of the windows Cookbook. Thus, the windows cookbook is required for the Java cookbook at least on your platform.

As the Java cookbook doesn't explicitly depend on the windows cookbook (through the metadata.rb), it fails at this late stage.

The solution is to add the windows cookbook to your run list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top