Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Java ManagedBean and RMI to access methods on a server.  RSS feed

scott coleman
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there everyone.
My first post on your forums as I've never usually had to post because somebody on here has asked the questions and posted the answer i was looking for.
so here it goes.

I'm using:
NetBeans 6.9
Tomcat 6.0
JSF - primeFaces
Hibernate with JPA

What I want my system to do:
I currently have a Primefaces XHTML front end
the XHTML calls methods via a bean using the @managedBean annotation.
I then want the bean to perform an RMI call to a server class file I have running on my local machine.
This 'server' then persists data to a mySQL database.

Currently I'm just trying to get the bean-to-RMI set-up,
so i have a simple method called ping(); which gets called in the constructor of the bean.





In the stackTrace I'm getting this error:

It happens at line:

in the bean.

If I take the code that i used in the bean, stick it in a javaclass file and run it through commandprompt then it pings the server as it should do.
So i'm guessing its got something to do with it being in a managed bean?

Can any of you guys help?

As a side note:
I've already done something similar,
the client RMI code was run from a servlet in tomcat and the rmi worked correctly

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!