I hava a question about RMI,please help me!

Ladys and Gentleman,I hava a question about RMI.I wirte four little programs in java that is about RMI on my PC.
import java.rmi.*;
public interface AddServerIntf extends Remote{
double add(double d1,double d2) throws RemoteException;
import java.rmi.*;
import java.rmi.server.*;
public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf{
public AddServerImpl() throws RemoteException{
public double add(double d1,double d2)throws RemoteException{
return d1+d2;
import java.net.*;
import java.rmi.*;
public class AddServer{
public static void main(String args[]){
try{
AddServerImpl addServerImpl=new AddServerImpl();
Naming.rebind("AddServer",addServerImpl);
}catch(Exception e){
e.printStackTrace();
import java.rmi.*;
public class AddClient
     public static void main(String args[]){
     try{
     String addServerURL="rmi://"+args[0]+"/AddServer";
     AddServerIntf addServerIntf=(AddServerIntf) Naming.lookup(addServerURL);
     System.out.println("The first number is: "+args[1]);
     double d1=Double.valueOf(args[1]).doubleValue();
     System.out.println("The second number is: "+args[2]);
     double d2=Double.valueOf(args[2]).doubleValue();
     System.out.print("The sum is: "+addServerIntf.add(d1,d2));
     }catch(Exception e){
     System.out.println("Exception: "+e);
And I compiled these files,so I got 4 class files(AddServer.class,AddServerIntf.class,AddServerImpl.class,AddServerClient.class).Then I use "rmic AddServerImpl" got another two files(AddServerImpl_Skel.class and AddServerImpl_Stub.class).Then I input command:rmiregistry,in another window,I input command:java AddServer,I got some exceptions,I was confused by these exceptions.The exception is:
D:\MyJava\rmi_3>java AddServer
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: AddServerImpl_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: AddServerImpl_Stub
java.lang.ClassNotFoundException: AddServerImpl_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at AddServer.main(AddServer.java:8)
But some times this exception will not appeared.Who can give me answer or suggestion,thanks a lot.
By the way,when I run shutdown.bat in tomcat_root\bin,I can get some exceptions:
C:\Tomcat\bin>shutdown
Using CATALINA_BASE: ..
Using CATALINA_HOME: ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME: C:\JDK
Catalina.stop: java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:579)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
I use Windows server 2000+JDK 1.3.1_04+tomcat 4.1.7

Maybe I am off base here but it seems to me the problem is the way in which you bind your server. The server must be bound to the same address and you are looking up from, i.e. "rmi://" host "/AddServer"
so
Naming.rebind("AddServer",addServerImpl);should be
Naming.rebind("rmi://127.0.0.1/AddServer", addServerImpl);to match
String addServerURL="rmi://"+args[0]+"/AddServer";
AddServerIntf addServerIntf=(AddServerIntf)
Naming.lookup(addServerURL);Hopefully this will solve your problem, if not it is a problem with your classpath. An easy way to make sure it can see your files is to set the java.rmi.server.codebase to point to where your classes are, e.g.
java -Djava.rmi.server.codebase=file:"c:\\cygwin\\home\\tweak\\keck_folder\\cmsi401\\RMIGalaxySleuth\\classes\\" AddServer
I had to set the codebas for my rmi stuff to work no matter how much I messed with the classpath.
Hope this helps,
Will

Similar Messages

  • Bit Rate too high Error - have specific details about files - please help

    Hello-
    Just finished a project and went to burn the first DVD. It starts muxing the first mpeg2 video file and comes up with this error. Below are the specs for all the files on the DVD. Please take a look and let me know where I went wrong. Thanks a lot.
    Tom J
    All video files are:
    MPEG-2 60 Min High Quality Encodes out of compressor
    All Audio is:
    AIFF Stereo 16bit 44.1KHZ
    All video and audio lengths are the same, some video tracks have multiple audio tracks
    Title---------Video Length--------# of Audio Tracks--------
    Main Menu----1:34:27--------------1-----------
    Sub Menu 1---30:00----------------1----------
    Sub Menu 2---30:00----------------1-----------
    Video 1------4:32:00--------------1-----------
    Video 2------3:09:00--------------3----------
    Video 3------6:25:08--------------3----------
    Using my superdrive to burn on a Imation DVD-R 8x
    Disc Meter in DVDSP reads 1.3 GB

    Hey David-
    The total running time of all video (including video
    for motion menus) is 1001 seconds (the book told me
    to break it down into secon ds).
    As far as the bit rate, I checked it and am exporting
    currently to a max of 5 with an average of 4.5 (for
    the video).
    The audio is AIFF all the way, I think encoding in
    Dolby is something a newer version fo compressor
    does. I have FCP 4.5 with DVDSP 3.
    I did export the audio as PCM AIFF, didn't shrin kthe
    size in fact enlarged it slightly.
    Do you figure if I have a bit rate max of 5 on video
    with 3 1.5 bit rate audio tracks, I'll be all right?
    Tom J
    With your version of FCP & DVDSP, you'll need to encode the audio into Dolby Digital 2.0 with A.Pack, which is a separate program on your hard drive. With Final Cut Studio, Apple did away with A.Pack and merged its functionality into Compressor.

  • Hello am using ios 7.0.4 I have a question about messages that it does not show the time of a particular message after first message that I recive form a paricular person so please in the next version change this and with every message show time and date

    hello am using ios 7.0.4 I have a question about messages that it does not show the time of a particular message after first message that I recive form a paricular person so please in the next version change this and with every message show time and date

    Hi,
    How is everything going? Have you checked this issue from OWA? If so, please let me know the result.
    In adition, please also try to use the following powershell commands to check if the assistant has right permissions:
    Get-MailboxFolderPermission -Identity
    CEO’s email address:\Calendar -User assistant’s email address
    Also check with:
    Get-Mailbox -Identity CEO’s mailbox
    | fl *GrantSendOnBehalfTo
    Please let me know the result.
    Best Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • I forgot my answers to my security questions and I'm not receiving my reset email I need help soon because I have $15 on my account please help ASAP

    I forgot my answers to my security questions and I'm not receiving my reset email I need help soon because I have $15 on my account please help ASAP

    See Kappy’s great User Tips.
    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities
    https://discussions.apple.com/docs/DOC-4551
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us http://www.apple.com/emea/support/itunes/contact.html
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service http://support.apple.com/kb/HE57
    About Apple ID security questions
    http://support.apple.com/kb/HT5665
     Cheers, Tom

  • I have frequent instances of my Macbook Pro beeping 3 times and then I have to forcefully shut it down by pressing the power button. What is this all about? Please help. Thank you.

    I have frequent instances of my Macbook Pro beeping 3 times and then I have to forcefully shut it down by pressing the power button. What is this all about? Please help. Thank you.
    I saw this report being sent to Apple:
    Interval Since Last Panic Report:  581719 sec
    Panics Since Last Report:          10
    Anonymous UUID: F4CF708D-D85C-4EC5-8047-4FC22C6B03AF
    Fri Mar  7 13:00:14 2014
    panic(cpu 0 caller 0xffffff80002d1208): Kernel trap at 0xffffff800020c590, type 14=page fault, registers:
    CR0: 0x0000000080010033, CR2: 0x0000000000000000, CR3: 0x0000000007541000, CR4: 0x0000000000040660
    RAX: 0xffffff8000000000, RBX: 0xffffff800d35a870, RCX: 0xffffff800cf55cd8, RDX: 0xffffff80008a8fcc
    RSP: 0xffffff805e5f3d60, RBP: 0xffffff805e5f3da0, RSI: 0x000000001dcd6500, RDI: 0xffffff800d168778
    R8: 0x0000000000000001, R9: 0xffffff805e5f3e88, R10: 0x0000000000000011, R11: 0x0000000000000000
    R12: 0x0000000000000000, R13: 0xffffff800d168770, R14: 0xffffff800d168778, R15: 0x0000000000000000
    RFL: 0x0000000000010082, RIP: 0xffffff800020c590, CS:  0x0000000000000008, SS:  0x0000000000000010
    Error code: 0x0000000000000000
    Backtrace (CPU 0), Frame : Return Address
    0xffffff805e5f3a00 : 0xffffff8000204d15
    0xffffff805e5f3b00 : 0xffffff80002d1208
    0xffffff805e5f3c50 :
    Model: MacBookPro8,1, BootROM MBP81.0047.B27, 2 processors, Intel Core i5, 2.3 GHz, 4 GB, SMC 1.68f99
    Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 384 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 5.100.198.104.5)
    Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
    Serial ATA Device: Hitachi HTS545032B9A302, 298.09 GB
    Serial ATA Device: OPTIARC DVD RW AD-5970H
    USB Device: FaceTime HD Camera (Built-in), 0x05ac  (Apple Inc.), 0x8509, 0xfa200000 / 3
    USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
    USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 5
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x821a, 0xfa113000 / 8
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0245, 0xfa120000 / 4
    USB Device: Hub, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0xfd110000 / 3

    Hmm. The problem still may be the RAM - Apple buys the RAM it puts in its machines from third-party vendors (usually Hynix) so it could be a RAM problem.
    There are a couple of things that you can do yourself before taking your machine into an Apple Store or an AASP... download and run an application named Rember that will run a RAM test for you - let it run for a couple of hours or even overnight. If it turns out that your RAM is faulty, Rember will let you know. If it is faulty, then you have a couple of options - replace the RAM yourself or (particularly if you're under warranty still) take the machine to an Apple Store or AASP and have them replace the RAM.
    If Rember finds no fault with the RAM, then you'll need to take it into an Apple Store/AASP and get a free diagnosis on the machine. Three beeps do usually indicate faulty RAM, but if it tests good with Rember you likely have another problem - it could be something as simple as the RAM, somehow, not seated correctly or signs of another hardware problem.
    Run Rember first... call back with results.
    Good luck,
    Clinton

  • HT1725 When I try downloading apps on my I pad it says additional information required. It then asks me to answer these questions that I have selected as my security questions. The only problem is I have forgot my answers, APPLE PLEASE HELP ME!!! Thank yo

    When I try downloading apps from the app store it doesn't allow me until I have entered the security questions, the only problem is I have forgotten my answers. Please help me to find out how I can retrieve the answers back, thank you

    Check the AppleCare number for your country here:
    http://support.apple.com/kb/HE57
    Call them up, and let them know you would like to be transferred to the Account Security Team.

  • I have a question about weblogic RMI , how can I resolve it.Thank you

    I have a question about the weblogic RMI .
    I have a program.web services+weblogic RMI +Data Sources When I run the program in the console application.it is ok.But When i run it with the web services(it 'is mean Get some parameter and run the different program).it's fail.The Exception is
    cannot assign instance of yype weblogic.rmi.RMIServices_1033_WLStub to field demo.RMIServer_1033_WLStub.stubinfo of type weblogic.rmi.internal.StubInfo in instance of demo.RMIEsrver_1033_WLStub
    how to resolve .Thank you.

    Hi Charles,
    Parental Controls has always had problems with https sites, no idea if it's fixed in 10.9.x or not.
    When you setup your Mac it shouldv'e made an admin account, are you not running from that account, or did you somehow change it to a Managed account???

  • I need to by apps but it keeps asking for my security questions ;/ but  forgot the answers to my security questions and the security/rescue email too (i dont have USA number to call please help me and send my rest to my email

    I need to by apps but it keeps asking for my security questions ;/ but  forgot the answers to my security questions and the security/rescue email too (i dont have USA number to call please help me and send my rest to my email

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (115668)

  • Question about inner class - help please

    hi all
    i have a question about the inner class. i need to create some kind of object inside a process class. the reason for the creation of object is because i need to get some values from database and store them in an array:
    name, value, indexNum, flag
    i need to create an array of objects to hold those values and do some process in the process class. the object is only for the process class that contains it. i am not really certain how to create this inner class. i tried it with the following:
    public class process{
    class MyObject{}
    List l = new ArrayList();
    l.add(new MyObject(....));
    or should i create the object as static? what is the benifit of creating this way or static way? thanks for you help.

    for this case, i do need to create a new instance of
    this MyObject each time the process is running with a
    new message - xml. but i will be dealing with the case
    where i will need a static object to hold some
    property values for all the instances. so i suppose i
    will be using static inner class for that case.The two situations are not the same. You know the difference between instance variables and static variables, of course (although you make the usual sloppy error and call them static objects). But the meaning of "static" in the definition of an inner class is this: if you don't declare an inner class static, then an instance of that inner class must belong to an instance of its containing class. If you do declare the inner class static, then an instance of the inner class can exist on its own without any corresponding instance of the containing class. Obviously this has nothing to do with the meaning of "static" with respect to variables.

  • Please i have a question about to YOUTUBE App.

    Dear all,
    i have a question about YOUTUBE app.
    i have Iphone 3G.
    as i use youtube a new error message has appeared "Cannot Connect to YouTube"
    noted that i could't use YouTube before.
    Thanks ,
    Ashraf

    I don't use that app. I just go to the web based site. You can share videos from the site, but not from the app, as far as I have been able to do. Try the web based version and see if you get the same error. Go through Safari is what I mean.

  • I have a question about Configuration of Post with Clearing

    I have a question about confiruation of the post with clearing which is t-doce 'FB05'.
    When I make post with clearing on 'FB05', I can change the additional selections.
    Where can I control the confiruation of the additional selections in t-code 'FB05'
    Please, tell me the menu path.

    Hi,
    In SPRO, go to
    Financial Accounting (New) > Accounts Receivable and Accounts Payable > Business Transactions > Incoming Payments > Manual Incoming Payments > Make Settings for Processing Open Items > Choose Selection Fields
    Hope this helps.
    Thanks

  • I have three questions about managing my music library

    Hello,
    I have three questions about managing my music library, I hope you can help me with them:
    1) Is there a limit of how many entries, songs, albums, art work, can iTunes handle? I have a hunch iTunes is like a database program and am curious about its capacity. I have two 2-TB drives and am wondering what is going to happen when I fill these two drives up. Other than disk space, what are iTunes limitations?
    2) Talking about these two drives. How can I use both as a source for my iTunes library. Can I have two folders selected as the source of my library? I am not sure if I have enough disk space to hold all my music, but I do also have a 1TB almost empty drive is need be.
    3) OK now comes te real question. I am sure that I have duplicates in my library and I sure would love to clean my library up.Possiby if I do get to clean it up, I can save some disk space and that is always a good thing. Any good techniques, software, techniques to follow while ripping music to help keep my library organized. Please be as detailed as you can.
    Thanks and I can't wait to hear from you.
    Waseem

    Wassimn wrote:
    Hello,
    I have three questions about managing my music library, I hope you can help me with them:
    1) Is there a limit of how many entries, songs, albums, art work, can iTunes handle? I have a hunch iTunes is like a database program and am curious about its capacity. I have two 2-TB drives and am wondering what is going to happen when I fill these two drives up. Other than disk space, what are iTunes limitations?
    As far as I know you're going to run out of disc space before you hit any limits. Each object in iTunes has a 64-bit key to access it. That said as your library grows it will get less responsive as bigger indexes take exponentially longer to process.
    2) Talking about these two drives. How can I use both as a source for my iTunes library. Can I have two folders selected as the source of my library? I am not sure if I have enough disk space to hold all my music, but I do also have a 1TB almost empty drive is need be.
    iTunes wants to manage everything inside one big folder. Some idiosyncrasies with the way it manages things if you have to move to a new drive means it is best if you can stick to that plan. If your library grows larger then you'll have to take manual control of where some or all of your content is stored. I use a variation of a script called ConsolidateByMoving which you could adapt for your needs.
    3) OK now comes te real question. I am sure that I have duplicates in my library and I sure would love to clean my library up.Possiby if I do get to clean it up, I can save some disk space and that is always a good thing. Any good techniques, software, techniques to follow while ripping music to help keep my library organized. Please be as detailed as you can.
    When it comes to deduping I've written another script for that called DeDuper, see this thread for background.
    And for some general tips on getting organized in iTunes see Grouping tracks into albums.
    tt2

  • HT5312 Dear Apple Support ,  I can't remember my security question answers , so Please help me to Create new Security Question for my Account .  Best wishes

    Dear Apple Support , I can't remember my security question answers , so Please help me to Create new Security Question for my Account .  Best wishes
    <Email Edited by Host>

    Welcome to the user to User Technical Support Forum provided by Apple.
    Please do not post personal information on a Public Forum.
    I have requested the Hosts remove it for you
    For your issue...
    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    Or Email Here  >  Apple  Support  iTunes Store  Contact
    More Info >  Apple ID: All about Apple ID security questions
    Note:
    You can only set up and/or change a Rescue Email Before you forget the questions/answers.

  • I can't remember my security question answers , so Please help me to Create new Security Question for my Account .

    rt ,
    This is ***majed*** ,I can't remember my security question answers , so Please help me to Create new Security Question for my Account .
    Best wishes,

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact iTunes Support / Apple in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • I can't remember my security question answers , so please help me to Create new Security Question for my Account : ********  , Best wishes

    I can't remember my security question answers , so please help me to Create new Security Question for my Account : **********
    , Best wishes
    <Personal Information Edited by Host>

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple - I've asked the hosts to remove your email address from your post (it's not a good idea to post personal info on any public forum).
    If you have a rescue email address (which is not the same thing as an alternate email address) on your account then the steps half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

Maybe you are looking for

  • [Follow-up] JavaFX ARM Preview on an Iconia Tab A700

    Hi all, I'm going on with my work after a previous discussion: Re: JavaFX on ARM tablet Now I have an Iconia Tab A700 with Android 4.0.4, I locally mounted on it an image of Ubuntu ARM that I access via VNC. First of all, is the Iconia Tab A700 a cor

  • Slate 500

    My hp slate 500 tablet turns off if it is remove from it's docking station.  This occurred only after I reinstalled the windows 7 operating system and drivers from the recovery disks that came with the unit when I purchased it.  I had previously inst

  • F4 help for file path in selection screen.

    Hi there, I defined one parameter p_path for file path using RLGRAP-FILENAME. I have not got F4 for this. How to solve this problem, can anybody pls help. Regards, Naseer.

  • Convert Oracle SQL line to SQL Server SQL

    Hi All, I'm trying to convert this Oracle SQL to SQL that will work with SQL Server 2008 and am having some trouble with the MOD function. Anyone have any SQL Server chops? Oracle SQL TBL_MAIN.AuthoredDate- MOD (TBL_MAIN.AuthoredDate - to_date ('2012

  • Block plant for all postings permenantly

    Dear All, We have created new plant & business area.Henceforth, I want that all postings be made through this plant only & no posting should be allowed to be carried out in old plant.(Posting like creating sales order, PR,PO,MIGO etc.). Since I want