Jenkins using the wrong commons-io - java

Ok I'll just reformulate my question with new clues I found as I didn't get an answer with the previous one.
So!
Jenkins is using the wrong commons-io.
I'm running version 1.598 of Jenkins. In the "about" section, I can see that it's using commons-io version 2.4.
When I run my maven project on Jenkins, project build is a success, but when Jenkins start running PMD or checkstyle analysis, I have the following error:
java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.lineIterator(Ljava/io/InputStream;Ljava/nio/charset/Charset;)Lorg/apache/commons/io/LineIterator;
at hudson.plugins.analysis.util.JavaPackageDetector.detectPackageName(JavaPackageDetector.java:34)
at hudson.plugins.analysis.util.AbstractPackageDetector.detectPackageName(AbstractPackageDetector.java:25)
at hudson.plugins.analysis.util.PackageDetectors.detectPackageName(PackageDetectors.java:30)
at hudson.plugins.checkstyle.parser.CheckStyleParser.convert(CheckStyleParser.java:96)
at hudson.plugins.checkstyle.parser.CheckStyleParser.parse(CheckStyleParser.java:72)
at hudson.plugins.analysis.core.AbstractAnnotationParser.parse(AbstractAnnotationParser.java:54)
at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:323)
at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:281)
at hudson.plugins.analysis.core.FilesParser.parseSingleFile(FilesParser.java:239)
at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:198)
at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
at hudson.FilePath.act(FilePath.java:989)
...
This method (lineIterator(Ljava/io/InputStream;Ljava/nio/charset/Charset;)) exists in commons-io 2.4 so my guess is that Jenkins is using another jar.
I ran a locate on the server for commons-io and here is the result:
/etc/nexus/2.10/nexus/WEB-INF/lib/commons-io-2.4.jar
/etc/nexus/sonatype-work/nexus/storage/central/commons-io
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/1.4
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.2
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.4
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/1.4/commons-io-1.4.jar
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/1.4/commons-io-1.4.pom
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.2/commons-io-2.2.jar
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.2/commons-io-2.2.pom
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.4/commons-io-2.4.jar
/etc/nexus/sonatype-work/nexus/storage/central/.nexus/attributes/commons-io/commons-io/2.4/commons-io-2.4.pom
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/1.4
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.2
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.4
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/1.4/commons-io-1.4.jar
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/1.4/commons-io-1.4.pom
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.2/commons-io-2.2.jar
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.2/commons-io-2.2.pom
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.4/commons-io-2.4.jar
/etc/nexus/sonatype-work/nexus/storage/central/commons-io/commons-io/2.4/commons-io-2.4.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/jars
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/poms
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/jars/commons-io-1.4.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/jars/commons-io-2.2.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/jars/commons-io-2.4.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/poms/commons-io-1.4.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/poms/commons-io-2.2.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/.nexus/attributes/commons-io/poms/commons-io-2.4.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/jars
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/poms
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/jars/commons-io-1.4.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/jars/commons-io-2.2.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/jars/commons-io-2.4.jar
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/poms/commons-io-1.4.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/poms/commons-io-2.2.pom
/etc/nexus/sonatype-work/nexus/storage/central-m1/commons-io/poms/commons-io-2.4.pom
/home/jenkins/.m2/repository/commons-io
/home/jenkins/.m2/repository/commons-io/commons-io
/home/jenkins/.m2/repository/commons-io/commons-io/1.4
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/_maven.repositories
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar.md5
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.pom
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.pom.md5
/home/sonarqube-4.5.2/lib/common/commons-io-2.4.jar
/root/nexus-2.10.0-02/nexus/WEB-INF/lib/commons-io-2.4.jar
/usr/share/doc/libcommons-io-java
/usr/share/doc/libcommons-io-java/NOTICE.txt
/usr/share/doc/libcommons-io-java/RELEASE-NOTES.txt.gz
/usr/share/doc/libcommons-io-java/changelog.Debian.gz
/usr/share/doc/libcommons-io-java/copyright
/usr/share/java/commons-io-1.4.jar
/usr/share/java/commons-io.jar
/usr/share/maven-repo/commons-io
/usr/share/maven-repo/commons-io/commons-io
/usr/share/maven-repo/commons-io/commons-io/1.4
/usr/share/maven-repo/commons-io/commons-io/debian
/usr/share/maven-repo/commons-io/commons-io/1.4/commons-io-1.4.jar
/usr/share/maven-repo/commons-io/commons-io/1.4/commons-io-1.4.pom
/usr/share/maven-repo/commons-io/commons-io/debian/commons-io-debian.jar
/usr/share/maven-repo/commons-io/commons-io/debian/commons-io-debian.pom
/var/cache/jenkins/war/WEB-INF/lib/commons-io-2.4.jar
/var/lib/dpkg/info/libcommons-io-java.list
/var/lib/dpkg/info/libcommons-io-java.md5sums
/var/lib/jenkins/.m2/repository/commons-io
/var/lib/jenkins/.m2/repository/commons-io/commons-io
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.2
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar.sha1
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.pom
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.pom.sha1
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar.sha1
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.pom
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.pom.sha1
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar.sha1
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.pom
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.pom.sha1
/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/commons-io-2.2.jar
As you can see there is some occurences of the commons-io 1.4, which does not contains the missing method! So it must be the one Jenkins uses.
In the log of the project I can see:
java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.6.jar:/usr/share/maven2/boot/classworlds.jar hudson.maven.agent.Main /usr/share/maven2/ /var/cache/jenkins/war/WEB-INF/lib/remoting-2.49.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.6.jar 56025
And in the locate:
/home/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
/usr/share/java/commons-io-1.4.jar
/usr/share/maven-repo/commons-io/commons-io/1.4/commons-io-1.4.jar
/var/cache/jenkins/war/WEB-INF/lib/commons-io-2.4.jar
/var/lib/jenkins/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
/var/lib/jenkins/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
So I guess the problem lies somewhere around here, but I have no idea how to fix it!
I can't just remove occurences of commons-io 1.4 from the server as some other programs might use them.
Thank you for your help,
Guillaume

