Error running application_java

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’
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). Any suggestions would be welcome.

Thanks,
Mark

What version of Chef are you using?

--Noah

On Dec 12, 2013, at 12:40 PM, "Mark H. Nichols" 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'
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). Any suggestions would be welcome.

Thanks,
Mark

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz 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 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'
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). Any suggestions would be welcome.

Thanks,
Mark

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) 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 wrote:

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz 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 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'
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). Any suggestions would be welcome.

Thanks,
Mark

--
mark nichols | (t|a.n) @zanshin | (w) zanshin.net | (gpg key) 53445200

On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz 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) 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 wrote:

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz 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 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'
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). Any suggestions would be welcome.

Thanks,
Mark

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 wrote:

--
mark nichols | (t|a.n) @zanshin | (w) zanshin.net | (gpg key) 53445200

On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz 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) 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 wrote:

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz 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 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'
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). Any suggestions would be welcome.

Thanks,
Mark

On Dec 12, 2013, at 5:07 PM, Noah Kantrowitz 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 wrote:

--
mark nichols | (t|a.n) @zanshin | (w) zanshin.net | (gpg key) 53445200

On Dec 12, 2013, at 3:39 PM, Noah Kantrowitz 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) 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 wrote:

On Dec 12, 2013, at 3:03 PM, Noah Kantrowitz 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 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'
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). Any suggestions would be welcome.

Thanks,
Mark