Client Listener on subview

Hi All,
I have one .jspx page which has <af:document> tag and client Listener , Server Listener on page load action and inside the page i am calling the Page Fragments through <f:subview> tag ,the fragments has <f:form > tag.
If the fragments has html code inside it , it is giving me the error "the connection to the server has failed:403". My question is where i need to put the Java script , Client Listener and server Listener whether i need to put in page fragments or in .jspx page.
I am using Jdev 11.1.2.2.0
Thanks in Advance,
Suganya.

Hi Don Kleppinger ,
Thanks for your reply i tried what you suggested , the main page.jspx look like this
<af:clientListener method="loadpage" type="load"/>
<f:facet name="metaContainer">
<af:resource type="javascript" source="resources/js/pageLoad.js">
</af:resource>
</f:facet>
<af:serverListener type="loadpage_action" method="#{viewScope.login.loadpage_action}"/>
But still i am receiving the error."A connection to the srever has failed (status:403)
<RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #2
java.lang.NullPointerException
     at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager.getRedirectCookieForPartialRequest(RichWindowManager.java:1222)
     at oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator.__writeRedirectExtension(RegistrationConfigurator.java:547)
     at oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator.__sendRedirect(RegistrationConfigurator.java:526)
     at oracle.adfinternal.view.faces.config.rich.XmlHttpServletResponse.sendRedirect(XmlHttpServletResponse.java:56)
     at oracle.adf.share.http.ServletEnvironment.redirect(ServletEnvironment.java:158)
     at oracle.adf.share.security.authentication.JEEAuthenticationService.login(JEEAuthenticationService.java:79)
     at oracle.adf.share.security.providers.jps.JpsAuthenticationService.login(JpsAuthenticationService.java:67)
     at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:282)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:171)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
     at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
     at weblogic.servlet.internal.ForwardAction.run(ForwardAction.java:22)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.security.internal.FormSecurityModule.sendError(FormSecurityModule.java:395)
     at weblogic.servlet.security.internal.FormSecurityModule.processJSecurityCheck(FormSecurityModule.java:262)
     at weblogic.servlet.security.internal.FormSecurityModule.checkUserPerm(FormSecurityModule.java:213)
     at weblogic.servlet.security.internal.FormSecurityModule.checkAccess(FormSecurityModule.java:96)
     at weblogic.servlet.security.internal.ServletSecurityManager.checkAccess(ServletSecurityManager.java:82)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2213)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Thanks,
Suganya.

