# Error running application\_java

**URL:** <https://discourse.chef.io/t/error-running-application-java/4796>\
**Category:** Chef Infra (archive)\
**Created:** [December 12, 2013, 8:40pm UTC](https://discourse.chef.io/t/error-running-application-java/4796 "2013-12-12T20:40:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Nichols](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Mark\_Nichols](https://discourse.chef.io/u/Mark_Nichols)\
**Post date:** [December 12, 2013, 8:40pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/1 "2013-12-12T20:40:43Z")

</div>

Good afternoon,

I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:

# ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb

## NameError

uninitialized constant Chef::DSL

## Cookbook Trace:

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file’

## Relevant File Content:

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:

1: #  
2: # Cookbook Name:: application\_java  
3: # Provider:: java\_webapp  
4: #  
5: # Copyright 2012, ZephirWorks  
6: #  
7: # Licensed under the Apache License, Version 2.0 (the “License”);  
8: # you may not use this file except in compliance with the License.  
9: # You may obtain a copy of the License at

[2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
[2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
[2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
[2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL

Here is my recipe:

include\_recipe “application\_java”

application ‘credit-card-webapp’ do  
path '/usr/local/creditcardapp’  
repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)’  
scm\_provider Chef::Provider::RemoteFile::Deploy

end

tomcat  
end

Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.

Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [December 12, 2013, 9:03pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/2 "2013-12-12T21:03:03Z")

</div>

What version of Chef are you using?

--Noah

On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:

> Good afternoon,
> 
> I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> 
> # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> 
> ## NameError
> 
> uninitialized constant Chef::DSL
> 
> ## Cookbook Trace:
> 
> /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> 
> ## Relevant File Content:
> 
> /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> 
> 1: #  
> 2: # Cookbook Name:: application\_java  
> 3: # Provider:: java\_webapp  
> 4: #  
> 5: # Copyright 2012, ZephirWorks  
> 6: #  
> 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> 8: # you may not use this file except in compliance with the License.  
> 9: # You may obtain a copy of the License at
> 
> [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> 
> Here is my recipe:
> 
> include\_recipe "application\_java"
> 
> application 'credit-card-webapp' do  
> path '/usr/local/creditcardapp'  
> repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> scm\_provider Chef::Provider::RemoteFile::Deploy
> 
> end
> 
> tomcat  
> end
> 
> Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([chef - [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> 
> Thanks,  
> Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Nichols](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Mark\_Nichols](https://discourse.chef.io/u/Mark_Nichols)\
**Post date:** [December 12, 2013, 9:36pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/3 "2013-12-12T21:36:14Z")

</div>

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:

> What version of Chef are you using?

11.8.0

— Mark

> --Noah
> 
> On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> 
> > Good afternoon,
> > 
> > I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> > 
> > # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> > 
> > ## NameError
> > 
> > uninitialized constant Chef::DSL
> > 
> > ## Cookbook Trace:
> > 
> > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> > 
> > ## Relevant File Content:
> > 
> > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> > 
> > 1: #  
> > 2: # Cookbook Name:: application\_java  
> > 3: # Provider:: java\_webapp  
> > 4: #  
> > 5: # Copyright 2012, ZephirWorks  
> > 6: #  
> > 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> > 8: # you may not use this file except in compliance with the License.  
> > 9: # You may obtain a copy of the License at
> > 
> > [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> > [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> > [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> > 
> > Here is my recipe:
> > 
> > include\_recipe "application\_java"
> > 
> > application 'credit-card-webapp' do  
> > path '/usr/local/creditcardapp'  
> > repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> > scm\_provider Chef::Provider::RemoteFile::Deploy
> > 
> > end
> > 
> > tomcat  
> > end
> > 
> > Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([chef - [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> > 
> > Thanks,  
> > Mark

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [December 12, 2013, 9:39pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/4 "2013-12-12T21:39:25Z")

</div>

How sure are you of that? That module was added in Chef 11 and is definitely present in 11.8.0 ([https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include\_recipe.rb#L23](https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include_recipe.rb#L23)) so usually that error stems from using Chef 10.x :-/

--Noah

On Dec 12, 2013, at 1:36 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:

> On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> 
> > What version of Chef are you using?
> 
> 11.8.0
> 
> — Mark
> 
> > --Noah
> > 
> > On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > 
> > > Good afternoon,
> > > 
> > > I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> > > 
> > > # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> > > 
> > > ## NameError
> > > 
> > > uninitialized constant Chef::DSL
> > > 
> > > ## Cookbook Trace:
> > > 
> > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> > > 
> > > ## Relevant File Content:
> > > 
> > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> > > 
> > > 1: #  
> > > 2: # Cookbook Name:: application\_java  
> > > 3: # Provider:: java\_webapp  
> > > 4: #  
> > > 5: # Copyright 2012, ZephirWorks  
> > > 6: #  
> > > 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> > > 8: # you may not use this file except in compliance with the License.  
> > > 9: # You may obtain a copy of the License at
> > > 
> > > [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> > > [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> > > [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> > > 
> > > Here is my recipe:
> > > 
> > > include\_recipe "application\_java"
> > > 
> > > application 'credit-card-webapp' do  
> > > path '/usr/local/creditcardapp'  
> > > repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> > > scm\_provider Chef::Provider::RemoteFile::Deploy
> > > 
> > > end
> > > 
> > > tomcat  
> > > end
> > > 
> > > Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([chef - [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> > > 
> > > Thanks,  
> > > Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Nichols](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Mark\_Nichols](https://discourse.chef.io/u/Mark_Nichols)\
**Post date:** [December 12, 2013, 10:17pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/5 "2013-12-12T22:17:13Z")

</div>

--  
mark nichols | (t|a.n) @zanshin | (w) [zanshin.net](http://zanshin.net) | (gpg key) 53445200

On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:

> How sure are you of that?

Good question. I created a cookbook using `berks cookbook` and I’m testing the new recipe through Vagrant. Maybe the Chef environment isn’t 11.x as a result of my method. The VM isn’t coming up, so I can’t see what Chef looks like there. I’m new to all of this, so I’m stumbling around in the dark trying to figure out what’s what.

—  
Mark

> That module was added in Chef 11 and is definitely present in 11.8.0 ([https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include\_recipe.rb#L23](https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include_recipe.rb#L23)) so usually that error stems from using Chef 10.x :-/
> 
> --Noah
> 
> On Dec 12, 2013, at 1:36 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> 
> > On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> > 
> > > What version of Chef are you using?
> > 
> > 11.8.0
> > 
> > — Mark
> > 
> > > --Noah
> > > 
> > > On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > > 
> > > > Good afternoon,
> > > > 
> > > > I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> > > > 
> > > > # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> > > > 
> > > > ## NameError
> > > > 
> > > > uninitialized constant Chef::DSL
> > > > 
> > > > ## Cookbook Trace:
> > > > 
> > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> > > > 
> > > > ## Relevant File Content:
> > > > 
> > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> > > > 
> > > > 1: #  
> > > > 2: # Cookbook Name:: application\_java  
> > > > 3: # Provider:: java\_webapp  
> > > > 4: #  
> > > > 5: # Copyright 2012, ZephirWorks  
> > > > 6: #  
> > > > 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> > > > 8: # you may not use this file except in compliance with the License.  
> > > > 9: # You may obtain a copy of the License at
> > > > 
> > > > [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> > > > [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> > > > [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > > [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> > > > 
> > > > Here is my recipe:
> > > > 
> > > > include\_recipe "application\_java"
> > > > 
> > > > application 'credit-card-webapp' do  
> > > > path '/usr/local/creditcardapp'  
> > > > repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> > > > scm\_provider Chef::Provider::RemoteFile::Deploy
> > > > 
> > > > end
> > > > 
> > > > tomcat  
> > > > end
> > > > 
> > > > Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([chef - [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> > > > 
> > > > Thanks,  
> > > > Mark

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [December 12, 2013, 11:07pm UTC](https://discourse.chef.io/t/error-running-application-java/4796/6 "2013-12-12T23:07:15Z")

</div>

So if you `vagrant ssh` to get into the machine and `cat /var/chef/cache/chef-stacktrace.out` you should see the version of Chef embedded in the gem path in the traceback, that should be bulletproof to check the version.

--Noah

On Dec 12, 2013, at 2:17 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:

> --  
> mark nichols | (t|a.n) @zanshin | (w) [zanshin.net](http://zanshin.net) | (gpg key) 53445200
> 
> On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> 
> > How sure are you of that?
> 
> Good question. I created a cookbook using `berks cookbook` and I’m testing the new recipe through Vagrant. Maybe the Chef environment isn’t 11.x as a result of my method. The VM isn’t coming up, so I can’t see what Chef looks like there. I’m new to all of this, so I’m stumbling around in the dark trying to figure out what’s what.
> 
> —  
> Mark
> 
> > That module was added in Chef 11 and is definitely present in 11.8.0 ([https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include\_recipe.rb#L23](https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include_recipe.rb#L23)) so usually that error stems from using Chef 10.x :-/
> > 
> > --Noah
> > 
> > On Dec 12, 2013, at 1:36 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > 
> > > On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> > > 
> > > > What version of Chef are you using?
> > > 
> > > 11.8.0
> > > 
> > > — Mark
> > > 
> > > > --Noah
> > > > 
> > > > On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > > > 
> > > > > Good afternoon,
> > > > > 
> > > > > I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> > > > > 
> > > > > # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> > > > > 
> > > > > ## NameError
> > > > > 
> > > > > uninitialized constant Chef::DSL
> > > > > 
> > > > > ## Cookbook Trace:
> > > > > 
> > > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> > > > > 
> > > > > ## Relevant File Content:
> > > > > 
> > > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> > > > > 
> > > > > 1: #  
> > > > > 2: # Cookbook Name:: application\_java  
> > > > > 3: # Provider:: java\_webapp  
> > > > > 4: #  
> > > > > 5: # Copyright 2012, ZephirWorks  
> > > > > 6: #  
> > > > > 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> > > > > 8: # you may not use this file except in compliance with the License.  
> > > > > 9: # You may obtain a copy of the License at
> > > > > 
> > > > > [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> > > > > [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> > > > > [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > > > [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> > > > > 
> > > > > Here is my recipe:
> > > > > 
> > > > > include\_recipe "application\_java"
> > > > > 
> > > > > application 'credit-card-webapp' do  
> > > > > path '/usr/local/creditcardapp'  
> > > > > repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> > > > > scm\_provider Chef::Provider::RemoteFile::Deploy
> > > > > 
> > > > > end
> > > > > 
> > > > > tomcat  
> > > > > end
> > > > > 
> > > > > Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([chef - [chef] Re: Re: dhcp cookbook error: FATAL: NameError: uninitialized constant Chef::DSL](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> > > > > 
> > > > > Thanks,  
> > > > > Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Nichols](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Mark\_Nichols](https://discourse.chef.io/u/Mark_Nichols)\
**Post date:** [December 13, 2013, 5:11am UTC](https://discourse.chef.io/t/error-running-application-java/4796/7 "2013-12-13T05:11:36Z")

</div>

On Dec 12, 2013, at 5:07 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:

> So if you `vagrant ssh` to get into the machine and `cat /var/chef/cache/chef-stacktrace.out` you should see the version of Chef embedded in the gem path in the traceback, that should be bulletproof to check the version.

My bad. I checked the Chef version on my workstation and not on the VM. As you suspected, the Chef version on the VM was behind. I’ve added the vagrant-omnibus plugin and now my Vagrant VM has the latest Chef (11.8.2) installed. Consequently I’ve moved on to errors in my recipe. Progress of a sort.

Thanks,  
Mark

> --Noah
> 
> On Dec 12, 2013, at 2:17 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> 
> > --  
> > mark nichols | (t|a.n) @zanshin | (w) [zanshin.net](http://zanshin.net) | (gpg key) 53445200
> > 
> > On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> > 
> > > How sure are you of that?
> > 
> > Good question. I created a cookbook using `berks cookbook` and I’m testing the new recipe through Vagrant. Maybe the Chef environment isn’t 11.x as a result of my method. The VM isn’t coming up, so I can’t see what Chef looks like there. I’m new to all of this, so I’m stumbling around in the dark trying to figure out what’s what.
> > 
> > —  
> > Mark
> > 
> > > That module was added in Chef 11 and is definitely present in 11.8.0 ([https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include\_recipe.rb#L23](https://github.com/opscode/chef/blob/11.8.0/lib/chef/dsl/include_recipe.rb#L23)) so usually that error stems from using Chef 10.x :-/
> > > 
> > > --Noah
> > > 
> > > On Dec 12, 2013, at 1:36 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > > 
> > > > On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz [noah@coderanger.net](mailto:noah@coderanger.net) wrote:
> > > > 
> > > > > What version of Chef are you using?
> > > > 
> > > > 11.8.0
> > > > 
> > > > — Mark
> > > > 
> > > > > --Noah
> > > > > 
> > > > > On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" [chef@zanshin.net](mailto:chef@zanshin.net) wrote:
> > > > > 
> > > > > > Good afternoon,
> > > > > > 
> > > > > > I am trying to deploy a Tomcat application using the application\_java cookbook. I am getting the following error:
> > > > > > 
> > > > > > # ================================================================================ Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb
> > > > > > 
> > > > > > ## NameError
> > > > > > 
> > > > > > uninitialized constant Chef::DSL
> > > > > > 
> > > > > > ## Cookbook Trace:
> > > > > > 
> > > > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:20:in `class\_from\_file'
> > > > > > 
> > > > > > ## Relevant File Content:
> > > > > > 
> > > > > > /tmp/vagrant-chef-1/chef-solo-1/cookbooks/application\_java/providers/java\_webapp.rb:
> > > > > > 
> > > > > > 1: #  
> > > > > > 2: # Cookbook Name:: application\_java  
> > > > > > 3: # Provider:: java\_webapp  
> > > > > > 4: #  
> > > > > > 5: # Copyright 2012, ZephirWorks  
> > > > > > 6: #  
> > > > > > 7: # Licensed under the Apache License, Version 2.0 (the "License");  
> > > > > > 8: # you may not use this file except in compliance with the License.  
> > > > > > 9: # You may obtain a copy of the License at
> > > > > > 
> > > > > > [2013-12-12T20:30:31+00:00] ERROR: Running exception handlers  
> > > > > > [2013-12-12T20:30:31+00:00] ERROR: Exception handlers complete  
> > > > > > [2013-12-12T20:30:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
> > > > > > [2013-12-12T20:30:32+00:00] FATAL: NameError: uninitialized constant Chef::DSL
> > > > > > 
> > > > > > Here is my recipe:
> > > > > > 
> > > > > > include\_recipe "application\_java"
> > > > > > 
> > > > > > application 'credit-card-webapp' do  
> > > > > > path '/usr/local/creditcardapp'  
> > > > > > repository '[http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war](http://tools.ome.ksu.edu/artifactory/ome-telecom-release/telecom/credit-card-webapp/2.1.0/credit-card-webapp-2.1.0.war)'  
> > > > > > scm\_provider Chef::Provider::RemoteFile::Deploy
> > > > > > 
> > > > > > end
> > > > > > 
> > > > > > tomcat  
> > > > > > end
> > > > > > 
> > > > > > Doing a Google search seems to point to the cookbook trying to protect against changes introduced in Chef 11, but I’m not convinced that’s the case here. ([http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html](http://lists.opscode.com/sympa/arc/chef/2013-06/msg00078.html)). Any suggestions would be welcome.
> > > > > > 
> > > > > > Thanks,  
> > > > > > Mark
