Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

security exception running locally

 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to applets. I am playing with an Applet-Servlet chat program and I am having a similar problem to the ones described in these posts:
Applets loading local classes?
Netscape problem with Applet-Servlet Comm.
Netscape 4 Security Exception
But the difference is that all of my files are local. In IE this works fine, but Netscape is throwing an AppletSecurity error. (Mozilla says it can't find the class files at all.)
This is the format of the error I see in the Java console when testing in Netscape 4.7:
General exception: netscape.security.AppletSecurityException: security.class from local disk trying to access url: http://mylocalhost/servlet/vo.chat.ChatServlet
What am I missing? What is the security breach if all of the files are local, including the servlet it is trying to hit? Does Netscape only allow applets to use files that are in the exact same directory the applet came from (I thought this was limited to the same server, but not the same directory only)?
I have made sure all of the Netscape .jar files are in my CLASSPATH, and that does not seem to make a difference.
Thanks!
--liz
[ July 03, 2003: Message edited by: Elizabeth Lester ]
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi liz
class from local disk trying to access url says that the applet code is on the local machine and the url that you are trying to access is "http".
now, the applet restrictions (sandbox) mentions that,
"unsigned applet can only make connection to the hosts from where they got downloaded from"
if we apply this to ur case its clear that u will get an exception as the applet is on the "local host" that is 127.0.0.1 IP and the URL u try to access is on some other host.
try to access a html page via "file://" protocol having that html page on local machine and see if u can run things w/o errors...
now, i'm not sure why in IE it works and in Netscape it doesn't because this Sandbox should apply to both the cases ....
regards
maulin
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey
sorry liz. i seem to be in sleep
u access the servlet on local host only so it should work...
please post ur applet AND servlet and also let us know where u r hosting the applet in the webserver so that we can try to solve the problem...
regards
maulin
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response, Maulin.
I guess before I so carefully listed all of those other posts, I should have carefully tested all of the solutions suggested!
I launched Netscape with an empty CLASSPATH and now it works. I guess this wasn't such a unique problem after all
--liz
[ July 03, 2003: Message edited by: Elizabeth Lester ]
 
kay daly
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey maybe i need to launch IE without a classpath to fix my problem (see Java Access Denied)/ but what r u talking about? where do i go to find a classpath to get rid of it?
tks. k.
 
Elizabeth Lester
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kay,
To launch Netscape with an empty classpath, all I did was create a batch file in the directory with the Netscape executable.
The batch file looks like this:
set CLASSPATH=""
netscape.exe
I have not tried it with IE...but there you are.
--liz
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic