Win a copy of AWS Security this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problems when trying to retreive a connection using JNDI from an Applet

Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this problem with an applet. I'm currently working on a project that concerns Weblogic Server6.1 and an applet-communication. What i'm trying to do is asking the JNDI-service for a connection(from the connection pool created) which resides within the weblogic server. My applet is signed with all permissions there is but i still get a security permission. I tried to make my webbrowser use my own policy-file as well but i'm not sure if that is the right approach...i still belive that a signed applet with fully permissions should be enough. Yes i have tried this code within an ordinary application and it works like a charm

Here is a code-snippet along with the security exception(Note:the security exception happens on the line where i create a new InitialContext-object):
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, m_sWebLogicURL);
env.put(Context.SECURITY_PRINCIPAL, "test");
env.put(Context.SECURITY_CREDENTIALS, "test");
Context ctx = new InitialContext(env); //Throws a java.lang.SecurityException
mDataSource = (javax.sql.DataSource)ctx.lookup( m_sConnectionPool );
WebLogicPersist.init: caught a SecurityException...
java.lang.SecurityException: java/security/AccessController.doPrivileged: Only fully trusted classes can have native methods as members.
at java/security/AccessController.doPrivileged (
at com/sun/naming/internal/VersionHelper12.getJndiProperties (
at com/sun/naming/internal/ResourceManager.getInitialEnvironment (
at javax/naming/InitialContext.init (
at javax/naming/InitialContext.<init> (
at BAS/data/server/WebLogicPersist.init (
at BAS/data/server/WebLogicPersist.<init> (
at BAS/ (
at java/lang/ (

Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic