Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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 4309 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 437
Projects: 4


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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
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!
Try the Free Demo of Revenge of the Titans
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).

Heroes' Keep is in development.
Meanwhile try Bloodridge
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: 437
Projects: 4


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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (34 views)
2013-05-17 21:29:12

alaslipknot (42 views)
2013-05-16 21:24:48

gouessej (72 views)
2013-05-16 00:53:38

gouessej (71 views)
2013-05-16 00:17:58

theagentd (79 views)
2013-05-15 15:01:13

theagentd (74 views)
2013-05-15 15:00:54

StreetDoggy (116 views)
2013-05-14 15:56:26

kutucuk (139 views)
2013-05-12 17:10:36

kutucuk (140 views)
2013-05-12 15:36:09

UnluckyDevil (148 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.124 seconds with 21 queries.