Solved

JSP SecurityException

Posted on 2002-07-18
4
247 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
  • 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now