Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error : java.security.AccessControlException: access denied (java.net.SocketPermission 192.44.11.30:5000 connect,resolve)

Posted on 2004-10-31
12
Medium Priority
?
9,912 Views
Last Modified: 2008-09-15
Hi experts,

I create the next code for connect to Sybase DB, but I got this message when I try to connect there, I Change in the java.policy the grant option, but I have the response , can you help  I don't know what I missing.

Regards

CODE :

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="
                                                java.sql.*,
                                                java.text.*,
                                                java.util.*,
                                                javax.servlet.*,
                                                javax.servlet.*,
                                                com.sybase.jdbcx.*,
                                                com.sybase.jdbc2.jdbc.*" errorPage="" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%!String username = "user"; String password = "password";%>
<%
      try
      { Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
       Connection con = DriverManager.getConnection  ("jdbc:sybase:Tds:158.58.11.15:5000/gm_master",username,password);  %>

<table >
<tr>
<td>
</td>
</tr>
 <%          
   }     catch(Exception e)
      {%>
<b>Error : </b>
      <%= e.toString() %>
<%      }%>
</body>
</html>
0
Comment
Question by:cruzsantiago
[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
  • 5
  • 5
12 Comments
 
LVL 13

Expert Comment

by:petmagdy
ID: 12458297
can please post what u have changed in java.policy
0
 

Author Comment

by:cruzsantiago
ID: 12458514
permission java.net.SocketPermission "158.58.11.15:5000","connect,resolve,listen,accept");

Don't worry about the IP
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12458553
Ok, as u r calling from JSP u don't need to set permission to access Sybase Socket for JDBC, please try to remove the java.policy u have set for Sybase JDBC and tell me if it works
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:cruzsantiago
ID: 12458624
Well this line I write after read some experience in experts exchange, with or with out them  I still having the same problem, I don't know if I need check some with my server or start a services like tomcat.
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12458654
on what aervlet engine r u running ur jsp now?
0
 

Author Comment

by:cruzsantiago
ID: 12458710
My server It's RAQ550 Cobalt

Apache/1.3.20 Sun Cobalt (Unix) mod_jk mod_ssl/2.8.4 OpenSSL/0.9.6 PHP/5.0.1 FrontPage/5.0.2.2510 mod_perl/1.26/Jdk/1.3/jakarta-tomcat/-3.2.3

0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12458730
can u try it on windows on Tomcat first, maybe it is unix permission problem, the root needs to allow this port for u
0
 

Author Comment

by:cruzsantiago
ID: 12458777
Yes and it works, and other if i use isql -u<user> -P<password> -S<server> over the unix prompt I connect to the server in another machine, Really I don't know whats happend.
By sides I am root, so I can change all you tell me.
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12458823
just a try, use tomcat only without apache and start it with the root account and test ur jsp if will work, can u try this?
0
 

Author Comment

by:cruzsantiago
ID: 12459112
Well, at least I find the problem, there's a file tomcat.policy this need the grant option.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12808012
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
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 …
Suggested Courses

597 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