Solved

JSP SecurityException

Posted on 2002-07-18
4
256 Views
Last Modified: 2012-06-21
Hello, all
I know how to set the java policy file for a normal application through the java command.

My problem now is that I use it as a bean inside a JSP page.

How I set the policy file for the bean ?

I take a SecurityException because the bean tries to connect to a Socket.

The instantiation of the bean inside the JSP is like taht:
<jsp:useBean id="roomCoordinator" class="com.game.arena.RoomCoordinator" scope="application"/>


Any ideas ?

0
Comment
Question by:pouli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:pouli
ID: 7162343
I found that inside the <apache>/conf/catalina.policy file the security restrictions are loaded.

I added at the end of the file the following lines:
grant{
    permission java.net.SocketPermission "*:1024-65535", "connect,accept,resolve";
};

but when I run the web page, again I took the AccessControlException: access denied......127.0.0.1:1099

I tried as well to add a codebase to the grant. I set the codebase to the class that tries the Naming.rebind (where the exception is thrown, the .jsp file and the parent class of the one that raises the exception (in other words the applet)

But none of them had any success.
It should be noted that I tried the previous things 1 at a time.

please help
0
 

Author Comment

by:pouli
ID: 7162852
I found that in catalina.bat file you couls enter arguments when the java command loads the server.

Unfortunately this do not work either.

0
 

Author Comment

by:pouli
ID: 7163538
The problem is solved.

After granting the permissions to the
<apache_home>/conf/catalina.policy file

the server MUT be started like this

<apache_home>/bin/catalina.bat start -security (windows)

Analogous for Linux
the key is the -security option
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7163544
Points refunded and placed in PAQ

Computer101
E-E Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question