We found the solution!
It seems that this was cause by the maven version used on the server (2.2).
I upgraded it in Jenkins to 3.2.2 and it now works perfectly!

Related

Wix embedded mysql does not start due CommandFailedException due 'Stream closed'

Trying to run my embedded mysql based Unit tests I get an exception with this part:
Failed to instantiate [com.wix.mysql.EmbeddedMysql]: Factory method 'getEmbeddedMysql' threw exception; nested exception is com.wix.mysql.exceptions.CommandFailedException: Command 'CREATE USER 'sa'#'%' IDENTIFIED BY '';' on schema 'information_schema' failed with message 'Stream closed'
The same unit test and environment setup work on my MacBook
This machine with the error is an Ubuntu 20.04
Wix version is 4.6.2; Java 8, mysql.connector 8.0.24
I tried changing the dependencies versions and also tried with Java 11.
Run from within IntelliJ and on the command line. Same result.
Let me put the full comment I found in Github which helped me to fix this and I'm pretty sure most of the people seeing this in Ubuntu will find this as the solution:
I had this same issue with MySQL 5.7, while working on another open source project. I cloned the wix-embedded-mysql repository and ran the tests using the master branch, which also failed in the exact same way, except that I received a longer, more thorough message in the catch.
The issue was that I was on Ubuntu and did not have the ncurses 5 shared library installed. On ubuntu, I installed libncurses5 (apt install libncurses5) and everything started working (all tests on wix, and on my project).
I hope this helps resolve the issue.
Thanks to https://github.com/codesplode

Jenkins fails to start up and empty plugins directory

I am new to jenkins, I upgraded a couple of plugins(don't remember which), after that I when I try java -jar jenkins.war I end up getting the following error.
jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading global config
java.io.IOException: Unable to read /home/.jenkins/config.xml
I went through several links which address this issue, but no luck yet. In this link which I found https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764711 it says some plugins are missing, and surprisingly, my /home/.jenkins/plugins/ is empty!!!
How do I restore the necessary plugins from my command line?
I am using CentOS release 6.8 (Final)
Thank you :)
I had encountered this issue somedays back,however after restarting jenkins service solved the issue.
The best you can do now is rename your config file. This way jenkins will load with the default startup.

Unparseable date after upgrading/downgrading Jenkins

So, finally trying to come up from the stone age, upgraded 1.514 to 1.644 without realizing all slaves need to be running Java 1.7 as well. So I install Java 7 on my master, swap .war files to run 1.644 and start it up. Slaves don't come up due to the aforementioned Java req. After stopping Jenkins and removing Java 1.7, I swap back to the 1.514 .war and start Jenkins back up. Now my build history is gone from all jobs with this error in the log:
WARNING: could not load /var/lib/jenkins/jobs/[job name removed]/builds/312 hudson.util.IOException2: Invalid directory name /var/lib/jenkins/jobs/YYMM Check and Build/builds/312 at hudson.model.Run.parseTimestampFromBuildDir(Run.java:354)
...
Caused by: java.text.ParseException: Unparseable date: "312" at java.text.DateFormat.parse(DateFormat.java:354) at hudson.model.Run.parseTimestampFromBuildDir(Run.java:352) ... 155 more
The only things I can find online relate to issues that were fixed pre-1.514. Anyone have any ideas? Thanks for helping.
Installed the latest version that works with Java 1.6: 1.607, and that fixed the issue as soon as it started up.
Your issues are likely related the change to the build directory naming, see JENKINS-24380+Migration.
In case you want to downgrade, there is an “unmigrate” script provided to reverse the migration of $JENKINS_HOME. To do this:
Start Jenkins ≥1.597.
Visit http://server/jenkins/JENKINS-24380/ and copy the unmigration instruction.
Shut down Jenkins completely.
Run the command as instructed by the step above.
Start Jenkins <1.597 with the same $JENKINS_HOME.

