Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  applets no longer have permission to access "localhost"???  (Read 5409 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #30 - Posted 2009-05-18 21:38:37 »

only the host that hosts your jar files (the code base)

anyway, *always* do *something* with your exception, if nothing else, print them, using e.printStackTrace()

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline neoskunk

Junior Member





« Reply #31 - Posted 2009-05-21 08:42:24 »

Quote
Maybe some more questions will provide a clue.
What webserver are you running, apache?
What browser are you using?
Do you get the same result using a different browser?
What is the URL you enter in the browser?

im not running any webserver.
im not using a browser either.

im running and coding the applet from a program called BlueJ.
as for the server application im just running it from the windows command prompt.

as i said before im just trying to test out connections and stuff...i had a working client applet and server application and for some reason all of a sudden im getting the error i posted above.
Offline Wildern

Junior Member





« Reply #32 - Posted 2009-05-21 16:21:12 »

You could try making an html page in the directory with your class files that has an applet tag
1  
2  
3  
<html><head></head><body>
<applet code="yourmain.class" width= height=></applet>
</body></html>

Then, open that file in a browser and see if you get the same error.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SimonH
« Reply #33 - Posted 2009-05-21 16:58:06 »

im not using a browser either.
Huh If you're not using a browser, why use an applet?
If you wrap your app within a Frame instead of within an Applet, it could then do anything it liked with sockets.

In short: if your game is a download (eg webstart) then use a Frame, if your game will run in a browser then use an Applet (but you must observe the sandbox restrictions for sockets; same host, same port - see Riven's applet).

People make games and games make people
Offline neoskunk

Junior Member





« Reply #34 - Posted 2009-05-23 09:44:06 »

i will try your suggestion wildern and see what happens.

im not currently using a browser but if i ever put the game out there i kinda wanted it to just be an applet on a page not something the users had to download.  also im aware of the sandbox restrictions and i dont think im currently violating any of them.  i posted the entire code for applet and server that i tried.  if there is something wrong with it please point it out.

also while on the subject of files....does the server application file need to be in the same file as the applet?   or would anything like that throw the exception im getting?
Offline Wildern

Junior Member





« Reply #35 - Posted 2009-05-23 20:39:19 »

I was able to reproduce your issue on my XP machine.
It looks like you need to install Apache.
Once I installed Apache and put the HTML file with the applet tag and the testing.class file in the htdocs directory, I was able run the applet without a security exception.
Attempts to open the HTML file in a browser or with appletviewer without using Apache all resulted in the security exception.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #36 - Posted 2009-05-23 22:22:16 »

Well, it makes sense. If your protocol is "file://localhost/C:/../" instead of "http://www..", your codebase would be your applet folder, and all subfolders. This would be a major security issue, and you'd be able to read all files if your applet was placed in your C:\ root. After that, you can use [liveConnect + image request] to send the gathered data to another server.

So you need an http-host, not a file system.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (57 views)
2014-04-15 18:08:23

BurntPizza (55 views)
2014-04-15 03:46:01

UprightPath (68 views)
2014-04-14 17:39:50

UprightPath (51 views)
2014-04-14 17:35:47

Porlus (68 views)
2014-04-14 15:48:38

tom_mai78101 (93 views)
2014-04-10 04:04:31

BurntPizza (153 views)
2014-04-08 23:06:04

tom_mai78101 (249 views)
2014-04-05 13:34:39

trollwarrior1 (205 views)
2014-04-04 12:06:45

CJLetsGame (213 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!