Java 1.7 is not allowing to access the system root preference in client machine through applet - applet

We need to get the list of hard printers from client machine through applet call.
It works well in java 1.6. But in 1.7 it throws the exception as below even though we gave all permission.
New Method got Error:access denied ("java.lang.RuntimePermission" "preferences")
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "preferences")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.prefs.Preferences.systemRoot(Unknown Source)
at printer.Printers.getAvailableNewPrinters(Printers.java:134)
at printer.Printers.getAvailablePrinters(Printers.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MethodInfo.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MemberBundle.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke0(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$DefaultInvocationDelegate.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

1) Aplication blocked by security settings
There is a problem with the new version of java 1.7 update 51 onwards as restriction is done in three levels
• Very High: Most secure setting - Only Java applications identified by a non-expired certificate from a trusted authority will be allowed to run.
• High (minimum recommended): Java applications identified by a certificate from a trusted authority will be allowed to run.
• Medium - All Java applications will be allowed to run after presenting a security prompt.
http://docs.oracle.com/javase/7/docs/technotes/guides/security/spec/security-spec.doc3.html
might help

Related

Error loading charles XML configuration from Command Line

The following error is shown when trying to opening the CharlesSettings.xml file in the command line.
This file should be in good shape since it was Exported by the Same Charles Application and Environment.
% Charles --config ~/Downloads/CharlesSettings.xml
INFO com.xk72.charles.CharlesContext Loading Configuration
INFO com.xk72.charles.CharlesContext Version 4.6.2
INFO com.xk72.charles.CharlesContext Loading Preferences
WARNING com.xk72.charles.ConfigurationManager Error loading charles XML configuration
java.lang.ClassCastException: class com.xk72.charles.config.ConfigurationImportExport$CharlesExport cannot be cast to class com.xk72.charles.config.CharlesConfiguration (com.xk72.charles.config.ConfigurationImportExport$CharlesExport and com.xk72.charles.config.CharlesConfiguration are in unnamed module of loader 'app')
at com.xk72.charles.j.b(Unknown Source)
at com.xk72.charles.j.c(Unknown Source)
at com.xk72.charles.CharlesContext.f(Unknown Source)
at com.xk72.charles.CharlesContext.init(Unknown Source)
at com.xk72.charles.Main.b(Unknown Source)
at com.xk72.charles.gui.Main.main(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.xk72.lib.a.a(Unknown Source)
at com.xk72.charles.gui.MainWithClassLoader.main(Unknown Source)
at com.xk72.charles.macos.gui.Main.main(Unknown Source)
Charles is shareware. If you continue using Charles you must pay the shareware fee.

Getting error while installing Eclipse 2020-R2

I recently downloaded Eclipse 2020-R2 installer. I was able to install successfully couple of days ago. My computer crashed and had to reinstall OS. Since then I have been unable to install same installer of Eclipse. I am getting Following error:
[2021-01-08 09:34:04] Repository http://download.eclipse.org/releases/2020-12/202012161000
[2021-01-08 09:34:04] Repository http://download.eclipse.org/oomph/updates/milestone/latest
[2021-01-08 09:34:06] ERROR: org.eclipse.equinox.p2.metadata.repository code=1002 Unable to read repository at http://download.eclipse.org/releases/2020-12/202012161000.
org.tukaani.xz.XZFormatException: Input is not in the XZ format
at org.tukaani.xz.common.DecoderUtil.decodeStreamHeader(Unknown Source)
at org.tukaani.xz.SingleXZInputStream.<init>(Unknown Source)
at org.tukaani.xz.SingleXZInputStream.<init>(Unknown Source)
at org.tukaani.xz.XZInputStream.<init>(Unknown Source)
at org.tukaani.xz.XZInputStream.<init>(Unknown Source)
at org.tukaani.xz.XZInputStream.<init>(Unknown Source)
at org.tukaani.xz.XZInputStream.<init>(Unknown Source)
at org.eclipse.equinox.internal.p2.metadata.repository.XZedSimpleMetadataRepositoryFactory.load(XZedSimpleMetadataRepositoryFactory.java:82)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:63)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:775)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.oomph.util.ReflectUtil.invokeMethod(ReflectUtil.java:119)
at org.eclipse.oomph.p2.internal.core.CachingRepositoryManager.loadRepository(CachingRepositoryManager.java:423)
at org.eclipse.oomph.p2.internal.core.CachingRepositoryManager.loadRepository(CachingRepositoryManager.java:214)
at org.eclipse.oomph.p2.internal.core.CachingRepositoryManager$Metadata.loadRepository(CachingRepositoryManager.java:495)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:110)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:105)
at org.eclipse.oomph.p2.internal.core.ProfileTransactionImpl$RepositoryLoader$Worker.perform(ProfileTransactionImpl.java:1578)
at org.eclipse.oomph.util.WorkerPool$Worker.run(WorkerPool.java:434)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
[2021-01-08 09:34:06]

Couldn't connect to the Box API due to a network error?

I am getting below mentioned error while accessing the box api using box java sdk in java application.Please suggest the cause for this problem.
Exception in thread "main" com.box.sdk.BoxAPIException: Couldn't connect to the Box API due to a network error.
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:386)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:200)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:175)
at com.box.sdk.BoxUser.getCurrentUser(BoxUser.java:112)
at com.box.cdm.demo.Main.main(Main.java:24)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:384)
... 4 more
The main causes of this exception - and the things you need to check - are:-
There is no network between your application (the client) and the server (the Box API). Where is the Box instance running, on same machine as your application (locally)?
What port is Box listening on? You need to show your connection code code (endpoint / port etc).
If client and server on different hardware, and you know you have a network connection between them then is Box behind firewall?

Applet not working in Chrome,Firefox but working in IE

I know the subject is similar to some other questions available but none have given satisfactory solution.So here goes the question.I have an applet that works perfectly in IE but doesnt work in Chrome or Firefox.
The trace found in Java console is this:
Java Plug-in 10.25.2.17
Using JRE version 1.7.0_25-b17 Java HotSpot(TM) Client VM
java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.w3.org:80" "connect,resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.a(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc(Unknown Source)
at com.bea.dsp.oam.console.metadatabrowser.datalineage.LineageGraphApplet.start(LineageGraphApplet.java:53)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.nwoods.jgo.svg.DefaultElement.getAttribute(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.buildJGoDoc(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc(Unknown Source)
at com.bea.dsp.oam.console.metadatabrowser.datalineage.LineageGraphApplet.start(LineageGraphApplet.java:53)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The applet tag in the page is like this:
<applet width="100%" code="/LineageGraphApplet.class"archive="/DataLineageApplet.jar" style="border:0px" id="lineageapplet" MAYSCRIPT>
<param name="viewDocumentUrl" value="/generateDocument.do?mode=0"/>
</applet>
What could be the issue and how to resolve it?Similar questions have seen answers like open the port or seeing the applet work using applet viewer in conjugation with a security policy file granting all permissions or signing the jar.But I still was not able to make it work on Firefox?
I had a similar issue once - my applet was also running in IE but not in other browsers. However from the amount of information you have given it is difficult to tell. Do you use authentification (like FormLogin, BasicLogin etc) before one can access the applet? If so you can try the following:
Set (thus disable) the cookie-http-only to false.

Upgrading to JRE7 update 25 causes Applet to crash - extra data given to DerValue constructor

Recently, we upgraded client machines from Java 1.6 to Java 1.7 update 25 and now is encountering problems with IE and Firefox.
Problem occurs each time it will access a applet signed by VeriSign. The exception will be shown: Failed to validate certificate. The Application will not be executed.
java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: java.io.IOException: extra data given to DerValue constructor
at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
at com.sun.deploy.security.TrustDecider.checkRevocationStatus(Unknown Source)
at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source)
at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
... 34 more
Caused by: java.security.cert.CertPathValidatorException: java.io.IOException: extra data given to DerValue constructor
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
... 35 more
Caused by: java.io.IOException: extra data given to DerValue constructor
at sun.security.util.DerValue.init(Unknown Source)
at sun.security.util.DerValue.<init>(Unknown Source)
at sun.security.provider.certpath.OCSPResponse.<init>(Unknown Source)
... 38 more
The applet debug also shows this:
Java Plug-in 10.25.2.17
Using JRE version 1.7.0_25-b17 Java HotSpot(TM) Client VM
User home directory = C:\Users\xxxx
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[https://xxx:8181/xxx/lib/plugin-loader.jar]: updateAvailable=true,lastModified=Thu Jul 04 09:32:27 SGT 2013,length=1549
CacheEntry[https://xxx:8181/xxx/lib/xxx-applet.jar]: updateAvailable=true,lastModified=Thu Jul 04 09:32:27 SGT 2013,length=879421
Missing Permissions manifest attribute for: https://xxx:8181/xxx/lib/xxx-applet.jar
Missing Codebase manifest attribute for: https://xxx:8181/xxx/lib/xxx-applet.jar
CacheEntry[http://crl.thawte.com/ThawtePremiumServerCA.crl]: updateAvailable=false,lastModified=Thu Jan 01 07:30:00 SGT 1970,length=2520
CacheEntry[http://crl.thawte.com/ThawteCodeSigningCA.crl]: updateAvailable=false,lastModified=Thu Jan 01 07:30:00 SGT 1970,length=2516
As stated by the update from Oracle, we added attribute Trusted-Library: true in the Manifest file but the same error occurs
Trusted-Library: true
We also tried changing the run-time in the server side from 1.6 to 1.7, but no avail. The server is glassfish.
Most probably your/provider/corporate firewall prohibits access to the ocsp.verisign.com, crl.verisign.com,.. or similar, access to they should be visible in Java Console. The worst thing here that firewall provides custom not expected response as for OCSP protocol to Java (or to any client out of allowed URLs) that confuses Java.
Oracle introduced security updates in its Java 7 update 21 release onwards. In which it deprecate the unsigned code and new prompts are introduced for self-signed code. You need to sign the code by CA certificates. Please check the release notes of Java 7 update 21 and update 25