Announcement Announcement Module
Collapse
No announcement yet.
Cannot create class of type :( Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot create class of type :(

    Hi, I integrate flex and spring on one project... everything works great except one thing... I have problem when I try to send complex object (see CreateRestoreRequest class) from flex to java. I always receive message Cannot create class of type 'com.jmax.domain.common.Restore'

    CreateRestoreRequest.as
    Code:
    package com.jmax.domain.requestrestore
    {
    	import mx.collections.ArrayCollection;
    	import com.jmax.domain.common.Backup;
    	import com.jmax.domain.common.Restore;
    	import com.jmax.domain.common.VM;
    
    	[RemoteClass(alias="com.jmax.domain.requestrestore.CreateRestoreRequest")]
    	public class CreateRestoreRequest
    	{
    		public function CreateRestoreRequest(){}
    		
    		public var vm:VM;
    		public var disks:ArrayCollection;
    		public var vmRef:String;
    		public var restore:Restore;
    		public var backup:Backup;
    	}
    }
    CreateRestoreRequest.java
    Code:
    package com.jmax.domain.requestrestore;
    
    import java.io.Serializable;
    import java.util.List;
    
    import com.jmax.domain.common.Backup;
    import com.jmax.domain.common.Disk;
    import com.jmax.domain.common.Restore;
    import com.jmax.domain.common.VM;
    
    public class CreateRestoreRequest implements Serializable {
    
    	private static final long serialVersionUID = -8114381374857282994L;
    	private VM vm;
    	private List<Disk> disks;
    	private String vmRef;
    	private Restore restore;
    	private Backup backup;
    
    	public CreateRestoreRequest() {
    		
    	}
    	
    	/**
    	 * @return the vm
    	 */
    	public VM getVm() {
    		return vm;
    	}
    
    	/**
    	 * @param vm
    	 *            the vm to set
    	 */
    	public void setVm(VM vm) {
    		this.vm = vm;
    	}
    
    	/**
    	 * @return the disks
    	 */
    	public List<Disk> getDisks() {
    		return disks;
    	}
    
    	/**
    	 * @param disks
    	 *            the disks to set
    	 */
    	public void setDisks(List<Disk> disks) {
    		this.disks = disks;
    	}
    
    	/**
    	 * @return the vmRef
    	 */
    	public String getVmRef() {
    		return vmRef;
    	}
    
    	/**
    	 * @param vmRef
    	 *            the vmRef to set
    	 */
    	public void setVmRef(String vmRef) {
    		this.vmRef = vmRef;
    	}
    
    	/**
    	 * @return the restore
    	 */
    	public Restore getRestore() {
    		return restore;
    	}
    
    	/**
    	 * @param restore
    	 *            the restore to set
    	 */
    	public void setRestore(Restore restore) {
    		this.restore = restore;
    	}
    
    	/**
    	 * @return the backup
    	 */
    	public Backup getBackup() {
    		return backup;
    	}
    
    	/**
    	 * @param backup
    	 *            the backup to set
    	 */
    	public void setBackup(Backup backup) {
    		this.backup = backup;
    	}
    
    }
    Restore.as
    Code:
    package com.jmax.domain.common 
    {
    	[RemoteClass(alias="com.jmax.domain.common.Restore")]
    	public class Restore
    	{
    		public function Restore(){}
    		
    		public var dirName:String;
    		public var retentionTime:int;
    		public var expireTime:String;
    		public var startTime:String;
    		public var hostName:String;
    		public var endTime:String;
    		public var sessionGuid:String;
    		public var sessionId:String;
    		public var expireTimestr:String;
    		public var progress:String;
    	}
    }
    Restore.java
    Code:
    package com.jmax.domain.common;
    
    import java.io.Serializable;
    
    public class Restore implements Serializable {
    
    	private static final long serialVersionUID = 6120489569194692394L;
    	private String dirName;
    	private Integer retentionTime;
    	private String expireTime;
    	private String startTime;
    	private String hostName;
    	private String endTime;
    	private String sessionGuid;
    	private String sessionId;
    	private String expireTimestr;
    	private String progress;
    
    	public Restore() {
    		
    	}
    	
    	/**
    	 * @return the dirName
    	 */
    	public String getDirName() {
    		return dirName;
    	}
    
    	/**
    	 * @param dirName
    	 *            the dirName to set
    	 */
    	public void setDirName(String dirName) {
    		this.dirName = dirName;
    	}
    
    	/**
    	 * @return the retentionTime
    	 */
    	public Integer getRetentionTime() {
    		return retentionTime;
    	}
    
    	/**
    	 * @param retentionTime
    	 *            the retentionTime to set
    	 */
    	public void setRetentionTime(Integer retentionTime) {
    		this.retentionTime = retentionTime;
    	}
    
    	/**
    	 * @return the expireTime
    	 */
    	public String getExpireTime() {
    		return expireTime;
    	}
    
    	/**
    	 * @param expireTime
    	 *            the expireTime to set
    	 */
    	public void setExpireTime(String expireTime) {
    		this.expireTime = expireTime;
    	}
    
    	/**
    	 * @return the startTime
    	 */
    	public String getStartTime() {
    		return startTime;
    	}
    
    	/**
    	 * @param startTime
    	 *            the startTime to set
    	 */
    	public void setStartTime(String startTime) {
    		this.startTime = startTime;
    	}
    
    	/**
    	 * @return the hostName
    	 */
    	public String getHostName() {
    		return hostName;
    	}
    
    	/**
    	 * @param hostName
    	 *            the hostName to set
    	 */
    	public void setHostName(String hostName) {
    		this.hostName = hostName;
    	}
    
    	/**
    	 * @return the endTime
    	 */
    	public String getEndTime() {
    		return endTime;
    	}
    
    	/**
    	 * @param endTime
    	 *            the endTime to set
    	 */
    	public void setEndTime(String endTime) {
    		this.endTime = endTime;
    	}
    
    	/**
    	 * @return the sessionGuid
    	 */
    	public String getSessionGuid() {
    		return sessionGuid;
    	}
    
    	/**
    	 * @param sessionGuid
    	 *            the sessionGuid to set
    	 */
    	public void setSessionGuid(String sessionGuid) {
    		this.sessionGuid = sessionGuid;
    	}
    
    	/**
    	 * @return the sessionId
    	 */
    	public String getSessionId() {
    		return sessionId;
    	}
    
    	/**
    	 * @param sessionId
    	 *            the sessionId to set
    	 */
    	public void setSessionId(String sessionId) {
    		this.sessionId = sessionId;
    	}
    
    	/**
    	 * @return the expireTimestr
    	 */
    	public String getExpireTimestr() {
    		return expireTimestr;
    	}
    
    	/**
    	 * @param expireTimestr
    	 *            the expireTimestr to set
    	 */
    	public void setExpireTimestr(String expireTimestr) {
    		this.expireTimestr = expireTimestr;
    	}
    
    	/**
    	 * @return the progress
    	 */
    	public String getProgress() {
    		return progress;
    	}
    
    	/**
    	 * @param progress
    	 *            the progress to set
    	 */
    	public void setProgress(String progress) {
    		this.progress = progress;
    	}
    
    }
    services-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <default-channels>
               <channel ref="main-amf"/>
            </default-channels>
        </services>
    	
       <channels>
          <channel-definition id="main-amf" class="mx.messaging.channels.AMFChannel">
             <endpoint
                url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
                class="flex.messaging.endpoints.AMFEndpoint" />
          </channel-definition>
          <channel-definition id="main-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
             <endpoint 
    			url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" 
    			class="flex.messaging.endpoints.SecureAMFEndpoint"/>
    				<properties>
    					<add-no-cache-headers>false</add-no-cache-headers>
    				</properties>
          </channel-definition>		
       </channels>
    
       <logging>
          <target class="flex.messaging.log.ConsoleTarget" level="All">
             <properties>
                <prefix>[BlazeDS]</prefix>
                <includeDate>true</includeDate>
                <includeTime>true</includeTime>
                <includeLevel>true</includeLevel>
                <includeCategory>true</includeCategory>
             </properties>
    
             <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
             </filters>
          </target>
       </logging>
    </services-config>
    If I send only instance of object Restore to java everything works OK, but when I try to send instance of CreateRestoreRequest I see: Cannot create class of type 'com.jmax.domain.common.Restore'.

    Method what I'am calling in java is:
    Code:
    public CreateRestoreRequestResponse createRestoreRequest(String sessionId, boolean debugging, CreateRestoreRequest createRestoreRequest)
    blazeds log file: Attachment

    I use: Virgo server 2.1.1 and spring -flex 1.0.3.RELEASE

    Did someone know where is problem?
    Thanks
    Attached Files
    Last edited by maxogm; Nov 6th, 2011, 08:56 AM.

  • #2
    I made one example which demonstrate this issue Attachment
    Attached Files

    Comment

    Working...
    X