Similar Messages

  • 10g Client listener isn't configuring properly

    Hi all! Here's my problem:
    My workstation is named gubbs09 is on a domain named gubbsinc on my home office lan. It's OS is XP SP2. I've installed 10.2.0 client on gubbs09. I created a listener called LISTENER using the Net Configuration Assistant Tool. I'm trying to communicate with an Oracle 10g database (SID guwuprod1) on another workstation named gubbslap03.
    When I try to communicate with guwuprod1, I get listener errors.
    Upon investigation, I've found that LISTENER on gubbs09 is not listed in the services control panal. If I try to start the listener from a command prompt using the command "LSNRCTL start", I get this error message: 'LSNRCTL' is not recognized as an internal or external command.
    Anyone know what's going on? I'm not a very knowledgeable Oracle user. Does a client even need a listener?
    Thanx for any help!

    I would suggest checking your path
    lsntctl notmally reside in $ORACLE_HOME/bin
    on your workd station you need to add that to the path as well as establish a libpath . but the question is your subject state 10g client listener. a listener is a server level entity not a client uses a tnsnames.ora files to connect to a server where a listener is running. unless you have an oracle database sitting on your workstation you probably dont need a listener.

  • How can I force valueChange in client listener to fire

    I've ADF fusion web application version 11.1.1.6 and I've input text it value is
    #{row.bindings.ManagerId.inputValue == 1}and client listener on it
            <af:inputText id="it12"
                          value="#{row.bindings.ManagerId.inputValue == 1}" clientComponent="true">
              <af:clientListener method="testmethod" type="propertyChange"/>
              <af:clientListener method="testmethod" type="valueChange"/>
            </af:inputText>when I change in another field this field value is changed to true or false
    I want to fire my client listener when this el is changed "row.bindings.ManagerId.inputValue == 1"
    this EL is changed automatically not with my hand so the client listner is not fired
    is there any way to fix this.

    I think there is misunderstanding
    The problem is that
    I've two columns in my table
    First One :Managed Id its value is
    row.bindings.ManagerId.inputValueSecond One:Transient attribute named IsManager its value is
    #{row.bindings.ManagerId.inputValue == 1}when I change in Manager Id (The first column)
    The second column (Is Manager) value is changed to true or false.
    I've tried to add client listener on IsManager to fire some javascript
    or add value change listener to fire it but these listeners are not fired because I didn't change in this field with my hand.
    its value is changed according to the first column value.
    I want to fire any listener on this column.

  • Invoking client listener from javascript

    Hello,
    I am using ADF Faces 11g.
    I wonder if it is possible to invoke a UI control's client listener from javascript method. For example i have a command link with a client listener, defined like this:
    <af:commandLink id="cl1" text="click here" partialSubmit="true">
    <af:clientListener method="onClickLink" type="action"/>
    </af:commandLink>
    I can find the control in a javascript method, with this: AdfPage.PAGE.findComponent("cl1");
    Now i want to invoke the onClickLink(event) method. How can i do it?
    Thanks.

    Isn't this just calling onClickLink(event)?
    Or do you want to know how to get the function the client listener calls?
    May be you should take a look at http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/classic_api_mistakes_part2/classic_api_mistakes_part2.html
    At about min 35 of he video Frank shows something like what you like to do (as fas as I recall).
    Timo

  • Using client listener on page level

    Hello All,
    I am having a jspx page and i am able to add client listener on individual components but my requirement is i want to add a client listener on page level so that when I run the page, through client listener lets say on keydown it will call a javascript and do the required action.
    But I am not able to add client listener on entire page region. It is not working. Is there any solution or workaround?
    Thanks
    -- Navin Kumar

    dup to {thread:id=2287973}

  • Client Listener on MouseOver

    Hello,
    I posted in a wrong forum previously, I am posting it here again..Kindly reply.
    Requirement : I need to Create a command button and when you hover your mouse on it, a function has to be called . Everything has to be done programmatically.
    My Procedure: I have already created a RichCommandButton programmatically with a binding to a method(HandleImagePress) which triggers when I click the button. This method inturn creates, populates and displays the necessary information in the form of a popup. However , With the new requirement, I am just supposed to hover onto my button to trigger this method (HandleImagePress). I believe I need to create ClientListener and so I tried it. But it doesnt work the way I want ...
    This is what I have tried:
    public void handleImagePress(ActionEvent event){
    // There is code to create , populate and display and popup . It works fine
    private UIComponent ImageButton(UIComponent parent){
    RichCommandButton img = new RichCommandButton();
    String imagestyle = "width:120pt; height:120.0pt;margin:10.0pt;";
    img.setInlineStyle(imagestyle);
    // Compose method expression to invoke action event handler when button is pressed.
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ExpressionFactory elFactory = application.getExpressionFactory();
    ELContext elContext = fctx.getELContext();
    MethodExpression methodExpression =null;
    // Make sure the EL expression references a valid managed bean method. Ensure the bean scope is properly addressed.
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {ActionEvent.class});
    // Create the command button action listener reference.
    MethodExpressionActionListener al = null;
    al= new MethodExpressionActionListener(methodExpression);
    img.addActionListener(al);
    // Add new command button to parent component and PPR the component for the button to show.
    parent.getChildren().add(img);
    ClientListenerSet set = img.getClientListeners();
    if (set == null) {
    set = new ClientListenerSet();
    img.setClientListeners(set);
    set.addBehavior("new AdfShowPopupBehavior('popup',AdfRichPopup.ALIGN_AFTER_END,null,'mouseOver')");
    // set.addListener("mouseOver", "handleImagePress");
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    adfFacesContext.addPartialTarget(parent);
    return img;
    With this code, I need to click on image atleast once to create a popup . Is it possible to call the method without clicking but by just hovering on it? (bcoz the HandleImagePress method takes care of everything regarding to popup)
    Help will be greatly appreciated
    Thank You

    I have tried adding a Mouse event instead of an Actionevent this way ..
    public void handleImagePress(MouseEvent event){
    int m = event.MOUSE_ENTERED;
    System.out.println(m);
    System.out.println("--mouse clicked");
    System.out.println(event.MOUSE_CLICKED);
    //code to create , display, popup
    private UIComponent ImageButton(UIComponent parent){
    //I have changed the following line..
    methodExpression = elFactory.createMethodExpression( elContext,"#{pageFlowScope.pinint.handleImagePress}",Object.class,new Class[] {MouseEvent.class});
    But it complains java.lang.IllegalArgumentException: argument type mismatch, when I click on the button.
    Please let me know of a work around with this issue.

  • Bittorrent error: "no/erroneous BT client listening"

    I port mapped my Airport Extreme (n). My Bittorrent client shows that the port is open.
    But DaD reports the error above.
    I'm getting good dl/ul speeds. I just can't figure out how to clear the error. Everything seems to be checking out ok.
    Thoughts?

    Hi Bob,
    Sorry for my delay.
    Based on your description, I understand that you have verified port 65500 was opened on server. Meanwhile,
    be unable to browse https://acesrv01:65500/CertWebservice.svc
    on client. If I misunderstand, please don’t hesitate to let me know.
    Based on current situation, please check Windows Firewall profile. Windows Firewall profile may block access
    to the CertWebservice.svc website. Please disabled Windows Firewall profile on server and then monitor the result.
    Hope this helps.
    Best regards,
    Justin Gu

  • Oracle Web Center Portal - af:showDetailItem/ Client Listener using Javascript

    Dear,
    I wonder if it is possible to run a JavaScript function whenever a tab is selected in the component <af: panelTabbed /> which contains components <af: panelTabbed /> I need to run the function each time you select a tab, it is possible this??
    Here my example:
    <af:resource type="text/javascript">                                                   
                        function alertTabSwitch(disclosureEvent){
                            var tab = disclosureEvent.getSource();
                            if(tab.getDisclosed()==true){
                               alert("test tab : " + tab);
                               disclosureEvent.cancel();                         
    </af:resource>
    <af:panelTabbed id="pt1" styleClass="detalleAutoridad" dimensionsFrom="auto">
          <af:showDetailItem text="#{portalBundle.BIOGRAFIA}" id="sdi1" disclosed="true"  persist="disclosed" clientComponent="true">
    Thanks,
    Best Regards.

    Here is the code snippet, which is will call every time you click the tab.
    <af:resource type="javascript">
    function performOnTabSwitch(disclosureEvent){
        var tab = disclosureEvent.getSource();   //This is the tab to close
        if(tab.getDisclosed()==true){
           alert(tab);
           disclosureEvent.cancel();
    </af:resource>
          <af:panelTabbed id="pt1">
                <af:showDetailItem text="FirstTab" id="sdi1" disclosed="true" stretchChildren="first"
                                   clientComponent="false">
                                   First Tab
                    <af:clientListener method="performOnTabSwitch" type="disclosure"/>
                   </af:showDetailItem>
                <af:showDetailItem text="SecondTab" id="sdi2" stretchChildren="first" clientComponent="false">
                Second Tab
                <af:clientListener method="performOnTabSwitch" type="disclosure"/>
                   </af:showDetailItem>
            </af:panelTabbed>
    -K

  • A listening J2ME client ???

    How can I implement, that a Java client listens for incoming messages (HTTP, UDP, WAP) and reacts to them? I want to build a database which can be accessed from many users using their Javaphones in some way. If some user changes data, all other connected Java clients should be informed and updated.
    Does that work with WAP PUSH? I realised that the MIDP/CLDC provide UDP, that offers the DatagramConnection interface which can be used in server and in client mode.
    Has anybody some good ideas?

    Hi,
    You'd better read " Advanced MIDP Networking, Accessing Using Sockets and RMI from MIDP-enabled Devices " article on http://wireless.java.sun.com/midp/articles/socketRMI/.
    This article:
    Gives you a brief overview of CLDC and MIDP Networking
    Discusses a middleman architecture for using sockets, RMI, and other Internet services
    Shows you how to use sockets from MIDP-enabled devices
    Shows you how to send emails from your MIDP-enabled device
    Shows you how to use RMI from MIDP
    Take care,
    Faruk

  • Multiple clients on socket connection

    Hi!
    I understand that it is possible that multiple clients listen to one server (on the same port) and even write to it (then it should be a multi-threaded server).
    But i would like to refuse connectios, if one client is connected. How can I do that?
    In my case I have a (single threaded) server. Now one clients connects. The server waits to receive data from the client and answers, without ever closing the port. that works.
    Now if I connect with a second client, the openicng of the socket in the second client works fine, although the server does not seem to notice the second client. Communication is not possible between the server and the second client, and the server doesn't answer to the first client anymore, although he receives data from it.
    So, since the server does not seem to notice the second client (does not accept the connection) and I don't get an exception at the second client, what can I do?
    Thank you for your help!
    concerned Code (if you want to take a look at it):
    CLIENT:
    socket = new Socket(hostname, echo_port);
    SERVER:
    try
    ServerSocket waitingsocket = new ServerSocket(echo_port);
    try
         socket= waitingsocket.accept();
         System.out.println("Client connected");
         ReaderThread reader = new ReaderThread( this, socket );
         reader.start();          
    catch (Exception e)
    READER:
    public void run()
         while (true)
              try {
                   int bytesRead = inStream.read(inputBuffer,
                   0, inputBuffer.length);
                   readCallback.tcpUpdate(inputBuffer,bytesRead);
              catch (Exception oops)
                   readCallback.tcpUpdate(null,-1);
              

    Just to make sure this is clear: You can NOT have multiple clients on a given socket connection. You CAN have multiple clients connected to a particular port on a given server, but each client will be communicating with the server through a different of socket.
    The usual approach here is to set up a listening ServerSocket on the desired port, call accept() on it, then process the communication from the returned Socket object. This is usually done by spawning a new thread and allowing it to handle the socket communication, while the ServerSocket loops around to another accept() for the next communication.
    Here's an excellent intro to the concepts (the code is really ugly and poorly implemented, but it does a good job of explaining the overall concept). I used this as a starting point, and now (after a whole lot of development) have a pretty sweet extensible web server class that handles template expansion, etc... (I use this as a quick and dirty UI for some of my apps, instead of requiring the user to install a JSP container):
    http://developer.java.sun.com/developer/technicalArticles/Networking/Webserver/
    - K

  • How can I implement two TCP/IP servers (on two separate machines) and one TCP/IP client (on third machine)

    I have an application where I need to send data via TCP/IP from two separate machines to a third machine. The machines are on a local area network connected through a network switch. The data are generated independently through data acquisition by the two independent machines before are sent to the client on third machine. Each machine has one network card. Thanks.
    Solved!
    Go to Solution.

    If you have three separate machines, you don't need to use separate ports.  They will have three IP addresses.
    Remember this rule: TCP connections are EXACTLY like telephone connections.
    Have your client open two connections: same port on two different IP addresses.
    Each client listens for connections.
    After connections are established, you get to decide the protocol:  maybe the client should explicitly ask for data, maybe the servers just dump it without being asked. It's up to you.
    Read this:
    TCP tips and tricks
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • JMS with Distributed clients.

    I am planning on having JMS Queues in a cluster and a business component [EJBs] in a separate cluster.
    I have distributed clients listening on a topic and when they get the message they process it and put the result on the Queue in my cluster.
    One of my business components from the business components cluster gets that result from the queue and processes it.
    Problem:
    My requirement is to send a message to 2 of my distributed clients and when they process the message and put the results in the Queue, I want the results from both the clients to be processed by the same business component in the cluster.
    Is it possible?
    Thank you.
    Edited by: user10510140 on Dec 9, 2010 12:49 PM

    You will have to use MessageSelectors.
    ram.

  • Client/server socket based application

    hi does anyone have example of client/server socket based application using Spring and Maven
    where application do the following
    Client sends a request with a path to any file on the server
    „h Server reads the file and responds back with the content
    „h Client outputs the content to the console
    am trying to follow this
    http://www2.sys-con.com/itsg/virtualcd/java/archives/0205/dibella/index.html
    http://syntx.io/a-client-server-application-using-socket-programming-in-java/
    am using java 6

    i have attempt code but i wht to do the following
    client/server socket based application that will read the content of a file and stream the content of the file to the client. The client must simply output the content of the file to the console using System.out. The client must be able to run in a standalone mode (non-network mode) or in a remote mode.
    Additionally the client must be designed in a way that i can print the output to a console but must be interchangeable where if requirements change i can persist the response to file or persist the response to a database.
    /* Server.java*/
    ///ifgetBoolen= true then...
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.sql.*;
    public class Server
        static String array[][];
        // STEP 1 a1  
        // Server socket
        ServerSocket listener;
        // STEP 1 a2 Client connection
        Socket client;
        ObjectInputStream in;
        ObjectOutputStream out;
        public void createConnection() throws IOException
                System.out.println("\nSERVER >>> Waiting for connection.....");
                client = listener.accept();
                String IPAddress = "" + client.getInetAddress();
                DisplayMessage("SERVER >>> Connected to " + IPAddress.substring(1,IPAddress.length()));
          public void runServer()
            // Start listening for client connections
            // STEP 2
            try
                listener = new ServerSocket(12345, 10);
                createConnection();
                  // STEP 3
    //              processConnection();
            catch(IOException ioe)
                DisplayMessage("SERVER >>> Error trying to listen: " + ioe.getMessage());
        private void closeConnection()
            DisplayMessage("SERVER >>> Terminating connections");
            try
                if(out != null && in != null)
                      out.close();
                    in.close();
                    client.close();                
            catch(IOException ioe)
                DisplayMessage("SERVER >>> Closing connections");
        public static void define2DArray(ResultSet RS, int Size)
            try
                ResultSetMetaData RMSD = RS.getMetaData();
                DisplayMessage("SERVER >>> Requested arraySize: " + Size);
                if (RS.next())
                    array = new String[Size][RMSD.getColumnCount()];
                    for (int Row = 0; Row < Size; Row++)
                        for (int Col = 0; Col < RMSD.getColumnCount(); Col++)
                            array[Row][Col] = new String();
                            array[Row][Col] = RS.getString(Col+1);
                            DisplayMessage(array[Row][Col] + " ");
                        RS.next();
                else
                    array = new String[1][1];
                    array[0][0] = "#No Records";
            catch (Exception e)
                DisplayMessage("SERVER >>> Error in defining a 2DArray: " + e.getMessage());  
        public static void DisplayMessage(final String IncomingSMS)
            System.out.println(IncomingSMS);
    //client
    * @author
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class ClientSystem
        static Socket server;
        static ObjectOutputStream out;
        static ObjectInputStream in;
        static String Response[][];
        static boolean IsConnected = false;
        static int Num = 0;
        public static void connectToServer() throws IOException
            server = new Socket("127.0.0.1", 12345);
    //        server = new Socket("000.00.98.00", 12345);
            String IPAddress = "" + server.getInetAddress();
            DisplayMessage("\nCLIENT >>> Connected to " + IPAddress.substring(1,IPAddress.length()));
        public static void getStreams() throws IOException
            out = new ObjectOutputStream(server.getOutputStream());
            out.flush();
              in = new ObjectInputStream(server.getInputStream());
              IsConnected = true;
              DisplayMessage("CLIENT >>> Got I/O streams");  
        public static void runClient()
            try
                connectToServer();
                getStreams();
                  DisplayMessage("CLIENT >>> Connection successfull....\n");
                  DisplayMessage("CLIENT >>> Want to talk to server");
            catch (IOException ioe)
                System.out.print("."+Num);
                Num++;
        public static void closeConnection()
            try
                out.close();
                in.close();
                server.close();  
            catch(IOException error)
                DisplayMessage("CLIENT >>> Could not close connections");
        public static void Start()
            System.out.print("\nCLIENT >>> Attempting connection.....");
            try
                IsConnected = false;
                while (IsConnected == false)
                    runClient();
                    if (IsConnected == false)
                        Thread.sleep(100);
            catch (Exception e)
                DisplayMessage("CLIENT >>> Attempting connection.....");
        public static String sendSMS(String sms)
            Response = new String[0][0];
            try
                DisplayMessage("CLIENT >>> " + sms);
                out.writeObject(sms);
                out.flush();
                Response = (String[][])in.readObject();
                DisplayMessage("CLIENT >>> Waiting for server to respond...");
                for (int Row = 0; Row < Response.length; Row++)
                    System.out.printf( "_SERVER >>> \t");
                    for (int Col = 0; Col < Response[Row].length; Col++)
                        //DisplayMessage( "_SERVER >>> " + Response[Row][Col] + " ");
                        System.out.printf( "%s\t", Response[Row][Col]);
                    System.out.println();
                DisplayMessage("CLIENT >>> Query processed successfully....\n");
            catch(ClassNotFoundException cnfe)
                DisplayMessage("CLIENT >>> Class not found for casting received object");
            catch(IOException ioe)
                reConnect();          
            catch (Exception sqle)
                DisplayMessage("CLIENT >>> Error sending query ??? " + sqle.getMessage());
            return "transmission successfull";
        public static void reConnect()
            try
                DisplayMessage("CLIENT >>> Connection was lost. Trying to reconnect...");
                closeConnection();
                Thread.sleep(100);
                IsConnected = false;
                while (IsConnected == false)
                    runClient();
                    Thread.sleep(200);
            catch (Exception e)
                DisplayMessage("CLIENT >>> Error trying to Re-Connect...");
        public static void DisplayMessage(final String IncomingSms)
            System.out.println(IncomingSms);
        System.out.printf("Isms: %s", IncomingSms);  ///naah.
        public static String[][] getResponse()
            return Response;
        public static String getResponse(int row, int col)
            return Response[row][col];
    how can i do below using above code
    The program must be able to work in a non-networked mode. In this mode, the server and client must run in the same VM and must perform no networking, must not use loopback networking i.e: no “localhost” or “127.0.0.1”, and must not involve the serialization of any objects when communicating between the client and server components.
    The operating mode is selected using the single command line argument that is permitted.
    imust use a socket connection and define a protocol. networking must be entirely bypassed in the non-network mode.

  • How can a JMS Listener Notified get when a Topic Server Goes Down?

    I'm in the process of looking into pub/sub model for a centeralized data source where vertical applications subscribe to a topic to get updates on person demographic information.
              I was playing with the JMS topic examples and noticed that when I have a Durable Subscriber listener (java main) and the topic Server goes down. It never gets notified. When I restart the Topic server and send msgs to the topic, the Durable Listener doesn't get them.
              Once I restart the Durable Listener (java main), it receives all the messages that were pending.
              I implemented the ExceptionListener and it never gets a shutdown msg either. I shutdown the Topic server via Ctrl-C, Graceful Shutdown and Forced Shutdown.
              Is there a way for the client listener to determine when the Topic Server went down, came backup, and restore the connection to it automatically? Or do we have to implement some type of ping mechanism on the client listener and re-create the connection ourselves?
              Thanks. Later...
              - Wayne
              Edited by wlau1000 at 03/07/2007 8:34 AM

    Hi Wayne,
              I think the exception listener should have fired. Some comments/questions:
              - Does your app call "connection.setExceptionListener" in addition to implementing ExceptionListener?
              - Which version and maintenance/service pack are you using?
              - Is the client using the wl* "thin" client jars or the "thick" client jar?
              - Version 9.2 provides an automatic reconnection capability for consumers. This behavior isn't enabled by default due to natural side effects that some apps might not be prepared to handle (needles to say, I recommend reading the doc thoroughly).
              http://edocs.bea.com/wls/docs92/jms/recover.html#wp1320125
              Tom

  • Chat Server and Client Design

    Ola,
    I just want to make a simple Chat Program for intranet (LAN). I'm planning to use socket connection. What would be a good design for Chat Program? Both the Client and the Server are Java Application.
    Here is the diagram that I have in mind:
    ---- First the client login to Server:
    [Client A] ----> [Server]
    [Client B] ----> [Server]
    ---- Then Server add client in the container, Server put each connection from client to separate Thread, so it can handle multiple clients.
    ---- Then let's say Client A send message to Client B (or others). Server get the message from Client A, and my problem is how to get the Server to send the message to B. The only way that I know is to make each client act like its own server and listening to certain port number. That way the server can send the incoming message directly to the client.
    [Client A] ------> [Server] -----???---> [Client B]
    At this point I just have the Server listening to a port (ex. 10000). Should I have each client listening to a port number?
    Another design that I have in mind is to have only Server listening to port 10000. And have the client to poll the Server (ex. every 2 seconds) to check whether the server has new message for the client.
    The last design that I was considering is using RMI.
    Which approach that will best fit my case? What is the ideal design for making chat client server program? If you know any URL or Books that explains all these issue, please post them here. Any help will be appreciated.

    My approach (with tcp sockets) was the following:
    The server has two serversockets running.
    The client connects at the first one, which it will use
    for sending (any messages) and receiving a reply from the
    server ( an "ok" confirmation or so) .
    The client then connects at the second serversocket,
    which it uses for listening to the server.
    The second socket then also can be used for "alive" calls
    from the server periodically ( to kick out users, who
    have lost connection silently)
    Also the second socket, of course, is used as broadcast channel.
    Broadcasted messages can contain chat messages, information
    about a user, which has logged in or out ..
    When the server receives a (chat)message from a client, it
    first enters that message in its model and then broadcasts
    this message ( or more generally the changes in its model)
    to all clients including the client, who has
    sent the message, which only displays the message, when he
    has received it back from the server.
    This way, the order of messages displayed is the same for
    all clients - its a sort of synchronization process.
    Also, you don't need different ports ( for anything in principle ).
    Port 80 is enough.
    For multiple connections, you can send an integer as first
    data transfer, which acts as "virtual portnumber" and the
    receiver then can forward the socket to the associated threads.
    One thing to note for the broadcast process is, that you
    can't simply broadcast the messages in a loop, because this
    way, one veeery slow client would slow down the whole
    server. Therefore you will have to use threads for that.
    In the old (jdk1.3) way, the server would create a thread
    for each user who connects at the first serversocket,
    pass the socket (which it gets from the accept() method )
    to that thread, and this thread then would block while
    trying to receive, and after it had received something,
    it would call a synchronized method from the server,
    in which the server datamodel would be updated and
    broadcasts would be started ( in an other thread context ).
    A good way to speed up chat systems with heavy load is
    to use MultiCast sockets. But then you would have to
    use Datagrams (UDP).
    Another problem arises, when you want to go through
    firewalls. RMI has probs, and bidirectional transfer
    isn't allowed (some firewalls allow 1 request followed by
    1 answer and then cut the connection to my knowlegde)
    It's possible, but it's more complicated.

Maybe you are looking for