Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How do I grant applications launched through JWS socket permission?

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application that needs two kinds of permissions, file permission to read from a text file
and a socket permission to connect to a SQL server.
I have solved the file permission by adding <all-permissions/> to my jnlp file but my application fails to connect to the SQL server.
I read somewhere that JWS doesn't allow custom policy files so I'm wondering how I can grant my application the permission. I also tried adding <j2ee-application-client-permissions/> to my jnlp file but with same results.
I'm using com.mysql.jdbc.Driver to connect to my SQL server and I have signed both the driver and my application's jar file.
 
Marshal
Posts: 26910
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would help to see the stack trace of the exception which is thrown. Could you post that?
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The trace file is considerably larger but I copy-pasted the bottom part.



I tried running the application through command prompt with javaws tetris.jnlp and it works, but it won't if I run through the browser.
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out, the problem was not permission issue. Webstart downloads the application from the server and then runs on the clients machine which causes a file not found exception since the logging information file required to connect to mysql could not be found in the firefox directory

I guess I need to rethink my approach as to how to connect to the database from the java application
 
Paul Clapham
Marshal
Posts: 26910
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's this "logging information file"? I use MySQL and I never heard of such a thing.

 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was supposed to say "login information file"
Its just a text file containing servername, databasename, username and password
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic