2

This may be old error but I am stuck here.

I created Java applet to access an Oracle database. I am going to put this applet in Local Network. My applet works fine in Eclipse and Netbeans but when I run through 'appletviewer' it goes at connection string and showing an error:

Error e java.security.AccessControlException: access denied (
    "java.util.PropertyPermission" "oracle.net.wallet_location" "read")

I already signed applet using this Oracle technique for Signed Applets.

I used the user of database who has full rights. Also when I run using policy file, it shows the same error.

How do I connect the applet to the database successfully?


The HTML used to load the applet is:

<applet
    code=tree.pacg.DrawApplet.class
    codebase=c:\tree\pacg
    archive=DrawApplet.jar,ojdbc14.jar
    height="800"
    width="1000"> 
</applet>
Roman C
  • 49,761
  • 33
  • 66
  • 176
Bahirji Naik
  • 175
  • 1
  • 2
  • 16
  • when i run the applet in ie, it show security warning `Java has discovered application components that could indicate a secuirty concern.` I clicked on 'yes'. but then nothing display.. – Bahirji Naik Dec 23 '11 at 06:04
  • Sir, my total applet code is ` ` – Bahirji Naik Dec 23 '11 at 09:17
  • 1
    1) `code` should be `tree.pacg.DrawApplet`. 2) `codebase` should be an URL, something like `file:C:///tree/pacg` 3) `ojdbc14.jar` needs to be digitally signed when deploying this way. Is `ojdbc14.jar` digitally signed? 4) For best results, include all attributes in double quotes ("). – Andrew Thompson Dec 23 '11 at 09:45
  • 1
    1) yes code is `tree.pacg.DrawApplet` 2) I put codebase in `file:/C:/tree/pacg` 3) `ojdbc14.jar` is a oracle database drivers so that they are already signed 4) I put all attributes value in double quotes... but the same error – Bahirji Naik Dec 23 '11 at 10:02

2 Answers2

1

Its solved !!

I signed the ojdbc14.jar file and it works !!

also I create new policy file and gave it 'All' access permission then it also work through 'appletviewer'

Thanks..Thank you sir..

Bahirji Naik
  • 175
  • 1
  • 2
  • 16
1

when i run the applet in ie, it show security warning Java has discovered application components that could indicate a secuirty concern.

Something like this?

Mixed code security warning

BTW - if you click No at this point, the code should not be blocked and should therefore run.

But even seeing that dialog is a nuisance. If it can be confusing to developers, it is bound to be confusing to an end user.


See Mixing Signed and Unsigned Code Ensuring Application and Applet Security for an explanation of this behavior. But see particularly Deploying Signed Applications and Applets Securely Without a Mixed Code Warning for how to allow mixing of unsigned & signed code.

The other alternative - to sign all Jars using the same certificate - also works, but is sometimes forbidden by deployment licenses or other factors.

On signing the code.

Me.

3) ojdbc14.jar needs to be digitally signed when deploying this way. Is ojdbc14.jar digitally signed?

OP.

3) ojdbc14.jar is a oracle database drivers so that they are already signed

..followed 4 hours later by..

I signed the ojdbc14.jar file and it works !!

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    Note, if you click No to that dialog, you are effectively giving permissions to unsigned code. – Tom Hawtin - tackline Dec 26 '11 at 00:00
  • See [here](http://www.remkoweijnen.nl/blog/2013/03/19/java-has-discovered-application-components-that-could-indicate-a-security-concern/) for changing the Mixed Code setting programmatically – Remko Mar 22 '13 at 13:49