Im a little stuck with RMI please help

Ok from the beginning
Im running jdk1.5.0_09 its located in C:\Program FIles\Java
The files are held in C:\java
I have created a simple calculator program Code below:
Calculator.java
Calculator.class
(code)
public interface Calculator
extends java.rmi.Remote {
public long add(long a, long b)
throws java.rmi.RemoteException;
public long sub(long a, long b)
throws java.rmi.RemoteException;
public long mul(long a, long b)
throws java.rmi.RemoteException;
public long div(long a, long b)
throws java.rmi.RemoteException;
} (/code)
CalculatorImpl.java
CalculatorImpl.class
(code)
public class CalculatorImpl
extends
java.rmi.server.UnicastRemoteObject
implements Calculator{
// Implementations must have an
//explicit constructor
// in order to declare the
//RemoteException exception
public CalculatorImpl()
throws java.rmi.RemoteException {
super();
public long add(long a, long b)
throws java.rmi.RemoteException {
return a + b;
public long sub(long a, long b)
throws java.rmi.RemoteException {
return a - b;
public long mul(long a, long b)
throws java.rmi.RemoteException {
return a * b;
public long div(long a, long b)
throws java.rmi.RemoteException {
return a / b;
(/code)
calculatorserver.java
calculatorserver.class
(code)
import java.rmi.Naming;
public class CalculatorServer {
public CalculatorServer() {
try {
Calculator c = new CalculatorImpl();
Naming.rebind("rmi://localhost:1099/CalculatorService", c);
} catch (Exception e) {
System.out.println("Trouble: " + e);
public static void main(String args[]) {
new CalculatorServer();
(/code)
calculatorclient.java
calculatorclient.class
(code)
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
public class CalculatorClient {
public static void main(String[] args) {
try {
Calculator c = (Calculator)
Naming.lookup(
"rmi://localhost/CalculatorService");
System.out.println( c.sub(4, 3) );
System.out.println( c.add(4, 5) );
System.out.println( c.mul(3, 6) );
System.out.println( c.div(9, 3) );
catch (MalformedURLException murle) {
System.out.println();
System.out.println(
"MalformedURLException");
System.out.println(murle);
catch (RemoteException re) {
System.out.println();
System.out.println(
"RemoteException");
System.out.println(re);
catch (NotBoundException nbe) {
System.out.println();
System.out.println(
"NotBoundException");
System.out.println(nbe);
catch (
java.lang.ArithmeticException
ae) {
System.out.println();
System.out.println(
"java.lang.ArithmeticException");
System.out.println(ae);
(/code)
Okies now you have my code ill start with the first error
1. When i try to rmic calculatorimpl i get this error:
error: Class calculatorimpl not found.
2. I read somwhere that it auto creates the stubs for you, so i tried running: rmiregistry which ran up fine
so i ran the server and got this:
Trouble: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Calculator
can you please help

Code tags are with brackets [] not ().
You need to specify a classpath either as an ENVIRONMENT value (CLASSPATH=) or with the command line when you start your application (-cp).
Then you are going to need a policy file or you'll get security errors. Use the standard "policy all" file found in the documentation.
grant {
    permission java.security.AllPermission "", "";
};start java
-Djava.security.manager
-Djava.security.policy=%YOUR_HOME%\Security\policy.all
-cp %YOUR_HOME%
name_of_your_class

Similar Messages

  • Trying to veiw videos from a website that requires me to download firefox and silverlight.My imac osx 10.5.8 will now download firefox. firfx tells me my mac is not compatible with ffox Please help me ?  Thank you

    trying to veiw videos from a website that requires me to download firefox and silverlight.My imac osx 10.5.8 will now download firefox. firfx tells me my mac is not compatible with ffox Please help me ?  Thank you

    There is a version of Firefox 4 available for PPC Macs:
    TenFourFox 4.0.1 Firefox 4 For PowerPC Browser Released
    Version 4.0.1 of TenFour Fox, FloodGap's port of Firefox 4 for Power PC
    Macs that supports both Mac oS X 10.4 and 10.5. has been released.
    Mozilla.org dropped support for OS 10.5 after Firefox 3.6 and for Power
    PC with the fourth beta of Firefox 4.
    TenFourFox uses almost all the same code as Firefox 4 and has nearly all
    the same features, including faster JavaScript, WebM video, and HTML 5
    and CSS 3 support, as well as new and emerging Web features, but with
    the code needed to keep your Power Mac functional and fast. Out of beta
    and it's ready for action, versiob 4.0.1 is a performance, security and
    stability update incorporating Mozilla's Firefox 4.0.1 plus AltiVec acceler
    -ation for WebM and browser graphics, and G5 JavaScript acceleration.
    For more information, visit:
    http://www.floodgap.com/software/tenfourfox/
    Source: from http://www.applelinks.com - posted April 25, 2011)
    Now for the intersting bit: TenFourFox, like Firefox, does not support most plug-ins. Unless you are prone to headaches (in which case don't) you can read about that here:
    http://code.google.com/p/tenfourfox/wiki/PluginsNoLongerSupported
    But there is a workaround!
    Open TenFourFox and type in the address bar: about:config (no spaces) and click return. This gives you a warning that it might harm the application. Ignore that and click on 'I'll be careful, I promise' and you get the config file that you can edit - with great care.
    Look/search (scroll down) for: tenfourfox.plugins.enabled
    Set it to true. (Double click it to toggle it)
    Now close TenFourFox, open it again, and Flash will now work, as it now uses the plug-ins that Safari has stored.
    With SilverLight, Microsoft attempted to create their own version of what a replacement for Flash could be - but not to universal acclaim. You can read more about it here:
    http://silverlight.net/
    So, if you go to any sites that have been designed for this new Silverlight stuff, you can download the plug-in from here (but make certain that you are downloading SilverLight v.1.0 for OS X (10.4.8 upwards) if you are using a PPC Mac, but even this will not work with Safari 4. Version 2 only works with Intel Macs and does work with Safari 4/5. The solution is to download and install the latest version of Flip4Mac, which now includes a Silverlight component:
    http://dynamic.telestream.net/downloads/download-flip4macwmv.htm
    But the latest news is that Microsoft will probably abandon Silverlight in favour of HTML5:
    http://www.appleinsider.com/articles/10/10/29/apples_ios_pushes_microsoft_to_dia l_down_silverlight_for_html5.html  and
    http://www.bbc.co.uk/news/technology-11673384

  • I just installed mongolian cyrillic keyboard and it's working just fine with safari but i can't type on Word with it. please help me?

    i just installed mongolian cyrillic keyboard and it's working just fine with safari but i can't type on Word with it. please help me?

    PS Here is a source for a keyboard.  Try it if you have not done so already
    http://m10lmac.blogspot.com/2012/12/new-mongolian-keyboard-layout.html
    For questions about why Word doesn't do something, try
    http://answers.microsoft.com/en-us/mac/forum/macword

  • I can't turn off find my ihone, always show "there was a problem when canceling the registration of this iphone with icloud" please help me. i can't restore my iphone before turn off find my iphone

    i can't turn off find my ihone, always show "there was a problem when canceling the registration of this iphone with icloud" please help me. i can't restore my iphone before turn off find my iphone

    If you are the original owner of the phone and know the Apple ID and password that were used to activate it originally, and if you have an existing backup to restore from, you can force it into recovery mode (which will completely erase it) and restore it as explained here: If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support.  When you do you will encounter activation lock, and will have to provide the ID and password used to activate it originally in order to activate it again.  If you can't, you won't be able to activate and use it.

  • I'm trying to set up my new iPhone 5s from a backup of my previous iPhone, when trying to enter my Facebook login info in settings I keep getting the following error message : error signing in could not communicate with server, please help !

    I'm trying to set up my new iPhone 5s from a backup of my previous iPhone, when trying to enter my Facebook login info in settings I keep getting the following error message : error signing in could not communicate with server, please help !

    Can you access other apps? Can you acess the internet? Can you access applications that use internet besides facebook?
    If answer is yes to all of these; contact Facebook.

  • My factory unlocked iphone 4s mms is not working with tmobile, please help...

    my factory unlocked iphone 4s mms is not working with tmobile, please help...

    Check out this link. It should fix the problem
    http://support.t-mobile.com/thread/17918?tstart=0

  • HT1296 my outlook calendar is not syncing with Ipad. please help

    my outlook calendar is not syncing with Ipad. please help

    I've got the same problem and no one is answering to it. call up the apple support and waited for almost 30mins before i can get help, after an hour they only keep asking me for account emails and stuff, end up getting nothing solved. Sad!

  • My iphone 3gs is not syncing with itune please help me

    my iphone 3gs is not syncing with itune please help me

    Did you ever get help with this issue?

  • I just install Photoshop CC. I try to open the file picture. All open as solid black picture. But on the right side under layer I can see little pic preview. Please help!

    I just install Photoshop CC. I try to open the file picture. All open as solid black picture. But on the right side under layer I can see little pic preview. Please help!

    These questions below may be for a different product... but the KIND of information you need to supply is the same, for the products you use
    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840
    •What is your exact brand/model graphics adapter (ATI or nVidia or ???)
    •What is your exact graphics adapter driver version?
    •Have you gone to the vendor web site to check for a newer driver?
    •For Windows, do NOT rely on Windows Update to have current driver information
    •-you need to go direct to the vendor web site and check updates for yourself
    •ATI Driver Autodetect http://support.amd.com/en-us/download/auto-detect-tool
    •nVidia Driver Downloads http://www.nvidia.com/Download/index.aspx?lang=en-us

  • HT201210 cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    If you mean updae server
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem
    Otherwise what server are you talking about

  • Hey there! well i from india and i m facing problem connecting my debit card to the itune store ,as the very option is not there, can someone guide me how to get it connected , i have a mastercard debit card with me .please help me

    hey there! well i from india and i m facing problem connecting my debit card to the itune store ,as the very option is not there, can someone guide me how to get it connected , i have a mastercard debit card with me .please help me

    if you are signed in to iTunes with your AppleID, click on the AppleID > view account > payment information > enter in your information

  • HT2534 im unable to get the none option while proceeding with itunes,,.please help me

    im unable to get the none option while proceeding with itunes,,.please help me

    Please help me understand your question. (What happens in vagueness, stays in vagueness.)

  • ?-mark folder on startup WITH cd stuck in slot - PLEASE help!

    Hi!
    I have a power Mac G4 cube with Mac OS 9.something. I'm not currently using it because we have a newer computer, but when I went to use it last night it showed me a question mark folder at startup and now I have a CD stuck in it that I can't get out.
    I've tried holding the mouse down at startup to no avail...
    Please help! How can I get my computer working again?

    if option doesn't work startup while holding down the left click on your mouse.
    is it trying to eject but it wont make it all the way out or is it simply making no noise at all?
    at one point i had to completely remove the dvd drive on my cube and remove a cd, hopefully your drive isn't completely dead.

  • Cannot install windows, starting to get really pissed off with this PLEASE HELP

    ok, i'm starting to get agitated with this.
    i cannot install windows XP, 2003, OR Longhorn on my machine.
    right now, i have the following setup:
    msi 865pe neo2 motherboard
    intel p4 3.2ghz w/HT (factory HS/Fan currently)
    1 dimm of PC3200 crucial DDR400
    30GB maxtor HD plugged into primary IDE
    pioneer dvd/cd drive as sencondary IDE
    alps 3.5" floppy drive
    antec true blue 480wt PSU
    i do the following:
    format with maxtor cd
    boot from OS cd
    start setup, reboot, continue
    the farthest i can get is 'registering components/completing installation' i either get a blue screen stop error which isnt the same everytime, or it just locks up and doesnt do anything.
    ran the memtest checker and get errors on test #4
    i had a DIMM of kingston that gave the same errors, so i RMA'd it and got another. same errors, so i RMA'd again and got a Crucial stick. same errors.
    so i RMA'd the motherboard since i figured it had to be that. and it improved from the problems i had earlier. (the problems i had before were worse before.)
    below are my BIOS settings. SOMEONE WHO KNOWS PLEASE HELP ME!
    advanced bios features:
    quick boot - enabled
    boot order - floppy, cd, HDD
    full logo - disabled
    s.m.a.r.t - enabled
    num-lock on boot - enabled
    floppy swap - disabled
    floppy seek - enabled
    save rom to HD - no
    boot to os/2 - no
    hyper threading - disabled
    mps revision - 1.4
    apic acpi sci irq - disabled
    cpu l1 & l2 cache - enabled
    bios cacheable - disabled
    c000, 32k shadow - disabled
    advanced chipset:
    dram timing...
    configure by spd - enabled
    (i dont know what to set timing to, nothing anyone has since said helps)
    integrated perfs:
    usb controller - enabled (same errors if its disabled too so its not USB)
    usb device legacy support - disabled
    on chip IDE:
    operate mode - legacy mode
    ata config - pata only
    sata keep enabled - yes (for sata drive i have, error either way)
    pata channel selection - both
    onboard ethernet, 1394, prmoise ide and audio all DISABLED
    pc healt status:
    cpu - 49°C/120°F (idle sitting in bios)
    system temp - 28°C/82ºF
    cpu fan - 2678rpm
    nb fan speed - 6490rpm
    vcore - 1.456 up to 1.502
    3.3v - 3.232v
    +5.0v - 5.003v
    +12v - 11.680v
    -12v - -11.743v
    -5.0v - -4.826v
    battery - 2.896v
    +5V SB - 4.945
    freq/voltage control
    Dynamic OC - disabled
    cpu ratio locked
    dram freq - auto
    spread spectrum - enabled
    cpu bus clock - 200
    ddr clock (grayed out) - 400
    adjust agp/pci - 66.66/33.33
    cpu vcore adjust - no
    cpu vcore (grayed out) - 1.5500v
    ddr power voltage - 2.65v
    agp power voltage - 1.50v
    SOMEONE PLEASE HELP ME!!!!!
    i'm running out of time, money, patience.
    if it cant be solved i'm going to set myself on fire!

    Quote
    Originally posted by REILLY875
    Do NOT try the 250 Watt PSU!!, As "Wonk" said if you happen to Blow it, the PSU will most likely Take out the Mo-Bo with it! And maybe the CPU to, due to the Voltage Spike you would get ...I would not put to much Credence into the fact that as of now the +12V and the +3.3V Rails are reading a little low,(I say this because it is indeed a ANTEC), as this could be the Monitoring Hardware, or the Software that might be reading wrong....If I where you I would First set the Memory Timings Manually to 3-4-4-7-8, And up the DRAM (VDIMM) Voltage to 2.7 Volts, and if it still wont Load, I would Definitly try a different DIMM Slot, and Rince and Repeat .....If you dont mind me asking , Why are you running with just 1 Module?....Is it on purpose or are you saving up for More?................Sean REILLY875
    yea, i dont plan to run the 250. im gonna wait for the new 480.
    thanks for the info about ram timings as well. i havnt gotten any solid answers about what to set it to.
    even with new mobo and ram, i'm getting errors in memtest86 #4 test as i always have. i've tried different slots with same problems.
    i only have one module because i dont want to waste anymore money on a non-working system. once i get it up and running i'll add another 512.

  • I'm getting this choppy effect with motion, please help!

    Hi all.
    I'm animating photos with white borders in AE, like polaroids. It's basically a camera slow panning and tracking around them.
    Each time the camera gets closer, and pans appear to be faster, I get this choppy look caused by the sharp white borders.
    I have tried
    - Subtle Gaussian Blue
    - Enabling Motion Blur
    and while they help a little, the effect is still there. Is there another technique? Someone suggested to take into PPro and apply the anti flicker effect.
    Please help. Deadline today.

    There are things like critical panning speeds that you must be aware of. The lower the frame rate the bigger the problem. The FAQ section of this forum has a link to two articles that may help. One is for horizontal motion the other is for vertical. FAQ: Why does horizontal motion stutter (judder) in my movies, such as during pans?
    There is a lot of good information about all kinds of problems in the FAQ section. You'll find a link on the form homepage. After Effects FAQ List
    You could also be experiencing skipped frames during playback. The answer to that problem is also in the FAQ: FAQ: Why is my output file huge, and why doesn't it play back smoothly in a media player?

Maybe you are looking for