views:

1089

answers:

5

I have written rmi server code in netbeans 6.5. how can i use rmic in netbeans 6.5 so that i can create server_stub class?

A: 

If you use Spring's remote proxying (RmiProxyfactoryBean), you don't need to generate any stub/skel classes at all. Spring just does all the magic for you behind the scenes. You don't even need to implement the Remote interface!

See the docs here

oxbow_lakes
The standard RMI implementation also provides a proxy implementation, if you call UnicastRemoteObject.exportObject(Remote, port).
kdgregory
Yes - but in Spring you can export anything; even interfaces which don't implement Remote
oxbow_lakes
A: 

you cannot use rmic through netbeans. you need to generate the server stub manually by running the rmic command at the command line. but in case of eclipse you can generate the stub from the ide with the help of rmi plugin.

Not from NetBeans itself. But one can change the build.xml file. If you know ant this should be a breeze.
Koekiebox
A: 

Hi,

Why not edit the standard build.xml located in the project root directory? Include the Rmic ant task. This will automatically rmic your classes every time you build a project in netbeans.

Koekiebox
A: 

Does RmiProxyfactoryBean can be used for localhosts in a simple RMI project? I mean is making stub with this is easy for beginner and does it cost to learn how it works?

park
A: 

You have to insert the below code into your build.xml file.

<target name="startRMI" depends="init">
    <exec executable="rmiregistry" dir="${build.classes.dir}">
    </exec>
</target>

Then right click -> build.xml -> Run target -> Other targets -> startRMI

This will start the RMI registry.

Samurai