Client server stuff - but simple -Duke $10 offered

Hi folks
I want to count # of times a method in server is called by the client.
In the server code I put a count and in each method implementation I increment count.
I am getting following errors for the count ..
CalculatorImpl.java:44: cannot resolve symbol
symbol : variable count
location: class CalculatorImpl
count++;
^
PLEASE HELP ME>>>>>
---------------here's the code -----------
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class CalculatorImpl
extends UnicastRemoteObject
implements Calculator
public static void main (String[] args)
     int count;
try {
new CalculatorImpl ().go ();
} catch (Exception e) {
System.err.println (e);
private void go ()
throws MalformedURLException, RemoteException
Naming.rebind ("rmi://127.0.0.1/CalculatorImpl", this);
public CalculatorImpl ()
throws RemoteException
public int add (int x, int y)
throws RemoteException
     count++;
return x + y;
public int sub (int x, int y)
throws RemoteException
     count++;
return x - y;
public int mul (int x, int y)
throws RemoteException
     count++;
return x * y;
public int div (int x, int y)
throws RemoteException
     count++;
return x / y;
public int report ()
throws RemoteException
return count;
public void reset ()
throws RemoteException
count = 0;

Kuno
Can you let me know what is your opinion on following...
I have a simple client Server code running (Loop back IP is used in Name.bind) in 2 windows, third window rmiregistry is running to lookup for the remote object.
Say another second client come in while the first client is in the middle of the code...
1) What will happen ?
2) Will both clients get their own objects seperately ?
3) How do they track the use of a method in the remote object ?
Thanks a bunch...

