1

I'm running a BedSheet application but when I make a HTTP request to a particular route, I get this error in the browser

500 - Internal Server Error
afBeanUtils::TypeNotFoundErr
- Could not find match for Type mypod::MyClass. 

Available Values

afBedSheet::FileAsset
afBedSheet::HttpStatus
afBedSheet::MethodCall
afBedSheet::Redirect
afBedSheet::Text
sys::File
sys::InStream

afBeanUtils::TypeNotFoundErr : Could not find match for Type mypod::MyClass.
  afBeanUtils::TypeLookup.check (TypeLookup.fan:157)
    afBeanUtils::TypeLookup.doFindParent (TypeLookup.fan:140)

However MyClass is there and it is being instantiated by other class. Why is not found?

LightDye
  • 1,234
  • 11
  • 15

1 Answers1

1

That Err msg could be a little more informative...

It sounds like your request handler is returning an instance of mypod::MyClass and BedSheet is complaining that it doesn't know what to do with it.

You probably want to be returning an instance of afBedSheet::Text as in:

Obj indexPage() {
  return Text.fromHtml("<html>Hello!</html>")
}

If the above doesn't sound right, then I'd need to see some code to be of further help.

Steve Eynon
  • 4,979
  • 2
  • 30
  • 48
  • Awesome! that was the problem. I was returning the object, not its Text (JSON) form. I agree that the Err message could be more informative. – LightDye Aug 12 '14 at 11:46
  • New Err Msg - https://bitbucket.org/AlienFactory/afbedsheet/commits/6174914f457b8d2aae7737e3e144463dd1672860 – Steve Eynon Nov 10 '14 at 19:53