Hi, I am Abhilash A newbee for FlexFramework and LiveCycle Data Services.
I tried to connect to a java class Hello through RemoteObject.
Hello.java
class Hello
{
public String sayHello()
{
return "Hello From LCDS";
}
}
RemotingIntro.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" height="100%">
<fx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
private function echo():void
{
/* var text:String = ti.text; */
remoteObject.sayHello();
}
protected function remoteObject_resultHandler(event:ResultEvent):void
{
// TODO Auto-generated method stub
ta.text = "Server Responded: " + event.result + "\n";
}
protected function remoteObject_faultHandler(event:FaultEvent):void
{
// TODO Auto-generated method stub
ta.text = "Received Fault: " + event.fault + "\n";
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:RemoteObject id="remoteObject"
destination="hello"
result="remoteObject_resultHandler(event)"
fault="remoteObject_faultHandler(event)"/>
</fx:Declarations>
<!-- UI Elemets -->
<s:Label text="Enter a text for the server to echo" x="10" y="35"/>
<s:TextInput x="196" y="30" id="ti" text="Hello World!"/>
<s:Button x="367" y="31" label="Send" click="echo()"/>
<s:TextArea x="9" y="73" id="ta" width="100%" height="80%"/>
</s:Application>
I have created a destination like:
<destination id="hello" channels="my-amf">
<properties>
<source>Hello</source>
</properties>
</destination>
I have defined the my-amf channel as:
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:8400/lcds-samples/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
After changing the configuration I restarted the LCDS Data Services Server and tried to execute the application which gave me the following error:
Received Fault: [RPC Fault faultString="Bad version number in .class file (unable to load class Hello)" faultCode="Server.Processing" faultDetail="null"]
I have installed LiveCycle DataServices 3.1 with integrated tomcat(C:\lcds)
When I executed the version.bat from C:\lcds\tomcat\bin directory it provided me this information:
Using CATALINA_BASE: C:\lcds\tomcat
Using CATALINA_HOME: C:\lcds\tomcat
Using CATALINA_TMPDIR: C:\lcds\tomcat\temp
Using JRE_HOME: c:\lcds/UninstallerData/jre
Server version: Apache Tomcat/6.0.20
Server built: May 14 2009 01:13:50
Server number: 6.0.20.0
OS Name: Windows Vista
OS Version: 6.0
Architecture: x86
JVM Version: 1.5.0_14-b03
JVM Vendor: Sun Microsystems Inc.
Please can anybody help me so make this simple call happen..........!
I have istalled java_ee_sdk-6u1-jdk-windows and configured the classapth and path environment variable so that javac works with this version. I have compiled the Hello.java
file with this version of java. If this is not the required version. Which version should I use?