Similar Messages

  • Basic client Server stuff

    Say i have two classes class A and class B. class B is a server that is run on computer (comp1) and then i run class A a client on both Comp2 and Comp3. How do I ,
    Comunicate with the server (class B) on comp1?
    Share variables and other information between comp2 and comp3 by means of classB on comp1
    and how to I properly close the connection after these goals are accomplished.
    If someone could post a good tutorial covering these things or simply explain it themselves it would be greatly appreciated, Thanks for taking the time to look at this post.
    -Dizzixx

    Google is very good at answering these types of questions.
    http://www.google.com/search?q=java+client+server+tutorial

  • Help about forms 9ids running in client/server

    I have forms 9ids and can i run the forms in client/server mode but not in web?

    iDS Release 1 contains Forms 6i. It can run in character mode, client/server mode, or web mode.
    iDS Release 2 containts Oracle9i Forms. It is web only.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Calling Web Form from Client-Server Form

    Hi. I have an existing Client-Server Form (6i) still in production that needs to call a Web Form and pass it a parameter. Obviously I can't use Call Form or New Form from the client-server version, but can I somehow issue a command line (including a parameter) that opens the Web Form? Any suggestions for accomplishing this?
    I can create a command line like this, but have no idea how to pass a parameter to my Web Form. The Web Form named participants which has a Parameter defined named 'p_participant'.
    *"C:\Program Files\Internet Explorer\iexplore.exe" http://9.35.32.206:7777/forms/frmservlet?form=participants*
    I can also create a command line to open a web form like this to:
    *"C:\Program Files\Internet Explorer\iexplore.exe" http://9.35.32.205:7777/forms/html/sas2.htm*
    Where the sas2.htm looks like this:
    *<html>*
    *<body onload="document.menulaunch.submit();">*
    Launching File Generation...
    If the application does not load in 30 seconds then click the button below:
    *<form name=menulaunch action=http://9.35.32.205:7777/forms/frmservlet?config=FileGeneration method=post>*
    *<script>*
    var wshshell=new ActiveXObject("wscript.shell");
    var username=wshshell.ExpandEnvironmentStrings("%orauser%");
    var pw=wshshell.ExpandEnvironmentStrings("%orapass%");
    document.write("<input type=hidden name=userid value="+username+"/"+pw+"@sparc20*>")*
    *</script>*
    *<input type=submit value=Launch>*
    *</form>*
    *</body>*
    *</html>*
    Any help would be greatly appreciated.
    Edited by: Buechler on Apr 8, 2009 8:58 AM

    Simply add to your URL as follows:
    http://9.35.32.206:7777/forms/frmservlet?form=participants&otherparams=p_participant=<SOME VALUE>I assume you plan to use HOST to make this call. I would recommend something like this:
    HOST ('cmd /c start iexplore.exe "http://9.35.32.206:7777/forms/frmservlet?form=participants&otherparams=p_participant=<SOME VALUE>"');

  • Run a report made in Rerports 9i in client/server environment

    Hello
    I need to run a report made in Reports 9i in a client/server environment, but we don´t want to install the developer suite. Reports 6i had a runtime tool how can i do in Reports 9i?
    PD: si alguien me puede responder en español seria fantastico.
    Thank you
    Angelo J. Gonzalez

    In client server mode you can use RUN_PRODUCT built-in. Lookup help for this built-in for more details.
    Best of luck!

  • I dont have data in "Client status summary" report for servers in server collection, but get data from our Windows 7?

    Hi,
    I dont have data in "Client status summary" report for servers in server collection, but get data from our Windows 7?
    So and idea of way I dont get data from or servers? Missing client setting for servers?
    /SaiTech

    Hi,
    I do see the server in Server collections in "Monitoring--Client Status--Client Activity" but not in reports like "Clients with failed client check details" i get "No Data Available"?
    /SaiTech

  • Please tell me how to use the Simple bluetooth client server example.

    Hi i used the simple bluetooth client server example in labview 7.1. Iam getting an error saying your system does not support the network operation.  I have following doubts also.
    1. Should i pair the device before running the labview.
    2. Should i enable the file transfer wizard in the software given with the bluetooth adapter.
    Please help
    Thank you
    R.Prem kumar 
    09940446193

    Hi R.Prem,
    Could you please let me know what error code is associated with this error message? Also could you please provide a description of the setup you are currently using? Thanks!
    Best regards,
    Steven

  • Error deploying a composite to a clients server

    Hi,
    I'm having trouble deploying a composite to a clients server.
    I've defined the Configuration Plan to change all the references from our server to the clients server.
    The composite has some references to webservices deployed on the same server. I can test those webservices on the Enterprise Manager and they work.
    The error when I try to deploy is the following:
    Deploying on partition "default" of "/Farm_bpm_domain/bpm_domain/soa_server1" ...
    Deploying on "/Farm_bpm_domain/bpm_domain/soa_server1" failed!
    Error during deployment: Deployment Failed: Error occurred during deployment of component: ServiceTest2Process to service engine: implementation.bpmn for composite: ServiceTest2Composite: ORABPEL-05250
    Error deploying BPMN suitcase.
    error while attempting to deploy the BPMN component file "/oracle/product/fmw/11.1.1/bpm/user_projects/domains/bpm_domain/deployed-composites/ServiceTest2Composite_rev1.0/sca_ServiceTest2Composite_rev1.0/soa_68135a9a-c6b0-4982-99de-2eb366875b5d"; the exception reported is: java.lang.IllegalArgumentException: Conversation is not properly defined. There are not operation/process or external services defined
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    .The logs on the server (set to TRACE:32 (FINEST)) don't add anything to the error message.
    Anyone has had the same problem or has any ideia what might be the problem?
    Thanks in advance,
    Diogo Henriques

    Hi
    Can't offer much help but I just got exactly the same problem also. I just made a minor modification to a simple BPMN Test process. The change involved adding a Script Task and changing the assignment to the Output Argument of a Sub-Process. This change should not have caused any change to the service interface of the process. This was on a local Dev box.
    The process does call a Web Service. It was deploying/executing without error at last WLS boot a day ago, the Web Service is running fine and the process is building without error. There have been no other changes.
    This seems to be some kind of deployment versioning or stale caching related bug. I just undeployed the current version via EM (which actually reported a failure during undeployment but undeployed anyway!) and rebooted WLS and the deployment was then successful.
    See also Error deploying 2 processes in the same project BPM 11gR3 Project
    I suspect both of these are symptoms of the the same underlying problem which show up when there are repeated deployments of the same process after changes - regardless of whether you overwrite the existing version or start a new one.
    Regards
    Jim Nicolson

  • Client/Server API with push?

    I set up a simple Socket client server architecture with the Java socket API. However, my clients sometimes are initiators or requests, and sometimes my server is the initiator of infos. Example: client want to get infos from server but also want to tell the server something. The server tells all registered clients something but also can accept requests from clients. So both sides are client AND server (depending on what they currently want to do).
    The socket API is just a classic client/server API, i.e. a server listens and a client sends requets and get responses. For my server to send requests to all clients, this is not enough. Is the only way to have all clients offering a socket server on their computer, too? so that this 2-way-request-communication works?
    This is basically some kind of "push" technology, but i don't want my clients to "poll" the server just to emulate the feature of sending requests from the server to the client. Is there some other (perhaps non-socket) API that offers this?

    @sjasja: how is the socket api symmetrical?It is, trust me! Connection initiation isn't, but after that it is. (Let's assume connected TCP/IP.)
    The server does bind() and accept(), the client does connect(). After that, the connection is symmetrical: either end can issue any number of read() and write() calls in any order. You write() to a socket, it pops out from read() at the other end (though not necessarily as a single packet; TCP/IP is stream oriented, so write() "packets" can and will be glued together, or fragmented at the whimsy of network routers and friends.)
    - accept() //wait for client to send request
    - socket.getInputStream() //read request
    - socket .getOutputStream() //write responseThose don't read or write; they get streams which you can read from and write to.
    In the server, when accept() returns a new connection, you'd start a reader thread for that client. The thread would read() (or readLine() if you implement a line-oriented protocol) and handle the incoming messages. Whenever you want to write to the client, write to the stream returned by socket.getOutputStream(). You may need to synchronize writes if you have several threads that do sequences of write()s that need to arrive at the client sequentially.
    As to the difficulty of socket programming: I don't think it particularly difficult. But then I've written dozens of socket programs since my first one in '85... The Java Tutorial socket chapter shows a simple client/server pair; not terribly difficult I think. In particular, check out the KKMultiServer at the bottom of the sample server chapter.

  • Help with installing a CHAT CLIENT/SERVER

    i cant seem to get my chatclient or chatserver to successfully connect to my server. even if i do a local host 127.0.0.1 thing it STILL says that it cannot connect.
    the server is a stand alone.
    is there a general place to install the compiled files?
    im SO frustrated right now.
    im writing a card game. it is done but now i need to implement the networking. so im starting with a simple chat server and i cant even get THAT to work.
    HELP.....

    I'm actually working on a card game (client/server if I can) as well, when I spotted this message. Card games work for me because they're simple, they're relatively fun and easy to figure out, and they aren't real-time or heavy on animation/sprites/hardware acceleration.
    http://vpoker.sourceforge.net/ is a java based card game that has some excellent examples of how to conceptualize a 'card' object and a 'deck' of cards.
    good luck, can try emailing me if you want to toss around ideas about our respective card games.

  • How to validate a server in client-server application

    I am considering a client server application for a masters project. One of the core requirements for this application would be to ensure that the server could not be replaced. This would be easy to do using public/private keys. The client creates a message and encrypts using servers public key, then sends to the server. The server decrypts, processes, creates response, and encrypts using its private key. This works, however the public and private keys need to be in the source code. It looks like keystores may fix that problem, however the password to the key store would then be required. For this application to be usefull, I need to find a way to embed a password or encryption key in a .classfile in a way that it can not be retrieved by decompiling or parsing for strings. Anyone have ideas on how this could be done, or a different method I could use to guarantee that the response coming from a server process is from my server program and not a fake program?

    More detail. The program is a network license server (not web based). We need a simple license server for internal use, so that we can track usage and limit concurrent users for custom software. We also need some security so that people can not take the software home and use it. We have looked at commercial applications, however they are very expensive and we can not justify the cost since this is for internal software. There are 3 main pieces to a license server, the client libraries, the server, and the key generator. For the license server to be usefull, it should be impossible (or very very difficult) for someone to generate their own keys and add them to the license server. It should also be very difficult for them to create a fake license server that will grant licenses to clients without needing keys. If public/private key encryption is used, then the client would need to know the servers public key and their private key. These keys would need to be compiled into the program, stored in a key store, or looked up at run time from some other resource. The server would need to know its private key, and the clients public key. Since this is internal software, we can limit access to the server software, so it would be ok to compile the keys into the code (not ideal but secure enough for out use). However if I use this program as my Masters project, I would need to figure out a better way to secure it. The generic problem is how to give someone two programs that talk to each other, and be able to ensure that they do not fake one of the programs?

  • Client-server database application...

    Hi there!
    I'm about to write a database-application and I wonder if the following approach is to prefer or not:
    I want to use a MySQL-database and there shall be about eight client-applications which all shall be able to use it. I think of solving the above with RMI (I want to create/deploy a server wich will contain all the different SQL-queries on the same site as where I install the MySQL-database ). From the clients I just, with RMI, invoce the methods on the server which contains the different queries I want to use. In other words all the database-functionality is located on the server somewhat like stored procedures. To make it work each client must be assigned a thread of its own on the server...is this right?
    The advantages of the above which I can think of is: I just need to stuff one J/Connector driver in the JRE (on the server). Another is that I can use the nameservice of RMI... are there others?
    Is the above a good / usual or even bad approach?
    Is it more usual or even better to just provide the database-functionality (SQL-queries) in the clients and provide every client with the J/Connector driver?
    Thanks in advance!

    You noted that there will be "eight client-applications" - does that refer to eight users or eight programs using the database? This is important in determining your course of action.
    If you're talking about a small number of concurrent users (you have to define small), then you'll probably better off trying to do all the data/business logic in the app. If you're talking about a large number of concurrent users (again, your definition), your client/server paradigm might be better.
    To complicate things, unless you're doing this as a learning-on-your-own project (e.g. not getting paid for it), this is where you might want to evaluate using J2EE technoligies for your server-side implementation. Writing your own server is not a trivial task (been there, done that - pre-J2EE, of course): there's a lot of things you have to figure out how to handle. Well, that's true of even using J2EE, but there's some portion of what your server would need to do already taken care of in an application server.

  • Should i use secure sockets for my whole client/server application?

    Hi,
    I have a client server application, and I want to ensure that the login process is secure (i.e. use secure sockets). but I dont know how to switch back to a normal socket once that is done.
    So I am left thinking that i should just use SSL for my whole application, which can last pretty long. But I would rather not. Is there any other way of doing this?
    or should I just encrypt the login info using MD5 or something like that, then send it over an unsecure socket?
    thanks!

    Hey,
    Are you sure you haven't confused JGSS for JSSE?
    Imagine you have a client-server system and you sometimes want data sent over the wire to be encrypted... JGSS offers you this flexibility; if you a encrypted transmission, run ift through JGSS before transmitting it; if you don't want an encrypted transmission, bypass JGSS and just send the transmission.
    The benefit is the security (encryption) isn't hard-wired into you communications protocol i.e. TLS. JGSS has nothing to do with connections it is just protocol for securing messages, not sending them.
    You would need to establish the secure context but this could be done at startup and persist for the duration of you applicaiton invocation. You perhaps might need to implement a mechanism to identify encrypted messages on the receiving peer (so it knows to attempt decryption).
    Admittedly, kerberos seems like one of those 'inside-joke' things. I've come to realise if you don't have some sort of kerberos realm/server against which to authenticate - you need to swap it out as the underlying mechanism. How this is done I'm not sure yet, but I intend to find out today....further down the rabbit hole I go!
    If I discover anything helpful, I will let you know.
    Warm regards,
    D

  • OLE Alternatives in Forms 6i Client Server

    I'm fishing for some advice and maybe some examples of how to get around an OLE issue that's adversely affecting an upgrade project.
    We're currently migrating a Forms 4.5 application to 6i. This application displays MS Word documents (OLE Container) that are stored in the database and uses OLE to open manipulate, and save the documents back to the database. We've come across some serious problems with OLE and 6i that don't look like they'll be fixed any time soon (bug #2615804 in particular).
    Since OLE (ActiveX) is not supported a web delivered configuration, we're looking at an alternative to interacting and storing Word documents using a client/server configuration. This will have the added bonus of making the move to web delivery once we decide to go down that path.
    Has anyone out there had any good experience with overcoming this OLE problem? It seems like every pre-Forms 9i book out there has touted OLE as a way of interacting with Office tools and now OLE has become a roadblock.
    I've had a look at the JACOB example, but that doesn't really help if you're not deploying via the web.

    With the beans you've looking at visual stuff : like the look and feel project
    With the importer it's more like leveraging java functionality : in my case I've just implemented a call to a webservice on an application server. There is nothing visual here and it's just called via a straight bit of PL/SQL that call my java classes ( however, in that case I could also use UTL_HTTP directly to make the call and thus not bother with java importer - but the database wouldn't allow UTL_HTTP calls :( )
    For both of these you'd need to tell forms where to find the JAR file in it's java environment - but you won't have that in c/s
    Another way is to load up java code into the database and process it within the database and hide it completely from Forms. I've done this sort of thing loading Apache-FOP into Oracle and creating PDF files in the database (as BLOBS) from XML/XSL also in the database as XMLTYPES.
    At least that's my view on how it fits together ... maybe others know more :)
    Steve

  • FRM-40735 on the Web, in client/server without error

    We have 2 types of Form modules.
    Type 1 are simple multirecord modules,
    which uses PL/SQL library module PL1.plx.
    Type 2 are complex (master-detail) modules,
    which uses PL/SQL library module PL2.plx.
    In client/server, both types of Form modules work fine.
    On the Web (Intranet), type 1 modules works fine, but loading of type 2 modules finishes with error: FRM-40735 PRE-FORM trigger raised unhandled exception ORA-06508.
    In both cases database schema and fmx/plx modules are the same.
    Implementation of WebForms is noncartridge
    (without Oracle Application Server).
    Clients use Jinitiator and IE4.
    Forms version is 5 + patch 7.
    DBMS version is 7.3.4.0.
    Thanks and regards.

    Two questions:
    Are you running your application against one DB, while it was compiled against another?
    If any of your forms or libraries is calling DB stored package that are passing parameters in between database and modules?
    If the answer to both questions is yes, then you're dealing with Oracle bug. Oracle support points to interaction between forms
    PL/SQL 8.0.5.1.0 and database PL/SQL 2.3.4.
    This problem should be fixed in the forms
    PL/SQL 8.1.6 which is not available at present time. The only work around is to maintain forms executable and/or compiled libraries for each of your DB.
    Good luck.
    null

Maybe you are looking for

  • Vendor master analysis report

    hi, what is vendor master analysis report? and how to create it?

  • Multi Apps in Web Start

    The Web Start Demo (play.jnlp) shows four applications. How to do it? I need to do the same thing, i.e. show more than one app when I start javaws.exe. Please help. I have searched and searched.....

  • Just downloaded the trial fInal Cut Pro x.

    to try the software I imported an event from imovie. Once in there the 'warning' symbol appears next to the imported file and the application quits as soon as it loads. erased it from my applications folder and redownloaded the trial. The new downloa

  • Need help with frozen iPad.

    My open email is frozen on my iPad screen and nothing I do helps. I have tried to turn the iPad off but cannot see the slide buttom to turn off.  I have recharged the battery but that did not help.  Any suggestions?

  • Hotmail email delays

    I setup hotmail or live email on my iphone, using the pop3.live.com, and the incoming mail is delayed many times.  It is usually ok, but there are times that the incoming email is delayed a day, folks asking me if they got their emails.  Intermittent