Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

help needed passing objects from rmi server to application

Thread view: 
steve - 16 Jun 2005 00:34 GMT
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
Nigel Wade - 16 Jun 2005 09:44 GMT
> I have a jukebox application written in java, I want to be able to
> remotely select a song from a client to the server.
[quoted text clipped - 39 lines]
> 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.

You should be able to make your Jukebox application into an RMI server.

We are missing working code, and error messages. "This fails to start the
Server" doesn't tell us much.

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

Andrew Thompson - 16 Jun 2005 09:54 GMT
> We are missing working code, ..

For tips on that code..
<http://www.physci.org/codes/sscce.jsp>

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Andrew Thompson - 16 Jun 2005 09:58 GMT
> We are missing ... error messages. "This fails to start the
> Server" doesn't tell us much.

<http://www.physci.org/codes/javafaq.jsp#exact>
..and if you are not getting stacktraces, check here..
<http://www.physci.org/codes/javafaq.jsp#stacktrace>

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.