Turning tracing off

Hi,

I’m trying to call the API from an applet, and am getting this error (since applets are not allowed to read system properties)

Any suggestions?

log4j: Could not read system property “log4j.configDebug”.
java.lang.ExceptionInInitializerError: java.security.AccessControlException: acc
ess denied (java.util.PropertyPermission log4j.configuration read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:272)
at java.security.AccessController.checkPermission(AccessController.java:
399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
78)
at java.lang.System.getProperty(System.java:599)
at org.apache.log4j.Category.(Category.java:137)
at com.softwareag.common.instrumentation.logging.Log4jLogger.(Lo
g4jLogger.java:37)
at com.softwareag.common.instrumentation.logging.LoggerFactory.getLogger
(LoggerFactory.java:31)
at com.softwareag.tamino.db.API.common.TTrace.(TTrace.java:91)
at com.softwareag.tamino.db.API.invocation.http.THTTPInvocation.doGetInv
oke(THTTPInvocation.java:189)
at com.softwareag.tamino.db.API.invocation.http.THTTPInvocation.doInvoke
(THTTPInvocation.java:117)
at com.softwareag.tamino.db.API.invocation.http.THTTPInvocation.checkAva
ilableServer(THTTPInvocation.java:251)
at com.softwareag.tamino.db.API.invocation.http.THTTPInvocation.(T
HTTPInvocation.java:77)
at com.softwareag.tamino.db.API.invocation.http.THTTPInvocation.(T
HTTPInvocation.java:91)
at com.softwareag.tamino.db.API.connection.TConnectionFactory.newConnect
ion(TConnectionFactory.java:48)
at Graph.getDataFromTamino(Graph.java:47)
at Graph.init(Graph.java:27)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)

You can use

code:

import com.softwareag.tamino.db.API.common.TTrace;

TTrace.setActiveTrace(false);


to turn off tracing, but I found that whether I set tracing to false or true like this, I got your problem. If I removed all references to TTrace from my code I didn’t get your problem, but I got a new one when I tried to create a new TConnection:
com.ms.security.SecurityExceptionEx[com/softwareag/tamino/db/API/common/TPreference.get]: Unable to access system property: com.softwareag.tamino.db.API.invocation.invocationModifier
at com/ms/security/permissions/PropertyPermission.check (PropertyPermission.java)

So it looks as if you need to sign your applet to make it trusted (or use a servlet instead).

quote:

Sorry, our used logging tool doesn't care about an applet context. So there is only the way to change the java.policy file in case of using a browser or to give your own policy file to the appletviewer. We will change this behaviour in the next version.


Originally posted by Puny Sen:
Hi,

I'm trying to call the API from an applet, and am getting this error (since applets are not allowed to read system properties)

Any suggestions?

log4j: Could not read system property "log4j.configDebug".
java.lang.ExceptionInInitializerError: java.security.AccessControlException: acc
ess denied (java.util.PropertyPermission log4j.configuration read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:272)
at java.security.AccessController.checkPermission(AccessController.java:
399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
78)
at java.lang.System.getProperty(System.java:599)
at org.apache.log4j.Category.(Category.java:137)
at com.softwareag.common.instrumentation.logging.Log4jLogger.(Lo
g4jLogger.java:37)
at com.softwareag.common.instrumentation.logging.LoggerFactory.getLogger
(LoggerFactory.java:31)
at com.softwareag.tamino.db.api.common.TTrace.(TTrace.java:91)
at com.softwareag.tamino.db.api.invocation.http.THTTPInvocation.doGetInv
oke(THTTPInvocation.java:189)
at com.softwareag.tamino.db.api.invocation.http.THTTPInvocation.doInvoke
(THTTPInvocation.java:117)
at com.softwareag.tamino.db.api.invocation.http.THTTPInvocation.checkAva
ilableServer(THTTPInvocation.java:251)
at com.softwareag.tamino.db.api.invocation.http.THTTPInvocation.(T
HTTPInvocation.java:77)
at com.softwareag.tamino.db.api.invocation.http.THTTPInvocation.(T
HTTPInvocation.java:91)
at com.softwareag.tamino.db.api.connection.TConnectionFactory.newConnect
ion(TConnectionFactory.java:48)
at Graph.getDataFromTamino(Graph.java:47)
at Graph.init(Graph.java:27)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)