Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

rmi servlet on glassfish error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic