Re: instanceof validation error on checking value obects from server

Troy Gardner <[email protected]>
Newsgroups gmane.comp.java.openamf.user
Message-ID <[email protected]>
Please read the OpenAMF/docs/understanding.htm section "Object Mapping" aka
Class mapping. 

> Here is our Java class:
> package com.roundbox.oss.om;
> public class ContentTemplate implements Serializable {

so com.roundbox.oss.om.ContentTemplate 

> and here is our AS2 class:
> class com.rbx.selfservice.model.vo.ContentTemplate

so com.rbx.selfservice.model.vo.ContentTemplate

> However, when I attempt to validate the object's class type in Flash 
> like so:
> 
> TRACE(Flashout.DEBUG + "item instanceof 
> com.rbx.selfservice.model.vo.ContentTemplate: " + (item instanceof 
> com.rbx.selfservice.model.vo.ContentTemplate));

So your AS registerClass should be:

Object.registerClass("com.rbx.selfservice.model.vo.ContentTemplate",
com.rbx.selfservice.model.vo.ContentTemplate);

NOT 

Object.registerClass("com.rbx.selfservice.model.vo.ContentTemplate",
com.roundbox.oss.om.ContentTemplate);

If you create a new com.roundbox.oss.om.ContentTemplate(); does it show up as
the instance of correctly? 

> /////////////////////////////////////////
> // our openamf-config.xml
> ////////////////////////////////////////
>     <invoker>
>         <name>Java</name>
>         <class>org.openamf.invoker.SpringBeanInvoker</class>
>     </invoker>

As mentioned this needs to be either
<invoker>
  <name>Java</name> 
  <class>org.openamf.invoker.JavaServiceInvoker</class> 
  </invoker>

for Java or 
 <invoker>
  <name>Spring</name> 
  <class>org.openamf.invoker.SpringBeanInvoker</class> 
  </invoker>

if your using Spring. If you are using Spring you'll have to map the concrete
implementation class being used not the interface.

>     <custom-class-mapping>
>         <java-class>com.roundbox.oss.om.ContentTemplate</java-class>
>         <custom-class>
>             com.rbx.selfservice.model.vo.ContentTemplate
>         </custom-class>
>     </custom-class-mapping>

while it shouldn't make a difference, remove the white space between class>
tags and com.rbx....etc. 

We use class mapping pretty heavily and it works for me.

Troy Gardner -"How you live your seconds, is how you live your days, is how you live your life..."

http://www.troygardner.com -my world
http://www.troyworks.com - building Rich Internet Applications
http://www.intrio.com -helping bridge the gap between the humans and machines. Home of the Flickey™


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.