I'v been trying to resolve this program for days. I have done all the research I can and also tried all the fixes that I saw.
I am using netbeans 7.4 with Microsoft sql 2012.
Error code: java.security.AcessControlException: access denied ("java.net.SocketPermission" "Worms:1433" "connect,resolve")
Worms = SQL
When I run the applet in netbeans it works like a charm.
After I compile it and open my .html file I get this error.
I have tried to add a policy in root of project
My applet.html is in my build.
permission java.net.SocketPermission "*", "resolve";
permission java.net.SocketPermission "*", "connect";
I have done everything I can think of and read.
Does anyone have a answer to why this happened?
Thanks in advanced..
Pretty sure you need to change the policy file in the browser. Changing it in the project will have no impact.
Additionally note that it is going to be a bad idea to run an applet on the internet that accesses the database because the database would then need to be exposed to internet. And these days using applets, on the internet, is generally not considered a good idea because so many people have been told not to allow that.
And these days using applets, on the internet, is generally not considered a good idea because so many people have been told not to allow that.
Is this upcoming change one of the things you are alluding to?
Java Content in the Browser - Security Changes
Developers: As of 7u51, (January, 2014), your Rich Internet Applications (RIAs, also known as Applets and Web Start applications) must be updated. The updates required are on the packaging and distribution; no API code changes should be required. The impetus for these changes relates to potential re-purposing of sandboxed applications, whereby placing permissions within a signed JAR prevents modification of your specified permission level.
>Is this upcoming change one of the things you are alluding to?
No. Rather many suggest turning off java in browsers because of the potential security risk. Which is supported by Java, in browsers, being listed as the number one security threat vector for a number of years now. So people tell other people to not allow them.
> so in other words Java Applets are no good anymore?
That depends on what you are doing.
If you are creating an application that only runs internally to a company and the company doesn't disallow them then ok.
If you are creating a consumer service that you expect random consumers to use then you should do it some other way.
so in other words Java Applets are no good anymore?
IMO, they were never good to begin with. If not security-wise then implementation-wise. What I never understood is that applets would just run without question when you would navigate to a page that had one (although as time progressed that was blocked by more and more security popups of course) :/ Its still an application that automagically starts doing things and stuff.
I liked more the idea of webstart so you could "break out" Java applications from the browser while still running in a protected sandbox environment, but alas it was never really implemented very well either. Just see the history of problem posts you can find in this forum alone.
> they were never good to begin with
To be fair when they were introduced there wasn't a lot of choice. Might have been no choice. Far as I can recall only alternative, and not from the beginning, was an ActiveX control which had basically the same problems or even more so.