This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI application on Jboss

 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am thinking of developing a webapp that would have both Swing and JSP's as its main UI's. For the Swing Client, i was thinking of using RMI to communicate with the server doing the Business Logic.
Now, i've searched many forums, and websites trying to figure out how to do a simple RMI client using Jboss as the RMI server (Can this even be done?)
If so, can you point me out to a place that would have a simple "Hello World" RMI example with the steps to Deploy that example to jboss.
If it can't be done, I guess i'm stuck writing my own rmi server, and stuff..
Thoughts/Comments/Remarks?
 
ahmad namini
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi George:
As you may know, JBoss is an EJB Container affording all the wonderful middleware that J2EE enterprise apps have come to expect. I wouldn't try to embed an RMI app into JBoss. JBoss expects components to be deployed as EJBs.
I would write your own RMI server.
 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
on to step 2 writing my server...
 
Scott Duncan
Ranch Hand
Posts: 364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your are using JBoss, why not just call an EJB from the Swing client?
 
Tiger Scott
Ranch Hand
Posts: 223
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George,
You can potentially use a Servlet to launch your RMI Server. Just initiate it in the init() of the servlet.
HTH
Sanjay
 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Duncan - Don't feel like using EJB's for some odd reason.
Tiger - Funny thing is that is what I ended up doing. But I ditched jboss, and using tomcat.
Swing > RMI in the servlet context..
 
Tiger Scott
Ranch Hand
Posts: 223
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George,
I am also not using EJBs. Just don't want to take the trouble.
I am having trouble creating the iiop _Stub. The rmic -iiop is not doing that for me- creates the -tie fine. Anything special I need to do for that to happen,
Thanks
Sanjay
 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using the -iiop option.
 
Tiger Scott
Ranch Hand
Posts: 223
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George,
could you run RMI on Tomcat? I have not been able to do it either on Tomcat or JBoss. I have been able to get past the codebase and policy kind of issues can deploy and start it but it gives errors of various types. The final one when I try to execute a method:
java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 1398079692 No.
Thanks
Sanjay
 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll post some code later i'm @ work rightnow, and the code is a personal project.. but here is my rough design.
I have a servlet that is Auto-Init's on startup of Tomcat (.xml configuration)
In that Servlet's Init method I create the Registry
LocateRegistry.createRegistry();
Then I call out another class which does all the name binding of remote objects.
 
George McCain
Ranch Hand
Posts: 35
 
Tiger Scott
Ranch Hand
Posts: 223
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that is me.
Also I do something identical. I am doing IIOP so the semantics are different.
Thanks
Sanjay
 
George McCain
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Servlet

I then used rmic to compile the stubs and skel's
And then I edited the tomcat start file to add -Djava.security.policy = ....
When I start up Tomcat, it binds the services, and my RMI calls to the server works..
hope this helps your issue.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic