Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Applets connecting to Databases: access denied (java.net.SocketPermission ... resolve)

Reply
Thread Tools

Java Applets connecting to Databases: access denied (java.net.SocketPermission ... resolve)

 
 
carrilho.paulo@gmail.com
Guest
Posts: n/a
 
      10-14-2007
Hi folks,

I'm new about developing Java applets and I need some help.

I'm developing a Web Application based on JSPs and Tomcat in Netbeans.

I've also developed a Java Applet which its package has some classes.
This Applet connects to a Sybase Database (JConnect) in order to query
some information. It works fine when I run the Applet Class at
Netbeans.

The Jar containing this Applet (and the Jar supporting the DB driver)
is embedded into a JSP of my Web Application through JSP Plugin tag.

When I call for this JSP (where the Applet is embedded) I get this
error (at the Client Java Console):

java.security.AccessControlException: access denied
(java.net.SocketPermission ... resolve)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.InetSocketAddress.<init>(Unknown Source)
...


How can I fix it?

Regards

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      10-14-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I'm new about developing Java applets and I need some help.


Please, please, please, please, please do not multi-post.


> java.security.AccessControlException: access denied
> (java.net.SocketPermission ... resolve)
> at java.security.AccessControlContext.checkPermission (Unknown Source)
> at java.security.AccessController.checkPermission(Unk nown Source)
> at java.lang.SecurityManager.checkPermission(Unknown Source)
> at java.lang.SecurityManager.checkConnect(Unknown Source)
> at java.net.InetAddress.getAllByName0(Unknown Source)
> at java.net.InetAddress.getAllByName(Unknown Source)
> at java.net.InetAddress.getAllByName(Unknown Source)
> at java.net.InetAddress.getByName(Unknown Source)
> at java.net.InetSocketAddress.<init>(Unknown Source)
> ...
>
>
> How can I fix it?


Sounds like you need to sign your applet.

--
Lew
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
Posts: n/a
 
      10-14-2007
(E-Mail Removed) wrote:
> I'm new about developing Java applets and I need some help.
>
> I'm developing a Web Application based on JSPs and Tomcat in Netbeans.
>
> I've also developed a Java Applet which its package has some classes.
> This Applet connects to a Sybase Database (JConnect) in order to query
> some information. It works fine when I run the Applet Class at
> Netbeans.
>
> The Jar containing this Applet (and the Jar supporting the DB driver)
> is embedded into a JSP of my Web Application through JSP Plugin tag.
>
> When I call for this JSP (where the Applet is embedded) I get this
> error (at the Client Java Console):
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission ... resolve)


An applet can with normal privs only connect to the same host as
it is downloaded from.

You can work around that by signing the applet.

You can do that for an intranet context.

You should not do that for an internet context.

Because everybody can decompile an applet
and read the Sybase username and password used to connect
and it is generally considered bad practice to make a database
server an edge server.

Arne

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to JMatlink with Applets / JWS saifnobel@gmail.com Java 9 12-08-2007 05:11 AM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
java.security.AccessControlException:access denied (java.io.FilePermission help.txt read) Thanasis \(sch\) Java 0 03-01-2004 03:05 PM
Java applets and access to other "clients"! Rune Andresen Java 2 08-24-2003 09:00 PM



Advertisments