Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (602)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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 7250 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

« JGO Overlord »

Medals: 1019
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #30 - Posted 2009-05-18 19: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 Devvie

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

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 Devvie

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

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

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 14: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 Devvie

« Reply #34 - Posted 2009-05-23 07: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 Devvie

« Reply #35 - Posted 2009-05-23 18: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: 1019
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #36 - Posted 2009-05-23 20: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.

Jesse (15 views)
2015-07-29 04:35:27

Riven (37 views)
2015-07-27 16:38:00

Riven (18 views)
2015-07-27 15:35:20

Riven (21 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (30 views)
2015-07-25 00:14:37

BurntPizza (41 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (31 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!