Sample Example on Remote Object

Hi All,
I am doing a sample program in Flex using Remote Object, when
i enter Data in TextInput and click getData(button) in the TextArea
conrol the the Data in TextInput should be displayed along with
that some updation, these updations are declared
in the Java. when i click on the Button(getData) it will
update the Data using the RemoteObject. Here is my Application..
Also described the desired path in RemoteConfig.xml
Text.mxml
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:RemoteObject id="srv" destination="testsession"
fault="faultHandler(event)" >
<mx:method name="getMessage" result="display(event)"
></mx:method>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
public function getMessage():void {
Alert.show("alertin echo"+ input.text);
srv.echoMessage(input.text);
public function display(event:ResultEvent):void {
Alert.show("In display Response");
output.text = event.result();
private function faultHandler(event:FaultEvent):void
Alert.show("Server Message: Error"+event.message);
} ]]>
</mx:Script>
<mx:Panel title="Sample" width="320">
<mx:Form width="500">
<mx:FormItem label="Input Message"> <mx:TextInput
id="input"/> </mx:FormItem>
<mx:FormItem> <mx:Button label="Get Message"
click="getMessage()"/> </mx:FormItem>
<mx:FormItem label="Output Message">
<mx:TextArea id="output" show="getMessage()"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:Application>
Here is My Java Application
EchoService.java:
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class EchoService
public String echo( String inputMessage ) throws Exception
StringBuffer result = new StringBuffer();
result.append("EchoService received ");
result.append(inputMessage);
result.append(" at ");
result.append(dateFormat.format(new Date()));
return result.toString();
private DateFormat dateFormat = new
SimpleDateFormat("HH:mm:ss");
when i run these am getting an Error at ServerMessage as:
ERROR:
Server Message: Error(mx.messaging.messages::ErrorMessage)#0
body = (Object)#1
clientId = (null)
correlationId = "F3C89B4B-8166-32AA-7C80-5F0CE42EFB40"
destination = ""
extendedData = (null)
faultCode = "Client.Error.MessageSend"
faultDetail = "Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 500: url: '
http://localhost:8600/messagebroker/amf'"
faultString = "Send failed"
headers = (Object)#2
messageId = "443DBB42-8B18-84D8-151F-5F0CED757E35"
rootCause = (Object)#3
code = "NetConnection.Call.Failed"
description = "HTTP: Status 500"
details = "
http://localhost:8600/messagebroker/amf"
level = "error"
timestamp = 0
timeToLive = 0
can anyone help me how to achieve this.
Thanks,
Raa
Text
ERROR

James,
Go through the blogs and articles in this thread.
Re: Integrating SSO with Yahoo
Hope this helps.
Cheers,
Sandeep Tudumu