HypergraphDB Netbeans settings

I want to do something with the HypergraphDB in Java. I'm not very familiar with this language and IDE Netbeans.
I followed steps describing the HGDB installation:Link to tutorial
Now I want to write an example in Java (using NetbeansIDE).
So I created new project, added refferences to the downloaded libraries. OK, now I'm able to import packages with HGDB. The only thing I have in my main method is HyperGraph HG = new HyperGraph(dbLocation);. This code compiles. But get following runtime error:
run:
checkpoint kbytes:0
checkpoint minutes:0
java.lang.IllegalStateException: There is 1 existing transaction opened against the Environment.
Aborting open transactions ...
aborting <Transaction id="28">
at com.sleepycat.je.Environment.close(Environment.java:383)
at org.hypergraphdb.storage.bje.BJEStorageImplementation.shutdown(BJEStorageImplementation.java:178)
at org.hypergraphdb.HGStore.close(HGStore.java:355)
at org.hypergraphdb.HyperGraph.open(HyperGraph.java:392)
at org.hypergraphdb.HyperGraph.open(HyperGraph.java:213)
at org.hypergraphdb.HyperGraph.<init>(HyperGraph.java:200)
at hgdbtest.HgdbTest.main(HgdbTest.java:16)
Exception in thread "main" org.hypergraphdb.HGException: java.lang.NoSuchMethodError: org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sleepycat/je/DatabaseEntry;)V
at org.hypergraphdb.HyperGraph.open(HyperGraph.java:395)
at org.hypergraphdb.HyperGraph.open(HyperGraph.java:213)
at org.hypergraphdb.HyperGraph.<init>(HyperGraph.java:200)
at hgdbtest.HgdbTest.main(HgdbTest.java:16)
Caused by: java.lang.NoSuchMethodError: org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sleepycat/je/DatabaseEntry;)V
at org.hypergraphdb.storage.bje.BJEStorageImplementation.store(BJEStorageImplementation.java:234)
at org.hypergraphdb.HGStore.store(HGStore.java:119)
at org.hypergraphdb.HGTypeSystem.addPrimitiveTypeToStore(HGTypeSystem.java:185)
at org.hypergraphdb.HGTypeSystem.bootstrap(HGTypeSystem.java:234)
at org.hypergraphdb.HyperGraph.open(HyperGraph.java:355)
... 3 more
Java Result: 1
BUILD SUCCESSFUL (total time: 4 seconds)
I guess it's caused by the native API of the BerkeleyDB.
According to the tutorial, in project options I supply the -Djava.library.path=$HGDB_ROOT/lib/native/$PLATFORM argument on Run card as a VM Option. Instead of the system variables I use full-path to the libraries.
My OS in Windows7. I'm not sure about using slashes or backslashes or double-backslashes as a path-separator.?
So a simply question is: how have I to set up the IDE for using the HypergraphDB?
Thank you for advices!
Judging from the stack trace, you are using the latest version of HyperGraphDB. In that version, the native API is not used. Rather, it's Java only libraries. You have to include the BerkeleyDB Java Edition 5.0.34 jar in your runtime classpath. You can get it either from the Oracle http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html or from the HyperGraphDB Maven repository: http://hypergraphdb.org/maven/org/hypergraphdb/hgbdbje/1.2/hgbdbje-1.2.jar
I had the same issue. I fixed it (by accident) by fixing the order of the libraries on which you're HyperGraphDB application relies on. The library je-[version].jar has to be ABOVE (and hence to be referenced before) db-[version].jar

SunTlsRsaPremasterSecret KeyGenerator not available

