Unknown SecurityExcetion from java webstart app - java-web-start

We saw this exception from 3 different customer installs today (4/14/2015) in the span of a 30 minutes.
java.lang.SecurityException: Can not verify security pack jar
com.sun.deploy.util.SecurityBaseline.verifyJar(Unknown Source)
com.sun.deploy.util.SecurityBaseline.access$200(Unknown Source)
com.sun.deploy.util.SecurityBaseline$1.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
I don't think it's causing a problem as it's in a background thread started from deploy.jar (SecurityBaseline.java) trying to verify something?? The odd thing is that it happened at multiple customers at the same time. The only reason I know about it is that we install an default uncaught exception handler to log and report any unhandled exceptions in the app.
Has anyone else seen this or know what it means? I tried reading a decompiled version of the source, and it wasn't clear exactly where the failure would be. I got the line of the exception, but it could come from 2 different paths, both of which were very non trivial to an outsider.
I'm inclined to ignore it for now, but I'm worried it is foreshadowing a larger problem.

I'm 100% sure that it's caused by
https://bugs.openjdk.java.net/browse/JDK-8077736
If anyone has an account there please make a comment or if you know/can contact maintainers mentioned in the ticket any other way please do.

This bug has been fixed.
javadl-esd-secure.oracle.com/update/securitypack.jar has been updated.
To resolve this issue on systems that are experiencing this problem, simply reinstall 8u45. As the securitypack.jar has been updated, any new installations will not see this issue.

Related

SVNKit Trilead SSH Error - Caused by: java.io.IOException: Cannot negotiate, proposals do not match

Recently, the sshd_config file on our SVN server had to be modified due to security reasons and now we cannot connect to SVN via Eclipse using SSH. The only key exchange methods and MAC methods offered by the SVNKit Trilead library have been removed as options from the sshd_config file and cannot be put back.
I've found this resource at the SVNKit site https://support.tmatesoft.com/t/svn-e210002-svnkit-doesnt-connect-to-remote-repository/2480/15 which is much the same issue I'm experiencing.
Stacktrace
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:231)
at com.trilead.ssh2.Connection.connect(Connection.java:769)
... 40 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:765)
at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480)
at java.base/java.lang.Thread.run(Thread.java:834)
I've been trying to manually patch the Trilead library but have been unsuccessful. There aren't many comments in the classes and pretty hard to follow.
If anyone has any idea of how to address this issue or even another way to SSH into SVN from Eclipse it would really be appreciated. I've been trying to figure this out for almost two weeks. This is the first time I've asked a question on StackOverflow. Thank you all in advance.

How can I get past "There is an error in a scoreDrl or scoreDrlFile"?

I wrote a "minimal" App using OpenJDK 11.0.11 & Optaplanner 8.7.0. I'm building it with maven and run it as a jar.
So far so good, as this works fine with a easyScoreCalculatorClass, but as soon as I move to using Drools I cannot get passed the following error:
Exception in thread "main" java.lang.IllegalStateException: There is an error in a scoreDrl or scoreDrlFile.
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryFactory.java:323)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.decideMultipleScoreDirectorFactories(ScoreDirectorFactoryFactory.java:108)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildScoreDirectorFactory(ScoreDirectorFactoryFactory.java:73)
at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildScoreDirectorFactory(DefaultSolverFactory.java:116)
at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:83)
at ch.twohundredok.compute.App.main(App.java:56)
Caused by: java.lang.NullPointerException
at org.kie.internal.utils.KieHelper.<init>(KieHelper.java:46)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryFactory.java:290)
... 5 more
The exception occurs as soon as solverFactory.buildSolver() is called.
This is the minimal drools file I'm trying to use:
package myapp;
dialect "java"
import myapp.domain.Employee;
import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScoreHolder;
global HardSoftScoreHolder scoreHolder;
rule "firstRule"
when
Employee()
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
How can I get more information on the error?
Is is just that I have a broken Drools file?
Am I missing something else?
The unfortunate fact is that Drools isn't very good at exceptions when things go wrong. I do not see anything obviously wrong in the code you provided, and the fact that the failure comes from KieHelper is strange. That said, I do not have any information to go on, and would need access to your project to be able to find out more.
In the past, there have been several issues with people building executable JARs with Drools in Maven. See this question for one such problem, incl. the solution.
That said, if you're only just starting with your project, I suggest you use Constraint Streams instead. The programming model is very similar, but the code is plain Java, so you get all the IDE magic such as auto-completion, compiler checks etc.

How does jboss server handles migrated .ear and .war files?

I am turning to SO here as my last resort, since my situation has been so illogical that I am at my wits end, even google can't get me a relatively close response.
I'll have to be very chronological. I am maintaining an application in Eclipse. The way application changes apply to the website is when I deploy appropriate .ear and .war files in the jboss test server.
I was relatively new to this whole process, so while learning on this, I stumbled upon occurrence I simply cannot logically comprehend.
1) I made some changes to the application (let's call it changeset_1
for convenience), created appropriate .ear and .war files, deployed
them to the jboss server.
2) Website was returning error 500. No biggie, I thought, let's deploy working files back to server. It returned the same error as if I
didn't deploy originals at all.
3) Restarting jboss server did not accomplish anything.
4) Frustrated, I thought of creating alternate files from the latest deployment directory. So I stored working project directory in the folder neighboring workspace folder used by eclipse. Then I started a new instance of Eclipse, and name new folder as a main namespase (old instance still uses old namespace folder).
5) In a new instance, I did not do any changes, I was just following
the same steps as before to create appropriate .ear and .war files and
deployed them as is to the server.
Now here is an interesting part
After performing steps above, I went to the test site link, and what I saw was: All changes from changeset_1 which I made originally in the first step successfully applied! At the same time, my last deployment was completely ignored.
Can anyone please point me in the right direction on how to approach such situation? Do I miss some kind of fundamental understanding on how all this stuff operates?
I literally don't have any more place to turn to... Unless I could not comprehend such incident to the point I could not explain it properly to google and it was giving me wrong results. Any help is really appreciated!
PS: I will do my best to provide any additional details if needed.
IMPORTANT EDIT
I initially thought I might've missed or misunderstood something, so I have recreated the scenario above for the second time. And for the second time I got the same outcome. Which no longer makes it an accident, but persistent occurrence.
EDIT 2
Upon request, here is a full error log in log file
2016-10-20 08:11:34,492 WARN
[org.jboss.detailed.classloader.ClassLoaderManager] (http-0.0.0.0-8080-1)
Unexpected error during load of:gov.ca.chp.cvs.struts.forms.CVSForm
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251)
at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:150)
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.struts.config.FormBeanConfig.formBeanClass(FormBeanConfig.java:358)
at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)
2016-10-20 08:11:34,492 WARN
[org.jboss.detailed.classloader.ClassLoaderManager]
(http-0.0.0.0-8080-1) Unexpected error during load of:gov.ca.chp.cvs.struts.forms.CVSForm
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452)
Rootcause: "java.lang.UnsupportedClassVersionError: Bad version number in .class file" comes when you compile a Java class in higher version of Java Compiler and run it on lower version of JRE.
Read more: http://javarevisited.blogspot.com/2011/12/bad-version-number-in-class-files-cause.html#ixzz4NjV9ORkF

What am I doing to cause an "IllegalArgumentException: Negative time" exception in install4j?

I've started building Linux installers on the 64 bit windows version of Install4j recently and am getting the error below when it the generated installers start to do their extraction.
Is this something I'm doing wrong or is unsupported? Or a bug in 5.1 of install4j. I've recently upgraded to it as well.
Extracting files ...
yx￯N
An error occurred:
java.lang.IllegalArgumentException: Negative time
Error log: /tmp/install4jError8217531393990762392.log
java.lang.IllegalArgumentException: Negative time
at java.io.File.setLastModified(Unknown Source)
at com.install4j.runtime.installer.helper.fileinst.FileInstaller.install(Unknown Source)
This turned out to simply be a corrupted custom JRE being included in the installer.
Had the same issue. Due to an independent reason one of the files contained in the source directory had a file date in the year 1961.
Since most calenders starts at 198ß a check of that results in a negative timestamp.
After setting a current date the build process worked fine.
So it was not denepending on any version of jdk and had nothing to do with any broken jre installations or something like that.
Hint: In the windows exploerer no file date was shown. This might be helpful for anyone having a similar source file since you won't notice a wrong date as long you don't see it.
Search for file with dates before 1980 or use a commander should help you to find that ones.

Can't find groovy-starter.conf

I'm building a grails app that links to a mongodb database and it's the first time I've used either, it was all going well unitl I dropped the database (I had done this many times before and had no problem) and then when I tried to run the app again it came up with this error...
Exception while configuring main class loader:
java.io.FileNotFoundException: C:\Users\MyUser\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\TC5JXQ28\springsource\grails-2.0.3\conf\groovy-starter.conf (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:133)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
I followed the path and it only gets about halfway through before it breaks. Could anyone help me understand what this means and how to point it back to the right place?