File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes rmi servlet on glassfish  error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "rmi servlet on glassfish  error" Watch "rmi servlet on glassfish  error" New topic

rmi servlet on glassfish error

theer abcccc

Joined: May 23, 2014
Posts: 2
hi i'm so new in rmi and i need help
my rmi client work on application(not in web) but it has a problem when i change to servlet
i have an rmi error when i run servlet on glassfish

i guess it happen because policy file but i don't know how to create my own policy

here is my policy file
grant {

here is error

here is my code

sorry about my pool engligh.

and thank in advance for your help
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

I don't know what that error message means, but I see some problems with this code:

For starters, Java code can't set its own security policy. You need to do that outside of the code when starting the JVM. Secondly, relative paths don't work in web apps (although this is moot once you address the first point). And lastly, printing out nothing when an exception occurs -basically ignoring it- is very unhelpful. At least print out the exception's message.

Also, handling GET and POST identically is a violation of the HTTP specification, even though the template code you're using does this. Remove the processRequest method, and decide whether to react to GET or POST.
theer abcccc

Joined: May 23, 2014
Posts: 2
thank you very much
i write new code Remove the processRequest method and write code into Get method
and not set paths policy which i put policy file to same directory
i will not printing out noting. (i try to print out exception but have noting)
but i have same problem if you have an idea please tell me thank you very much
I agree. Here's the link:
subject: rmi servlet on glassfish error
It's not a secret anymore!