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

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>
cruzsantiagoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

petmagdyCommented:
can please post what u have changed in java.policy
0
cruzsantiagoAuthor Commented:
permission java.net.SocketPermission "158.58.11.15:5000","connect,resolve,listen,accept");

Don't worry about the IP
0
petmagdyCommented:
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

cruzsantiagoAuthor Commented:
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
petmagdyCommented:
on what aervlet engine r u running ur jsp now?
0
cruzsantiagoAuthor Commented:
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
petmagdyCommented:
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
cruzsantiagoAuthor Commented:
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
petmagdyCommented:
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
cruzsantiagoAuthor Commented:
Well, at least I find the problem, there's a file tomcat.policy this need the grant option.
0
moduloCommented:
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.