quote:
Exception in RtmpReader thread:
flex.messaging.MessageException: Cannot create class of type
'com.mycompany.learning.User'. Type 'com.mycompany.learning.User'
not found.
flex.messaging.MessageException: Cannot create class of type
'com.mycompany.learning.User'. Type 'com.mycompany.learning.User'
not found.
at
flex.messaging.util.ClassUtil.createClass(ClassUtil.java:57)
at
flex.messaging.io.AbstractProxy.createInstance(AbstractProxy.java:83)
at
flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:364)
at
flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:134)
at
flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:116)
at
flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:392)
at
flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:134)
at
flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:116)
at
flex.messaging.io.amf.Amf3Input.readArray(Amf3Input.java:323)
at
flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:138)
at
flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:116)
at
flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:392)
at
flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:134)
at
flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:116)
at
flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:125)
at
flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:85)
at
flex.messaging.io.tcchunk.TCCommand.readMessage(TCCommand.java:177)
at
flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java:563)
at
flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:613)
quote:
package com.mycompany.learning
{
[RemoteClass(alias="com.mycompany.learning.User")]
public class User
{
public function User() {}
public var userId:int;
public var firstname:String;
public var surname:String;
public var email:String;
public var username:String;
public var password:String;
}
}
quote:
userDS = new DataService("account");
...
user = new User();
user.firstname = fNameV;
user.surname = sNameV;
user.username = userNameV;
user.password = passwordV;
user.email = userEmailV;
var ref:ItemReference = userDS.createItem(user);
Alert.show(ref.message.toString());
quote:
<destination id="account">
<adapter ref="java-dao" />
<channels>
<channel ref="my-rtmp"/>
<channel ref="my-http"/>
</channels>
<properties>
<source>com.mycompany.learning.UserAssembler</source>
<scope>application</scope>
<metadata>
<identity property="userId"/>
</metadata>
<network>
<session-timeout>20</session-timeout>
<paging enabled="false" pageSize="10" />
<throttle-inbound policy="ERROR" max-frequency="500"/>
<throttle-outbound policy="REPLACE"
max-frequency="500"/>
</network>
<item-class>com.mycompany.learning.User</item-class>
</properties>
</destination>
quote:
package com.mycompany.learning;
public class User
{
private int userId;
private String firstname;
private String surname;
private String email;
private String username;
private String password;
public String getFirstname()
{
return firstname;
}
...etc...
}
quote:
package com.mycompany.learning;
import java.util.*;
import flex.data.ChangeObject;
import flex.data.DataSyncException;
import flex.data.assemblers.AbstractAssembler;
public class UserAssembler extends AbstractAssembler
{
public List loadUsers()
{
UserDAO dao = new UserDAO();
return dao.getUsers();
}
public Object getItem(Map uid)
{
UserDAO dao = new UserDAO();
return dao.getUser(((Integer)
uid.get("userId")).intValue());
}
public void createItem(Object item)
{
System.out.println("HELLO!");
UserDAO dao = new UserDAO();
dao.create((User)item);
}
}
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies