Getting Exception: java.lang.SecurityException: attempted to open sandboxed jar as Trusted-Only - jarsigner

We need to sign all 5 .class java files. That we have done by creating a .jar file and signed it too. But while executing my web application it is showing below error message in Java Console
java.lang.SecurityException: attempted to open sandboxed jar https://xxxxxxxxxxx.com/xxxx/JavaApplet.jar as Trusted-Only
at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(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.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.SecurityException: attempted to open sandboxed jar https://xxxxxxxxxxx.com/xxxx/JavaApplet.jar as Trusted-Only*
I am not sure about this error. I have signed Jar 3-4 times after getting this error but I am getting same error again again.
Please can anybody help me if I am doing something wrong?

Check your Manifest.mf file of jar. This should contain the Trusted-Library: true if you are using MixedCode(Applet called from the javascript) and your files are self signed. oracle has released latest security updates in Java 7 update 21. According to the release notes you must sign your code with CA certificates only, else JRE will treat your code as malicious. oracle is totally deprecating the Mixedcode. Please check the release notes of latest updates. But before adding the attribute Trusted-Library: true in manifest.mf make sure you are aware of the effects of the attribute.

Related

TestNG setup issue- Cannot find class in classpath

I am pretty new to TestNG framework. I did download TestNG from the link http://beust.com/eclipse. Post this I created a new Java Project named as MyProject and a new TestNG class file "NewTest". I did write a small piece of Code with #Test annotation to launch Firefox browser and navigate to Google. I tried searching the web for possible solutions to sort this issue but I am not able to find the low level steps on how this can be corrected. Please help.
Output
org.testng.TestNGException: Cannot find class in classpath: NewTest
at org.testng.xml.XmlClass.loadClass(XmlClass.java:81)
at org.testng.xml.XmlClass.init(XmlClass.java:73)
at org.testng.xml.XmlClass.<init>(XmlClass.java:59)
at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:582)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.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.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.testng.xml.XMLParser.parse(XMLParser.java:39)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
at org.testng.xml.Parser.parse(Parser.java:170)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:109)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
Move Package1 inside src directory and run the code.
Note: Eclipse run .java files from src directory, and create .class files in bin directory.
It seems that I did not update my Eclipse for few months. I did navigate to Eclipse->Help->Check for updates->Completed installing all updates. Post this the test did run fine.

A JNI error has occurred, please check your installation and try again Exception in thread "main"

I am facing a issue while trying to run my executable JAR file for my cucumber project (A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: no manifiest section for
signature file entry org/bouncycastle/mail/smime/SMIMEEnvelopedGenerator$Envelo
pedGenerator.class)
Few Important Points : 1.) I am using Idea IntelliJ and created executable JAR
2.) I am using Gradle as a build tool
3.) I am using cucumber framework and want to run only specific test mentioned in my cucumber options using executable JAR
Please find below the complete Error Stack Trace
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: no manifiest section for
signature file entry org/bouncycastle/mail/smime/SMIMEEnvelopedGenerator$Envelo
pedGenerator.class
at sun.security.util.SignatureFileVerifier.verifySection(Unknown Source)
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
at sun.misc.Resource.cachedInputStream(Unknown Source)
at sun.misc.Resource.getByteBuffer(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Please let me know for any more information required.Read many articles but could'nt able to find any solution.Thanks in advance

Android Studio fails to start - Cannot register font

I've just downloaded the latest Android Studio (v0.1.1) and installed it, however the program will not run.
I am running on Windows 8, 64 bit.
I have added both the environment variables (JDK_HOME and JAVA_HOME).
When running studio.bat through a command prompt (with administer privileges), it outputs this:
C:\Program Files (x86)\Android\android-studio\bin>studio.bat
ERROR: Cannot register font: /fonts/Inconsolata.ttf
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont(Unknown Source)
at com.intellij.ui.AppUIUtil.registerFont(AppUIUtil.java:129)
at com.intellij.ui.AppUIUtil.registerBundledFonts(AppUIUtil.java:120)
at com.intellij.idea.MainImpl.start(MainImpl.java:48)
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 com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:194)
at java.lang.Thread.run(Unknown Source)
java.lang.reflect.InvocationTargetException
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 com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:194)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.AssertionError: Cannot register font: /fonts/Inconsolata.tt
f
at com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.jav
a:55)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:65)
at com.intellij.ui.AppUIUtil.registerFont(AppUIUtil.java:137)
at com.intellij.ui.AppUIUtil.registerBundledFonts(AppUIUtil.java:120)
at com.intellij.idea.MainImpl.start(MainImpl.java:48)
... 6 more
To try and fix the problem I have downloaded the Inconsolatta.tff file from Google and installed it myself, as well as placed the file in the directory where the bat file is looking for it (it wasn't there originally... odd), however to no avail.
Can anyone explain what I need to do to get this working? I quite like Android Studio!
BTW, on previous install attempts, if I ran the program at the end of it's install, it loaded up, but then any attempt after closing it it did not work, if that helps...

YouTrack java.lang.OutOfMemoryError - Teamcity integration

We are getting the error below which is causing YouTrack to crash.
We are using YouTrack to scan TeamCity for changes which I beleive is causing the issue below.
How much memory should YouTrack need to run with TeamCity integration and which config should we use to allow for this increase memory usage?
Error Message:
26 Sep 2011 22:20:00,043 ERROR [SuccessfulBuild_Then] [ssor0] Error while processing Teamcity integration for project [Connectors]
java.lang.OutOfMemoryError
at java.util.zip.Inflater.init(Native Method)
at java.util.zip.Inflater.<init>(Unknown Source)
at java.util.zip.ZipFile.getInflater(Unknown Source)
at java.util.zip.ZipFile.getInputStream(Unknown Source)
at java.util.zip.ZipFile.getInputStream(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source)
at com.sun.jersey.spi.service.ServiceFinder.parse(ServiceFinder.java:455)
at com.sun.jersey.spi.service.ServiceFinder.access$300(ServiceFinder.java:144)
at com.sun.jersey.spi.service.ServiceFinder$AbstractLazyIterator.hasNext(ServiceFinder.java:529)
at com.sun.jersey.spi.service.ServiceFinder.toClassArray(ServiceFinder.java:373)
at com.sun.jersey.core.spi.component.ProviderServices.getServiceClasses(ProviderServices.java:295)
at com.sun.jersey.core.spi.component.ProviderServices.getProviderAndServiceClasses(ProviderServices.java:274)
at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:181)
at com.sun.jersey.core.spi.factory.InjectableProviderFactory.configure(InjectableProviderFactory.java:104)
at com.sun.jersey.api.client.Client.<init>(Client.java:209)
at com.sun.jersey.api.client.Client.<init>(Client.java:150)
at com.sun.jersey.api.client.Client.create(Client.java:472)
at jetbrains.charisma.teamcity.rest.TeamcityRest.<init>(TeamcityRest.java:60)
at jetbrains.charisma.teamcity.rest.TeamcityRest.<init>(TeamcityRest.java:66)
at jetbrains.charisma.teamcity.rest.TeamcityRest.create(TeamcityRest.java:249)
at jetbrains.charisma.teamcity.persistence.TeamcityBuildConfMappingImpl.process(TeamcityBuildConfMappingImpl.java:140)
at jetbrains.charisma.teamcity.persistence.TeamcityIntegration_watchNewSuccessfulBuild_Then.run(TeamcityIntegration_watchNewSuccessfulBuild_Then.java:26)
at jetbrains.mps.businessRules.runtime.impl.RuleJobImpl._execute(RuleJobImpl.java:68)
at jetbrains.mps.businessRules.runtime.impl.RuleJobImpl.access$000(RuleJobImpl.java:14)
at jetbrains.mps.businessRules.runtime.impl.RuleJobImpl$1.run(RuleJobImpl.java:46)
at jetbrains.mps.businessRules.runtime.TransactionalExecutor.execute(TransactionalExecutor.java:23)
at webr.framework.controller.BeanContainerAwareExecutorWrapper.execute(BeanContainerAwareExecutorWrapper.java:23)
at jetbrains.mps.businessRules.runtime.impl.RuleJobImpl.execute(RuleJobImpl.java:44)
at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at com.jetbrains.teamsys.core.execution.RunnableJob.execute(RunnableJob.java:25)
at com.jetbrains.teamsys.core.execution.Job.run(Job.java:75)
at com.jetbrains.teamsys.core.execution.ThreadJobProcessor.executeJob(ThreadJobProcessor.java:110)
at com.jetbrains.teamsys.core.execution.JobProcessorQueueAdapter.doJobs(JobProcessorQueueAdapter.java:86)
at com.jetbrains.teamsys.core.execution.ThreadJobProcessor.run(ThreadJobProcessor.java:89)
at com.jetbrains.teamsys.core.execution.ThreadJobProcessor$1.run(ThreadJobProcessor.java:25)
at java.lang.Thread.run(Unknown Source)
Please Note: This error happens several times before completely crashing.
Josh,
Try to increase JVM heap size that YouTrack uses:
Open YouTrack service properties ("YouTrack Web Service" under Computer Management -> Services and Applications -> Services) and set the following line into start parameters input
++JvmOptions "-Xmx1024M"

Jenkins slave throws "Classloading from system classloader disabled" exception

When running a Maven2 job on a slave instance (Master on AIX 5.3; slave on Windows 2008(R2)), I get the following message (complete stack trace pasted in below): "java.lang.ClassNotFoundException: Classloading from system classloader disabled". This happens with the first job after the slave instance is started (it's running as a Windows service). After that, I get a "java.lang.NoClassDefFoundError: Could not initialize class hudson.maven.MavenModuleSetBuild" error.
If I create a freestyle job, and include the maven command as a batch command to run on the slave, it works fine. The Maven2 job appears to locate Maven on the slave machine, but it apparently can't find the maven-plugin (probably due to the classloading error).
I've searched and posted a ticket to the jenkins-ci site, but no luck as of yet. Has anyone run into this problem?
Stacktrace:
Found mavenVersion 2.2.1 from file jar:file:/C:/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
ERROR: Failed to parse POMs
hudson.util.IOException2: remote file operation failed: c:\jenkins-slave\workspace\AO_SISO_AT-smoketest-CIT1 at hudson.remoting.Channel#7b827b82:10.40.163.105
at hudson.FilePath.act(FilePath.java:752)
at hudson.FilePath.act(FilePath.java:738)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:817)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:617)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1374)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:467)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: Remote call on 10.40.163.105 failed
at hudson.remoting.Channel.call(Channel.java:652)
at hudson.FilePath.act(FilePath.java:745)
... 8 more
Caused by: java.lang.ExceptionInInitializerError
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1236)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1110)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1956)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:60)
at java.lang.Thread.run(Unknown Source)
Caused by: com.thoughtworks.xstream.XStream$InitializationException: Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null
at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:735)
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:699)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:323)
at hudson.util.XStream2.<init>(XStream2.java:62)
at hudson.model.Run.<clinit>(Run.java:1867)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:728)
... 19 more
Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
at javax.xml.datatype.DatatypeFactory.newInstance(Unknown Source)
at com.thoughtworks.xstream.converters.extended.DurationConverter.<init>(DurationConverter.java:33)
... 24 more
Caused by: java.lang.ClassNotFoundException: Classloading from system classloader disabled
at java.lang.Throwable.<init>(Throwable.java:56)
at java.lang.Throwable.<init>(Throwable.java:80)
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:80)
at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:799)
I had similar issue. Researched internet but did not get any solution. Finally debugged the jenkins/hudson and resolved this issue.
The root cause of this error is that recent versions of jenkin is shipped with xml parser within jenkins.war file. Looks like if your server already has this jar file, it won't let jenkin application to reload its own version of xml parsers. So to resolve this issue I have removed file xercesImpl-2.9.1.jar from WEB-INF/lib directory of jenkins.war file. After that replaced existing war file and restarted server. And it worked as without any problem.