I’m trying to use the feature of AWS where it will take an object
from ActiveRecord::Base instead of an AWS::Struct object. Whenever I
it, though, I get the craziest error:
NoMethodError: You have a nil object when you didn’t expect it!
The error occured while evaluating nil.new
The reason why there’s a nil object instead of a type class object is
because something tried to create a StructuredType of Exception, which
(strangely!) doesn’t actually work.
Changing my type to any of the internals or to a class derived from
AWS::Struct causes the problem to disappear.
I know I’m a bit short on details, but the full test case is fairly
to construct – create an ActiveRecord model, create a basic AWS API,
try to make the API method return the model. If it’s unclear, I’ll whip
a sample example to demonstrate the problem as I see it, but it probably
won’t be of a form suitable for inclusion in the test suite, so it’s
probably better if people who know about such things build the
I’m running Rails 1.1.2. AWS = 1.1.2. Ruby 1.8.4. The actual error
I’m getting appears to be thrown when ActiveRecord is looking up the
table definition information after the SOAP call has been made. Here’s
Sure. Note that the code is blowing up before the first line of
update_test(company) is executed…the logger statement in the first
line never gets logged, which suggest that it’s in the marshalling code.
The find_by_id method works and returns the object to the calling code,
so it seems to only be a problem with the calling code is sending an
Also, I tracked down the line in ActiveRecord/base.rb (line 1892) that
is causing the error, and apparently @attributes is equal to
nil…which is a problem. It looks like something in the marshalling
process is supposed to create an instance of @attributes and it’s not
The application that calls the service is a C# application. The
back-end database is SQL Server, and all of this is running on Windows
XP with ruby 1.82.
Thanks for the help.
class CompanyServiceController < ApplicationController
class_inheritable_option :allow_active_record_expects, true
Company.find(:all, :conditions => [‘id = ?’, id])
logger.info(“test: this line is never displayed”) @company = Company.find(company.id) @company.update_attributes(company)