Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JSP SecurityException

Posted on 2002-07-18
4
Medium Priority
?
260 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

705 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