This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "rmi servlet on glassfish  error" Watch "rmi servlet on glassfish  error" New topic
Author

rmi servlet on glassfish error

theer abcccc
Greenhorn

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 {
permission java.security.AllPermission;
};

here is error


here is my code



sorry about my pool engligh.

and thank in advance for your help
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
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.


Ping & DNS - my free Android networking tools app
theer abcccc
Greenhorn

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
 
jQuery in Action, 2nd edition
 
subject: rmi servlet on glassfish error