help needed passing objects from rmi server to application

S

steve

I have a jukebox application written in java, I want to be able to
remotely select a song from a client to the server.

The problem I have is you have to run the server as a seperate
process/application via "java Server" this ofcourse means that the
server application has the object passed to it via remote method, which
would be the song file to play. However, the Jukebox application is
running at the same time and this is where all audio processing and
playing is carried out.

So, the question is, how do I get the file object from the Server
application to the Jukebox application.

I tried instantiating the Server as an internal class within the
Jukebox application code, e.g. JukeboxServer js1 = new JukeboxServer();

rmiregistry call

Server code

public class JukeboxServer
{
public JukeboxServer()
{
try
{
RemoteMusicImp remote1 = new RemoteMusicImp();
Naming.rebind("rmi://localhost:1099/MFS",remote1);
}
catch(Exception e)
{
System.out.println("JukeboxServer exception could not instantiate");
return;
}
System.out.println("jukebox server started and listening on port
1099");
}

}

This fails to start the Server, it works only if I run it as a seperate
application, but then i can't get the song file object passed to the
Jukebox application.

Am I missing something obvious? Please help if you can.

Thanks in advance Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top