I encountered an error when my application tries to load a RSA Algorithm provider class from JAVA. The exception stack is as follow:
javax.jms.JMSException: RSA premaster secret error
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1255)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1350)
at org.apache.activemq.ActiveMQConnection.setClientID(ActiveMQConnection.java:388)
at com.trendmicro.tmsm.TMSMAgent.open(TMSMAgent.java:63)
Caused by: javax.net.ssl.SSLKeyException: RSA premaster secret error
at com.sun.net.ssl.internal.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:97)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:634)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at org.apache.activemq.transport.tcp.TcpBufferedOutputStream.flush(TcpBufferedOutputStream.java:115)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:167)
at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:237)
at org.apache.activemq.transport.WireFormatNegotiator.sendWireFormat(WireFormatNegotiator.java:168)
at org.apache.activemq.transport.WireFormatNegotiator.sendWireFormat(WireFormatNegotiator.java:84)
at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:74)
at org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:715)
at org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:115)
at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.security.NoSuchAlgorithmException: SunTlsRsaPremasterSecret KeyGenerator not available
at javax.crypto.KeyGenerator.<init>(DashoA13*..)
at javax.crypto.KeyGenerator.getInstance(DashoA13*..)
at com.sun.net.ssl.internal.ssl.JsseJce.getKeyGenerator(JsseJce.java:223)
at com.sun.net.ssl.internal.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:89)
... 22 more
I've googled the error message and most of posts says it's because JVM cannot find sunjce_provider.jar. However, I can find the file in /Library/Java/Home/lib/ext folder.
The platform is Mac OS X 10.6 and Java version is 1.6.0_17.
My questions are:
Why JVM does not search /Library/Java/Home/lib/ext for jar files?
Can we change CLASSPATH or java.ext.dirs property by modify any config file?
Any suggestion to solve this problem?
Thanks in advance.
I've had the same problem after upgrading to new Java version on Mac.
My (maven) project ran OK from command line but got the "SunTlsRsaPremasterSecret" error in Eclipse.
The solution was to remove Installed JREs in Eclipse configuration and add them again (using the "Search..." button).
had a similar issue. Adding the classpath to the ext directory fixed it for me. This fix worked for me on windows 7 with java 1.6
java -Djava.ext.dirs=lib -classpath "%java_home%\lib\ext\*" myapp.jar
I think we find the root cause so here is an answer of my own question.
the Java system property "java.ext.dirs" in Mac OS X 10.5 is:
/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext. The sunjce_provider.jar should be in /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext but also be found in /Library/Java/Extensions/ in the problem mac.
the sunjce_provider.jar in /Library/Java/Extensions/ belongs to Java Cryptography Extension(JCE) 1.2.2, which has been installed in the mac. JCE 1.2.2 is an optional package of J2SE 1.3.1 and may not includes enough libraries for J2SE 1.4 and later.
the Java applcation works normally after all JCE 1.2.2 related jar files have been removed from /Library/Java/Extensions/.
It happened to me while launching the tomcat server from eclipse. I solved it by changing the configuration in Windows -> Preferences -> Java -> Installed JREs -> Edit. I had to update all the JRE system libraries with the corresponding jars from the folders in:
%JAVA_HOME%/jre/lib/ext
%JAVA_HOME%/jre/lib/
It seems that after the last update I have changed the JRE_Home but forgot those libraries.
I also had this issue, noticed that the problem was in my Eclipse configuration.
Window > Preferences > Java > Installed JREs > jdk8_64bit > Edit...
The path of my sunjce_provider.jar was pointing to jdk8_64bit\lib\ext\sunjce.provider.jar. It should point to the JRE's equivalent in jdk8_64bit\jre\lib\ext\sunjce.provider.jar.
Had to spend almost a day on this while trying to use JavaMail in Eclipse Luna.
Tried all approaches suggested in various forums, but no luck.
Digged into the complete flow and found the exception arising due to Class is on BootClassPath
from KeyAgreement.getInstance()->JceSecurity.canUseProvider()->JceSecurity.getVerificationResult()->JarVerifier.verify()
void verify()
throws JarException, IOException
{
if (jarURL == null) {
throw new JarException("Class is on the bootclasspath");
}.......
I removed sunjce_provider jar from \ext\ folder and can send mail now.
This might not be right but atleast a quick workaround.
Refer Eclipse bug.
I know, I am joining late here. But for me, this error came suddenly as soon as I changed the Preference -> Java -> Installed JREs -> Execution Environments as JavaSE-1.8 to jdk1.8 path. But it should be jre1.8 path.
I don't know why is it happening now. But It sorted the problem.
Probable solution: Check if jdk path is set till C:\Program Files\Java\jdk1.8.0_171 but not including bin
In my case, I got above same issue, after reading above solutions, I changed JRE Definition and Restore Default. It is working fine now.

Categories

Resources