Question

I seem to be getting a strange compilation error that I just don't understand. I've looked at other examples and I can't find anything wrong with my code but it won't compile.

Here is the ruby code:

glassfish_jdbc_connection_pool 'WebarcConnectionPool' do
  domain_name 'staging'
  password_file password_file
  secure false
  datasourceclassname 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource'
  restype 'javax.sql.ConnectionPoolDataSource'
  isconnectvalidatereq true
  validationmethod 'table'
  validationtable 'DATABASECHANGELOG'
  ping true
  description 'Webarc Connection Pool'
  properties {
    "user" => "user"

  }
  echo true
end

Here is the error:

c:\devenv\src\chef-repo>knife cookbook upload glassfish
Uploading glassfish      [0.5.28]
FATAL: Cookbook file recipes/create_domain.rb has a ruby syntax error:
FATAL: c:/devenv/src/chef-repo/.chef/../cookbooks/glassfish/recipes/create_domai
n.rb:64: syntax error, unexpected tASSOC, expecting '}'
FATAL:     "user" => "user"
FATAL:   

       ^

Any ideas would be welcome!

Was it helpful?

Solution

You need to either put it on one line or use parenthesis

properties {"user" => "user"}

Or

properties({
  "user" => "user"
})

Or

properties(
  "user" => "user"
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top