Re: [flexcoders] OpenAMF, Tomcat and Flex2B3
Hello, I got exactly the same problem withopenamf + jrun+ last flash player ( 9,0,16,0) and encoding set to amf0. classmapping fails everytime ! Did anyone succeed to solve it ? thanks in advance ! francis - Original Message - From: Carlos Rovira To: flexcoders@yahoogroups.com Sent: Monday, June 05, 2006 2:55 PM Subject: Re: [flexcoders] OpenAMF, Tomcat and Flex2B3 That's not right, you don't need to use AdvancedGateway to map java-as classes, you can do it as well with DefaultGateway. Although use AdvancedGateway is a best practice, and you must declare your services as in the following example, service nameServiceNameToUseInFlash/name service-locationcom.carlosrovira.MyClass/service-location invoker-refJava/invoker-ref method name*/name parameter type*/type /parameter /method /service Then your must to change your call in flex and put "ServiceNameToUseInFlash" instead the "com.carlosrovira.MyClass". In this way you can change your java class or even the invoker in your openamf-config.xml without modify any flex code. On 6/5/06, Andrea Varga [EMAIL PROTECTED] wrote: Hi Carlos,Yes, I'm using AMF0, I'm using Renaun Erickson's RemoteObjectAMF0 class. I have tested it with AMFPHP and it worked, so that part should be ok.http://renaun.com/blog/?p=31I have read more docs, and I found that for class mappings I should use AdvancedGateway instead of DefaultGateway, but I haven't manage to writea proper openamf-config.xml yet.ThanksAndiCarlos Rovira wrote: Hi Andrea, The problem was solved in last beta (FP9 beta3), so you can pass VOs from AS to Java and from Java to AS. Your code looks ok, for me but the logs says something is happen, maybe...are you using AMF0?, remember that in FP9 default is AMF3. On 6/2/06, *Andrea Varga* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi I have been trying to set up a project using Java, OpenAMF, Tomcat, Flex2B2 and Cairngorm. I'm kinda new to OpenAMF andTomcat (and usually to application servers) and I have found the docs confusing. Finally i managed to get the remoting working. I can call my services, and get back the result, but I am having problems with my VO class mappings in both directions (if I send Strings, everything works fine) I have read in previous posts, that mapping from Java to AS was not working in Flash Player 8.5 (but should work from AS to Java), but I couldn't find anything about Flash Player 9. Actually, I have found this in Carlos Rovira's blog: "El problema de mapeo de clases de Java hacia ActionScript está resuelto en el nuevo *Flash Player 9 Beta"*. Unfortunatelly, I don't understand spanish, but it's close to romanian, does that mean that the problem has been solved in Flash Player 9 or the opposite ? :) I have a LoginVO class: Java code: --- package com.spindevelopment.model.vo; public class LoginVO { public String username; public String password; public LoginVO() { } } AS code: - package com.spindevelopment.model.vo { import org.nevis.cairngorm.vo.ValueObject; [RemoteClass(alias=" com.spindevelopment.model.vo.LoginVO")] [Bindable] public class LoginVO implements ValueObject { public var username:String; public var password:String; } } In openamf-congid.xml I added this: custom-class-mapping java-classcom.spindevelopment.model.vo.LoginVO/java-class custom-class com.spindevelopment.model.vo.LoginVO/custom-class /custom-class-mapping In my java service class, I have a simple test method, where I return a String with the 2 properties of LoginVO: public String doLogin(LoginVO pLogin ) { return new String("un: " + pLogin.username + ", pass: "+pLogin.password); } The returned string is: "un: null, pass: null"; Here is my Tomcat log: 02.06.2006 15:54:45 org.openamf.io.AMFDeserializer init INFO: Deserializing Message, for more info turn on debug level 02.06.2006 15:54:45 org.openamf.DefaultGateway service INFO: REQUEST: [AMFBody: {serviceName=com.spindevelopment.services.Login, serviceMethodName=doLogin, response=/1, type=ARRAY, value=[ASObject[type= com.spindevelopment.model.vo.LoginVO]]}] 02.06.2006 15:54:46 org.openamf.invoker.JavaServiceInvoker getServiceMethod INFO: topRankedMethod: name=doLogin rank=100.0 02.06.2006 15:54:46 org.openamf.DefaultGateway service INFO: RESPONSE: [AMFBody: {serviceName=null, serviceMethodName=null, response=null, type=UNKNOWN, value=un: null, pass: null}]
Re: [flexcoders] OpenAMF, Tomcat and Flex2B3
Hi Carlos, Yes, I'm using AMF0, I'm using Renaun Erickson’s RemoteObjectAMF0 class. I have tested it with AMFPHP and it worked, so that part should be ok. http://renaun.com/blog/?p=31 I have read more docs, and I found that for class mappings I should use AdvancedGateway instead of DefaultGateway, but I haven't manage to write a proper openamf-config.xml yet. Thanks Andi Carlos Rovira wrote: Hi Andrea, The problem was solved in last beta (FP9 beta3), so you can pass VOs from AS to Java and from Java to AS. Your code looks ok, for me but the logs says something is happen, maybe...are you using AMF0?, remember that in FP9 default is AMF3. On 6/2/06, *Andrea Varga* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi I have been trying to set up a project using Java, OpenAMF, Tomcat, Flex2B2 and Cairngorm. I'm kinda new to OpenAMF andTomcat (and usually to application servers) and I have found the docs confusing. Finally i managed to get the remoting working. I can call my services, and get back the result, but I am having problems with my VO class mappings in both directions (if I send Strings, everything works fine) I have read in previous posts, that mapping from Java to AS was not working in Flash Player 8.5 (but should work from AS to Java), but I couldn't find anything about Flash Player 9. Actually, I have found this in Carlos Rovira's blog: El problema de mapeo de clases de Java hacia ActionScript está resuelto en el nuevo *Flash Player 9 Beta*. Unfortunatelly, I don't understand spanish, but it's close to romanian, does that mean that the problem has been solved in Flash Player 9 or the opposite ? :) I have a LoginVO class: Java code: --- package com.spindevelopment.model.vo; public class LoginVO { public String username; public String password; public LoginVO() { } } AS code: - package com.spindevelopment.model.vo { import org.nevis.cairngorm.vo.ValueObject; [RemoteClass(alias=com.spindevelopment.model.vo.LoginVO)] [Bindable] public class LoginVO implements ValueObject { public var username:String; public var password:String; } } In openamf-congid.xml I added this: custom-class-mapping java-classcom.spindevelopment.model.vo.LoginVO/java-class custom-classcom.spindevelopment.model.vo.LoginVO/custom-class /custom-class-mapping In my java service class, I have a simple test method, where I return a String with the 2 properties of LoginVO: public String doLogin(LoginVO pLogin ) { return new String(un: + pLogin.username + , pass: +pLogin.password); } The returned string is: un: null, pass: null; Here is my Tomcat log: 02.06.2006 15:54:45 org.openamf.io.AMFDeserializer init INFO: Deserializing Message, for more info turn on debug level 02.06.2006 15:54:45 org.openamf.DefaultGateway service INFO: REQUEST: [AMFBody: {serviceName=com.spindevelopment.services.Login, serviceMethodName=doLogin, response=/1, type=ARRAY, value=[ASObject[type=com.spindevelopment.model.vo.LoginVO]]}] 02.06.2006 15:54:46 org.openamf.invoker.JavaServiceInvoker getServiceMethod INFO: topRankedMethod: name=doLogin rank=100.0 02.06.2006 15:54:46 org.openamf.DefaultGateway service INFO: RESPONSE: [AMFBody: {serviceName=null, serviceMethodName=null, response=null, type=UNKNOWN, value=un: null, pass: null}] Could somebody point me in the right direction? Thanks Andi -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ Computer software development http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw Software design and development http://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ Macromedia flex
Re: [flexcoders] OpenAMF, Tomcat and Flex2B3
That's not right, you don't need to use AdvancedGateway to map java-as classes, you can do it as well with DefaultGateway. Although use AdvancedGateway is a best practice, and you must declare your services as in the following example, service nameServiceNameToUseInFlash/name service-locationcom.carlosrovira.MyClass/service-location invoker-refJava/invoker-ref method name*/name parametertype*/type /parameter /method /service Then your must to change your call in flex and put ServiceNameToUseInFlash instead the com.carlosrovira.MyClass. In this way you can change your java class or even the invoker in your openamf-config.xml without modify any flex code.On 6/5/06, Andrea Varga [EMAIL PROTECTED] wrote: Hi Carlos,Yes, I'm using AMF0, I'm using Renaun Erickson's RemoteObjectAMF0 class. I have tested it with AMFPHP and it worked, so that part should be ok.http://renaun.com/blog/?p=31I have read more docs, and I found that for class mappings I should use AdvancedGateway instead of DefaultGateway, but I haven't manage to writea proper openamf-config.xml yet.ThanksAndiCarlos Rovira wrote: Hi Andrea, The problem was solved in last beta (FP9 beta3), so you can pass VOs from AS to Java and from Java to AS. Your code looks ok, for me but the logs says something is happen, maybe...are you using AMF0?, remember that in FP9 default is AMF3. On 6/2/06, *Andrea Varga* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi I have been trying to set up a project using Java, OpenAMF, Tomcat, Flex2B2 and Cairngorm. I'm kinda new to OpenAMF andTomcat (and usually to application servers) and I have found the docs confusing. Finally i managed to get the remoting working. I can call my services, and get back the result, but I am having problems with my VO class mappings in both directions (if I send Strings, everything works fine) I have read in previous posts, that mapping from Java to AS was not working in Flash Player 8.5 (but should work from AS to Java), but I couldn't find anything about Flash Player 9. Actually, I have found this in Carlos Rovira's blog: El problema de mapeo de clases de Java hacia ActionScript está resuelto en el nuevo *Flash Player 9 Beta*. Unfortunatelly, I don't understand spanish, but it's close to romanian, does that mean that the problem has been solved in Flash Player 9 or the opposite ? :) I have a LoginVO class: Java code: --- package com.spindevelopment.model.vo; public class LoginVO { public String username; public String password; public LoginVO() { } } AS code: - package com.spindevelopment.model.vo { import org.nevis.cairngorm.vo.ValueObject; [RemoteClass(alias= com.spindevelopment.model.vo.LoginVO)] [Bindable] public class LoginVO implements ValueObject { public var username:String; public var password:String; } } In openamf-congid.xml I added this: custom-class-mapping java-classcom.spindevelopment.model.vo.LoginVO/java-class custom-class com.spindevelopment.model.vo.LoginVO/custom-class /custom-class-mapping In my java service class, I have a simple test method, where I return a String with the 2 properties of LoginVO: public String doLogin(LoginVO pLogin ) { return new String(un: + pLogin.username + , pass: +pLogin.password); } The returned string is: un: null, pass: null; Here is my Tomcat log: 02.06.2006 15:54:45 org.openamf.io.AMFDeserializer init INFO: Deserializing Message, for more info turn on debug level 02.06.2006 15:54:45 org.openamf.DefaultGateway service INFO: REQUEST: [AMFBody: {serviceName=com.spindevelopment.services.Login, serviceMethodName=doLogin, response=/1, type=ARRAY, value=[ASObject[type= com.spindevelopment.model.vo.LoginVO]]}] 02.06.2006 15:54:46 org.openamf.invoker.JavaServiceInvoker getServiceMethod INFO: topRankedMethod: name=doLogin rank=100.0 02.06.2006 15:54:46 org.openamf.DefaultGateway service INFO: RESPONSE: [AMFBody: {serviceName=null, serviceMethodName=null, response=null, type=UNKNOWN, value=un: null, pass: null}] Could somebody point me in the right direction? Thanks Andi -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ Computer software development http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw Software design and development
Re: [flexcoders] OpenAMF, Tomcat and Flex2B3
Hi Andrea,The problem was solved in last beta (FP9 beta3), so you can pass VOs from AS to Java and from Java to AS.Your code looks ok, for me but the logs says something is happen, maybe...are you using AMF0?, remember that in FP9 default is AMF3. On 6/2/06, Andrea Varga [EMAIL PROTECTED] wrote: Hi I have been trying to set up a project using Java, OpenAMF, Tomcat, Flex2B2 and Cairngorm. I'm kinda new to OpenAMF andTomcat (and usually to application servers) and I have found the docs confusing. Finally i managed to get the remoting working. I can call my services, and get back the result, but I am having problems with my VO class mappings in both directions (if I send Strings, everything works fine) I have read in previous posts, that mapping from Java to AS was not working in Flash Player 8.5 (but should work from AS to Java), but I couldn't find anything about Flash Player 9. Actually, I have found this in Carlos Rovira's blog: El problema de mapeo de clases de Java hacia ActionScript está resuelto en el nuevo *Flash Player 9 Beta*. Unfortunatelly, I don't understand spanish, but it's close to romanian, does that mean that the problem has been solved in Flash Player 9 or the opposite ? :) I have a LoginVO class: Java code: --- package com.spindevelopment.model.vo; public class LoginVO { public String username; public String password; public LoginVO() { } } AS code: - package com.spindevelopment.model.vo { import org.nevis.cairngorm.vo.ValueObject; [RemoteClass(alias=com.spindevelopment.model.vo.LoginVO)] [Bindable] public class LoginVO implements ValueObject { public var username:String; public var password:String; } } In openamf-congid.xml I added this: custom-class-mapping java-classcom.spindevelopment.model.vo.LoginVO/java-class custom-classcom.spindevelopment.model.vo.LoginVO/custom-class /custom-class-mapping In my java service class, I have a simple test method, where I return a String with the 2 properties of LoginVO: public String doLogin(LoginVO pLogin ) { return new String(un: + pLogin.username + , pass: +pLogin.password); } The returned string is: un: null, pass: null; Here is my Tomcat log: 02.06.2006 15:54:45 org.openamf.io.AMFDeserializer init INFO: Deserializing Message, for more info turn on debug level 02.06.2006 15:54:45 org.openamf.DefaultGateway service INFO: REQUEST: [AMFBody: {serviceName=com.spindevelopment.services.Login, serviceMethodName=doLogin, response=/1, type=ARRAY, value=[ASObject[type=com.spindevelopment.model.vo.LoginVO]]}] 02.06.2006 15:54:46 org.openamf.invoker.JavaServiceInvoker getServiceMethod INFO: topRankedMethod: name=doLogin rank=100.0 02.06.2006 15:54:46 org.openamf.DefaultGateway service INFO: RESPONSE: [AMFBody: {serviceName=null, serviceMethodName=null, response=null, type=UNKNOWN, value=un: null, pass: null}] Could somebody point me in the right direction? Thanks Andi -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service . -- ::| Carlos Rovira::| http://www.carlosrovira.com -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.