Similar Messages

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • Calling a method on a remote object to ping the server

    I need a generic way of pinging a server to check if it is still there. Assuming I don't know the methods defined in the remote interface of the server, one way to achieve this would be to invoke one of the Object methods on the server and catch any exceptions. To do this I could call invoke on the RemoteRef interface, but this requires the opnum of the method, and I don't know what these are for the Object methods. Can anyone help, or suggest a better method for pinging the server ?
    William
    For example:
    // my remote service
    Remote service;
    // obtain remote ref
    RemoteRef ref = ((RemoteObject) service).getRef();
    // invoke Object method e.g. hashCode
    ref.invoke( ... );

    if you mean a real ping like windows/unix send from the ping command then it can not be done from jave. you can either connect to the echo port and test it that way or you would have to make a native call.

  • File upload through BlazeDS remote object?

    Hi,
    After researching file upload options in flex, it seems like the only option is through HTTP service requests, such as:
    private var fileRef:FileReference;
    fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
    Is there any way to use BlazeDS remote objects to upload a file from Flex interface? Perhaps passing in a FileReference object and marshalling it into an equivalent Java object?
    Thanks!

    I know there is a workaround like this. It uses a servlet to upload a file and returns a url. The uploaded file is either stored in session or server file system until the session expires. Use the PropertyProxy to register a custom class which contains this url and convert to java.io.File. It is the limitation of the player. It cannot read the local file system for security reason. There is a sample in blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/blazeds/qa/remotingService/Echo.java
    static
    PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
    PropertyProxy proxy = registry.getProxy(java.io.File.class);
    if (proxy == null)
    registry.register(java.io.File.class, new FileProxy());
    proxy = registry.getProxy(FileReference.class);
    if (proxy == null)
    registry.register(FileReference.class, new FileReferenceProxy());
    Hope it can help

  • HOW TO PASS NON REMOTE OBJECT PARAMETER

    good day,
    hi im new to java and rmi, and i need help pls, my question is how can i pass a non-remote object/local object as a parameter to a remote method. can u pls give a code for the:
    1. client that will invoke the remote method and pass the object in remote objects method.
    2. object that will be passed to the server/remote object( a serilizable object of course).
    3. the remote object and the method that will receive the object parameter.
    thank you very much for your kindness,
    p.s.
    you can email me to [email protected]
    batusai,

    When you create the object locally, and pass it to the server, at that point it exists on both systems/in both jvms.
    Why don't you write your own example, and try it. If you get in trouble, post the code, and we will help you.

  • Logical model cannot refer to 'remote objects'?

    Hi
    Using DM 3.3.0.747.
    In the relational model one can drag and drop in a table from another relational model from a separate design.  This shows that table as a linked table and can be refreshed via the 'Synchronize Remote Objects' and allows that table to be referenced from your 'local' tables (i.e. used in foreign keys).
    I tried the same, but for a logical model entity.  This does not work/is not allowed?  What is the expected behaviour?
    We would like to use this for logical models as well.  (So that we may develop/document the logical models separate, but use common/shared entities in the same way possible in relational models.  This will help us a lot in keeping the models smaller and easier to manage and version control.)
    Thank you & Regards

    Hi Ed,
    I presume you had some relationships in the Logical Model that you were expecting to be engineered to Foreign Key relationships in the Relational Model.
    Please can you provide more detail to help resolve your problem. For example:
    Was the problem on an initial engineer from the logical model? Or on a re-engineer?
    Are you using Entity subtyping in your Logical Model?
    Are there any relevant error messages in the log file? (This is normally file datamodeler.log in folder datamodeler\datamodeler\log.)
    David

  • Is the Remote Object always a singleton?

    Hi,
    Using .Net Remoting we can export a Remote Objects in three different ways:
    1. Singleton: Same instance of a Server-side object is used by all the clients for all the requests.
    2. SingleCall: Whenever a new call is received, a new instance of the Server-side object is created and reference is passed to the client. Therefore, for each call to the server, the client gets a new instance of the object.
    3. Client Activation: In this, the Client requests to the server for creating a new instance which can be used for multiple calls. The instance activated by a client is not used by other clients. Client-Activated objects can store state information between method calls for its specific client.
    Do we have this options in RMI or the Remote Object must always be a Singleton?
    What I'm looking for is a way to create one instance of the Remote Object (in the server side) to each client that connects to a server.
    thx

    Do we have this options in RMI1 and 3 are available. 2 is not.
    or the Remote Object must always be a Singleton?No.
    What I'm looking for is a way to create one instance of the Remote Object (in the server side) to each client that connects to a server.It's as simple as 'return new MyRemoteObject(...);'.
    For example:
    public interface Login extends Remote
      public Session login(String username, ...) throws RemoteException;
    public interface Session extends Remote
      // your client API here
    public class LoginImpl extends UnicastRemoteObject implements Login
      public Session login(String username, ...) throws RemoteException
        // validate username etc. If OK return a session.
        return new SessionImpl();
    public class SessionImpl extends UnicastRemoteObject implements Session
      // your client API implementation here, also all the server-side state belonging to that client session
    }Note that this is as secure as the login() method. By type safety, nobody can execute Session methods until they have logged in.
    I'm deleting your two other threads.

  • Xml data type is not supported in distributed queries. Remote object 'OPENROWSET' has xml column(s).

    Hi,
    Can anyone help me out please.
    I have written one stored Procedure to create a views using Openrowset(openquery) but for tables which contains xml data types throwing error while executing the SP. Error
    " Xml data type is not supported in distributed queries. Remote object 'OPENROWSET' has xml column(s)."
    Please refer the Stored Procedure & error message below.
    USE [Ice]
    GO
    /****** Object:  StoredProcedure [dbo].[Pr_DBAccess]    Script Date: 08/14/2014 16:08:20 ******/
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    ALTER
    PROCEDURE [dbo].[ Pr_DBAccess](@SERVERTYPE
    NVARCHAR(50),@SERVERNAME
    NVARCHAR(100),@DATABASENAME
    NVARCHAR(100),@SCHEMANAME
    NVARCHAR(100),@TABLENAME
    NVARCHAR(100),@USERNAME
    NVARCHAR(100),@PASSWORD
    NVARCHAR(100))
    AS
    BEGIN
    DECLARE @openquery
    NVARCHAR(4000),
    @ETL_CONFIG_IDN
    NVARCHAR(100);
     IF @SERVERTYPE='SQL'
     BEGIN
    SET @openquery= 
    'CREATE VIEW '+@TABLENAME+
    ' WITH ENCRYPTION AS SELECT * FROM OPENROWSET(''SQLNCLI'',''SERVER='+@SERVERNAME+';TRUSTED_CONNECTION=YES;'',''SELECT * FROM '+@DATABASENAME+'.'+@SCHEMANAME+'.'+@TABLENAME+''')'
    SELECT @openquery
    END
    EXECUTE
    sp_executesql @openquery
    END
    ----While running the SP manually below error occured

    HI ,
    1. You cannot use a table or view that contains xml or clr type as 4-part name in your query
    2. You need to cast the column to either nvarchar(max) or varbinary(max) or other appropriate type to use
    3. If you have a table that has xml type for example then you need to create a view that contains all columns other than xml and query it instead. Or you can issue a pass-through query using OPEN QUERY with the appropriate columns only.
    Here is a work around:
    SELECT
          Cast(a.XML_Data as XML) as XML_Data
    FROM
          OPENQUERY([LINKED SERVER NAME HERE],'
              SELECT
                Cast(XML_Data as Varchar) as XML_Data
             FROM
                [DATABASE NAME].[SCHEMA].[TABLE NAME]'
    ) a
    Basically, the data is queried on the remote server, converts the XML data to a varchar, sends the data to the requesting server and then reconverts it back to XML.
    You can take help from below link;
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c6e0f4da-821f-4ba2-9b01-c141744076ef/xml-data-type-not-supported-in-distributed-queries?forum=transactsql
    Thanks

  • Amfphp - flex remote object error event handler

    I'm using amfphp and I want it to return an error that the flex remote object error event handler will pick up. At the moment I can get only the result handler to do anything in flex.

    Hi,
    Try throwing an exception in the remote method. For example,
    function inverse($x) {
        if (!$x) {
            throw new Exception('Division by zero.');
        else return 1/$x;

  • Flex/Air and Web Services/Remote Objects

    If I'm calling a web service operation, either through the
    mx:webservice or mx:remoteobject tags, do I need to configure my
    Flex or Air project (I'm using the latest Flex Builder IDE) with
    the "use remote object access service" when creating the project?
    When do I need to configure services-config.xml or
    remoting-config.xml?
    Can't I simply call a web service operation by specifying the
    endpoint (if using mx:remoteobject) or the wsdl location for the
    service and then invoking one of its methods? I'm having a very
    difficult time consuming a web service through either method (even
    on my own local ColdFusion 8 developer instance) and need some
    assistance. I've looked all over the internet for help, but, so
    far, without success.
    Thanks,
    -Jose

    You do not need to specify any server to use any of the RPC
    protocols.
    Have you looked at an example?
    You have not said what problems you are having.
    Be aware of crossdomain security issues.
    Tracy

  • Exception: Cannot narrow remote object to ...

    Hi,
              in certain circumstances I get an Exception "Cannot narrow remote
              object to <some EJB-Home-Class>".
              My enviroment: weblogic 7.0, solaris, Java 1.3.1, J2EE-application
              (EJBs, Servlets, Database)
              In the init method of an start-up servlet I spawn some threads for a
              scheduler of the application. There are a scheduler core and some
              worker classes.
              The start-up servlet, all the other servlets and the schedulers
              classes are in an web-archive (war-file) in an ear-archiv. Furthermore
              there a some 3rd party archives in the ear-archive, a jndi.properties
              file etc. The manifest file of the war-archive contains a class-path,
              points to the 3rd party archives in the ear-archive.
              The schedulers workers code is simple:
              InitialContext jndiContext = ...getInitialContext();
              Object obj = jndiContext.lookup(<some EJB>);
              - EJBs home interface (for example):
              SyncOrderQueueHome home = (SyncOrderQueueHome)
              javax.rmi.PortableRemoteObject.narrow(obj,
              SyncOrderQueueHome.class);
              - EJBs remote interface:SyncOrderQueue sync = home.create();
              - call some business method
              sync.createOrderQueue();
              In the enviroment described above I get an " Exception: Cannot narrow
              remote object to <package>.SyncOrderQueueHome".
              On the other hand the scheduler and all the workers work fine as a
              standalone application (not in an app-server context) and in Oracles
              app-server (OC4J, v.9.0.3).
              I tried to understand, what for an object I get as the result of the
              JNDI lookup bevore the narrow method fails:
              - in the app-servers context:
              <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl
              - outside the app-server:
              <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl_WLStub
              What happened here? The common servlets use the same functionality and
              work fine. Why I get different objects? Where is the bug?
              Any ideas?
              Thomas
              

    I believe the problem is the threads you are starting are not using the
              context classloader of the current thread.
              -- Rob
              [email protected] wrote:
              > Hi,
              >
              > in certain circumstances I get an Exception "Cannot narrow remote
              > object to <some EJB-Home-Class>".
              >
              > My enviroment: weblogic 7.0, solaris, Java 1.3.1, J2EE-application
              > (EJBs, Servlets, Database)
              >
              > In the init method of an start-up servlet I spawn some threads for a
              > scheduler of the application. There are a scheduler core and some
              > worker classes.
              > The start-up servlet, all the other servlets and the schedulers
              > classes are in an web-archive (war-file) in an ear-archiv. Furthermore
              > there a some 3rd party archives in the ear-archive, a jndi.properties
              > file etc. The manifest file of the war-archive contains a class-path,
              > points to the 3rd party archives in the ear-archive.
              >
              > The schedulers workers code is simple:
              >
              > InitialContext jndiContext = ...getInitialContext();
              > Object obj = jndiContext.lookup(<some EJB>);
              >
              > - EJBs home interface (for example):
              > SyncOrderQueueHome home = (SyncOrderQueueHome)
              > javax.rmi.PortableRemoteObject.narrow(obj,
              > SyncOrderQueueHome.class);
              >
              > - EJBs remote interface:SyncOrderQueue sync = home.create();
              >
              > - call some business method
              > sync.createOrderQueue();
              > In the enviroment described above I get an " Exception: Cannot narrow
              > remote object to <package>.SyncOrderQueueHome".
              >
              > On the other hand the scheduler and all the workers work fine as a
              > standalone application (not in an app-server context) and in Oracles
              > app-server (OC4J, v.9.0.3).
              >
              > I tried to understand, what for an object I get as the result of the
              > JNDI lookup bevore the narrow method fails:
              > - in the app-servers context:
              > <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl
              > - outside the app-server:
              > <package>.SyncOrderQueueEJB_4o6qkf_HomeImpl_WLStub
              >
              > What happened here? The common servlets use the same functionality and
              > work fine. Why I get different objects? Where is the bug?
              >
              > Any ideas?
              > Thomas
              

  • Interrupting a Thread in a Remote Object?

    HI,
    I am trying to get some thread synchronization to happen between a client and a remote RMI object. Essentially what I am trying to accomplish, is that if I interrupt a call on a blocking method in the remote object, I want the thread to throw the InterruptException. For example, the following code represents what I am trying to accomplish:
    package bca.test.rmi;
    import java.rmi.Naming;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class InterruptThreadApp {
    RemoteBlockingObjectInt remote = null;
    public static void main(String[] args) throws Exception {
    //Create the remote object
    RemoteBlockingObject obj = new RemoteBlockingObject();
    //bind it to the registry
    Naming.rebind("rmi://localhost/blocking", obj);
    //start the client, or the thread which will access the blocking call remotely
    InterruptThreadApp app = new InterruptThreadApp();
    Thread blocking = null;
    //wait for the thread to start
    synchronized ( app ) {
    blocking = app.startClient();
    app.wait();
    Thread.sleep(2000);
    //now interrupt the thread (note: the remote object should be blocking in
    //the blockingMethod().. this should produce an InterruptException?
    blocking.interrupt();
    public Thread startClient() {
    Thread t = new Thread("Client") {
    public void run() {
    try {
    //get a handle to the stub
    remote = (RemoteBlockingObjectInt) Naming.lookup("rmi://localhost/blocking");
    //now make a call to the blocking method, but first wake up the client
    synchronized ( InterruptThreadApp.this ) {
    InterruptThreadApp.this.notify();
    //now make the blocking call
    remote.blockingMethod();
    catch (InterruptedException e) {
    System.out.println("WooHoo! This is what we want! But it never gets thrown :(");
    catch (Exception e) {
    e.printStackTrace();
    t.start();
    return t;
    package bca.test.rmi;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.RemoteException;
    import java.rmi.Remote;
    public class RemoteBlockingObject extends UnicastRemoteObject implements RemoteBlockingObjectInt {
    Object obj = new Object();
    public RemoteBlockingObject() throws RemoteException {
    super();
    public void blockingMethod() throws RemoteException, InterruptedException {
    synchronized (obj) {
    System.out.println("About to block.. so we can be interrupted later");
    obj.wait();
    interface RemoteBlockingObjectInt extends Remote {
    public void blockingMethod() throws RemoteException, InterruptedException;
    When I make a call to "remote.blockingMethod()", it blocks in the remote object (buy just "wait" ing). I want to interrupt this thread, by issuing an Thread.interrupt(). When I do so (I call "blocking.interrupt()"), nothing happens... no exception is thrown.. it just silently fails.
    Ok, so I suppose that we can not interrupt a remote thread.. that is fine. But what if I want to interrupt the RMI thread making the remote call? I don't want it to block forever. How can I "cancel" the remote call?
    Ideally, I would like the remote.blockingMethod() call to throw an InterruptException when I issue an "interrupt()" on the blocking thread. Any suggestions on how I might accomplish this?
    Thanks,
    Bryan

    While you can interrupt the RMI call, you cannot stop the active processing. That is, you cannot force a thread to stop (see the Java API documentation on Thread.stop().)
    Since the Client RMI call is a waiting thread, you need another Client thread to do a secondary RMI call. The trick is to have the new RMI endpoint connection thread on the RMI Server interrupt the original RMI endpoint connection thread.
    The only way you can interrupt an RMI call is to have the endpoint connection thread that runs on the RMI Server be aware that the user may wish to interrupt it.
    The best means of interruption is for the endpoint connection thread to use "worker threads". The endpoint connection thread waits for the workers to finish and is interruptible by both the workers and other endpoint connection threads.
    Another means of interruption is for the endpoint connection thread to segment the task into units of work and check for an interruption between those units of work.
    There are two ways I've done RMI call interruption.
    One is for the Client to pass a unique id (UID -- that uniquely identifies the request) to the Server with the original call. When the Client wishes to interrupt the original call, using the separate thread, it does a new RMI call to the Server passing the UID.
    The new endpoint connection thread, using the UID, interrupts the original endpoint connection thread.
    The major problem with this is the unique id. It absolutely, positively must be unique. Otherwise you run the risk of Client_A purging Client_B's request.
    The second method requires callback. If your Client is behind a firewall then RMI callback is near impossible. In such a case you must come up with a way for the Server to call the Client that is secure (the firewall problem.)
    The Client must export a remote object and pass that remote object to the Server with the original call.
    The endpoint connection thread recognizes the remote object and does a call back to the Client passing information that uniquely identifies itself (UID). Since the Server generates the UID, it can guarantee uniqueness.
    The Client callback implementation runs as a separate thread since the Client is in fact an RMI Server itself (when it did the export.) The Client must save the UID. The Client must start a new thread for the interrupt procedure or inform a waiting thread that the Server called back.
    Just like method one, above, when the Client wishes to interrupt the original call, using the separate thread, it does a new RMI call to the Server passing the UID.
    The new endpoint connection thread, using the UID, interrupts the original endpoint connection thread. Simple.
    For an academic example using call back go over to Jini.org. They have an example called "Cancellation" at:
    http://starterkit-examples.jini.org/
    For a professional, open source implementation of both these methods go over to CoopSoft.com. The Tymeac (Java) projects support canceling both waiting and autonomous requests at:
    http://www.coopsoft.com/JavaProduct.html

  • Swiz Flex 4 Remote Object and AMF

    Hi flex gurus,
    Somebody please help me walk through this. Just today I decided to convert my existing flex code to Swiz framework. I have just this one question for the moment, what is the correct way of calling remote object down to Swiz? Please show me some example how to do it. I was thinking to use delegate class after I figure out this one.
    Many thanks in advance.

    The following page describes the scope attribute (and examples of where it should be used) for a destination:
    http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WS3a1a89e415cd1e5d-d524 5eb1221394e36f-8000Update.html
    Starting BlazeDS 4.0 release, there is a single developer guide for BlazeDS and LCDS. Content that only applies to LCDS is indicated in the guide. Developer Guide: Using LiveCycle Data Services 3.1
    Rohit

  • Running one rmiregistry for multiple remote object servers

    Hi,
    I don't find any clear answer for this situation. I want that multiple objet servers (running in separated JVMs) share one rmiregistry placed on a dedicated server. Servers stays in a same network (no firewall at all). If this feature is covered, could you give me any example or link that describe the source code ?
    Thanks very well for yours answers.
    Manuel

    Thanks again for your help, and sorry for my weak usage of english language.
    I've tried to bind some remote objects from distinct 'physical' hosts (or computers) to a dedicated registry located on another host.
    To resume: I want to use one unique registry for multiple remote objects hosts.
    EJP you have posted : But they must all be running on the same host as the Registry.
    After reading again the official rmi tutorial, I found :
    For security reasons, an application can only bind, unbind, or rebind remote object references with a registry running on the same host. This restriction prevents a remote client from removing or overwriting any of the entries in a server's registry. A lookup, however, can be requested from any host, local or remote.
    This confirm that I wanted to do was not possible.
    To override this limitation, do you think it's possible to write a remote object located on the registry host, that propose a method used from other hosts to register their remote objects ? Something like that:
    // Interface
    public interface recordFromHost extends Remote {
        int recordObject(String name, Remote obj) throws RemoteException;
    // Implementation of interface
    public class recordFromHostImpl extends UnicastRemoteObject implements recordFromHost {
        public recordFromHostImpl () throws RemoteException {
            super();
        public int recordObject(String name, Remote obj) {
           int ret=0;
            try {
                Registry registry = LocateRegistry.getRegistry();
                registry.bind(name, obj);
            } catch (Exception e) {
                System.err.println("recordObject exception:");
                e.printStackTrace();
                ret = -1;
        return ret;
    // Server code on registry host
    public class Serveur {
    public static void main(String args[]) {
            // Security manager
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new SecurityManager());
            // Start of registry
            try{
                LocateRegistry.createRegistry(1099);
            }catch(RemoteException e){
                System.exit(1);
            try {
                String name = "recordFromHost";
                recordFromHost myObj = new recordFromHostImpl ();
                Registry registry = LocateRegistry.getRegistry();
                registry.bind(name, myObj);
            } catch (Exception e) {
                System.err.println("bind exception:");
                e.printStackTrace();
    // Code used from a server host to register his remote object in the distant registry
    Registry registry = LocateRegistry.getRegistry(registry host adress);
    recordFromHost  myRecord  = (recordFromHost) registry.lookup("recordFromHost");
    Create local remote object to register (remoteObject : interface, remoteObjectImpl : implementation)
    remoteObject myRemoteObject = new remoteObjectImpl();
    // register myRemoteObject
    myRecord.recordObject("myRemoteObject", myRemoteObject );
    ...Finally, a client who want to use myRemoteObject ask the registry for this object, and use it without limitation : the remote object host will not be the registry host.
    I hope that you understand what I mean :-)
    Manuel

  • Re: replicating non-remote objects

    I don't know if I would necesarily encourage this behavior, but I
              wonder if a SCOPE_CLUSTER workspace would work? At the very least,
              it's worth looking into.
              Jason
              On Thu, 16 Sep 1999 17:29:54 -0500, "Sam" <[email protected]> wrote:
              >I have a hastable storing references of remote objects and other hastables
              >for caching , Can anyone suggest a way to replicate the hastable in a
              >cluster of 2 WL4.5 servers.
              >Is it possible?
              >
              >thanks,
              >Sam Jacob
              >
              >
              

    Alain is correct on both points.
              Alain Rogister wrote:
              > I believe SCOPE_CLUSTER in WorkspaceDef is only a placeholder for things
              > to come, since workspaces are not a clustered service yet.
              >
              > You might think of using JNDI as an alternative to workspaces, but it
              > won't be that easy. Quoting the clustering developer guide:
              >
              > <quote>
              > Note that you cannot reliably use the naming service to replicate
              > objects.
              > For example, if you bind an RMI object "myReplicatedObject" into a
              > cluster-wide JNDI tree, and "myReplicatedObject" from Server One
              > places a serializable -- but not Remote -- object "myDataObject" into
              > the
              > JNDI tree, that unRemoted object does not get replicated to other
              > servers in the cluster. If Server One fails and a client calls
              > "myReplicatedObject," the RMI service will be available, but its
              > "myDataObject" will not.
              >
              > If you need to guarantee access to some data that is produced or used
              > by a replicated object, you should store the data in a database so that
              > it
              > can be reached by any server in the cluster that is hosting the
              > replicated
              > service. An example of this is an entity EJBean.
              > </quote>
              >
              > Alain.
              > --
              > Alain Rogister
              > Ubiquity s.a.
              > http://www.ubiquity.be
              =====================================================
              Reply to the newsgroup. Don't reply to this mail
              alias. This is used only for answering posts on
              WebLogic Newsgroups.
              =====================================================
              

Maybe you are looking for

  • Home directory on USB key?

    Hi all, A friend suggested this idea and it seems like a good idea, I was wondering if something similar already exists or what your opinion of it would be. The idea is as follows: suppose you could have your home directory on a USB key. To log in on

  • Does not do the sorting if I click twice to the same column.

    Hello I am new to winforms. I have a listview. I want it to toggle the sorting of the records of the listview when the columns are clicked Please guide me as to how to do the same. The code that I have attached does not do the sorting if I click twic

  • Ipod Classic 80 gb

    When the battery finally dies on my favorite iPod, will it be replacable? thanks if you know

  • Internet Explorer: Java Console Not showing

    Hello, I'm curious why my java console is not displaying when i click on it? Internet Explorer: View: Java Console and it doesn't work does anyone know why this maybe? Thank you...

  • Comunnication between java and other languages, like clipper?

    can I easily communicate and send information from a java-applet to another program, written in clipper (dos)(and vice-versa)? Is it possible to do this with native programming?how? thanx, bart