Ant mail task worked in Java 11, failed in Java 17 with "JSSE not in classpath" error? - ssl

I'm using Apache Ant 1.10.12, and I have a problem with this mail task:
<mail mailhost="${email.host}" mailport="${email.port}" ssl="${email.ssl}" user="${email.smtp.user}" password="${email.smtp.password}"
replyto="${email.from}" from="${email.from}" tolist="${email.to}" cclist="${email.cc}"
subject="The ${build.version} build has completed">
This task works when I am using Java 11, but fails when I switch to Java 17. The error I get is this:
Failed to send email: could not instantiate ssl security provider, check that you have JSSE in your classpath
Java 11 debug output: https://controlc.com/7f283040
Java 17 debug output: https://controlc.com/6476775d

Related

In STS, server up error : org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class

In STS after converting from Java 11 to Java 17. While making the server up, getting the following error.
{"#timestamp":"2022-12-21T11:09:36.129-08:00","#version":"1","message":"Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.package.name]","logger_name":"org.springframework.context.annotation.AnnotationConfigApplicationContext","thread_name":"main","level":"WARN"}
{"#timestamp":"2022-12-21T11:09:36.147-08:00","#version":"1","message":"\r\n\r\nError starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.","logger_name":"org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLogger","thread_name":"main","level":"INFO"}
{"#timestamp":"2022-12-21T11:09:36.193-08:00","#version":"1","message":"Application run failed","logger_name":"org.springframework.boot.SpringApplication","thread_name":"main","level":"ERROR","stack_trace":"org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class
Build is successfull. But unable to up the server. Is any config or dependency are missing ? Converting from java 11 to Java 17 in STS.

HttpHostConnectException let Apache Stanbol Integration Tests fail

I tried to install the Stanbol version from branch "release-0.12" from github.
On my system I have:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
When I start the command:
mvn install
I get the following error for the Apache Stanbol Integration Tests => error-log
The first lines of the error are:
06.08.2014 15:47:02.025 *INFO * [main] Setting org.osgi.service.http.port=8765
06.08.2014 15:47:02.026 *INFO * [main] Starting launcher ...
06.08.2014 15:47:02.030 *INFO * [main] HTTP server port: 8765
15:47:03,614 INFO StanbolTestBase:163 - Got HttpHostConnectException at
http://localhost:8765/ - will retry
When I skiped the test I also got no response from the server...
I already tried it with java-version 1.6, but there I got the error:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed
with message:
Java 7 or higher is required to compile this module
Has someone an idea what I made wrong (does it need some further software requirements)? Or how can I get the server running correctly?
The integration test starts a Stanbol Server (actually the full launcher) in its own JVM. The tests waits for up to 180 seconds for this server to start. During that time the test resends some test requests to check if the server is up and running.
Based on the provided log this period starts at about "15:47" so the test should wait until about "15:50" before it gives up.
Because of the line
^C15:48:42,236 INFO StanbolTestBase:146 - Got 404 at http://localhost:8765/entityhub - will retry
in the log my guess is that the build process was manually canceled with ^C before the server was fully started.
The server side logs of the test run are available at target/launchdir/stanbol/logs/error.log. If the integration tests do fail one will usually find the reason in this log file.

IntelliJ debugger doesn't recognize Java version upgrade

I upgraded to Java 8 from Java 6.
As per these instructions, in /Applications/IntelliJ IDEA 13 CE.app/Contents/Info.plist I changed
<key>JVMVersion</key>
<string>1.6*</string>
to
<key>JVMVersion</key>
<string>1.8*</string>
My environment variable JAVA_HOME is set to:
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
However, when I run the debugger in IntelliJ, it still wants to use Java 6:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java ...
Connected to the target VM, address: '127.0.0.1:60490', transport: 'socket'
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/my/MainClass : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
What other settings do I need to change in order for IntelliJ to use the Java 8 JRE?
You changed the IDE's setting. Project setting can be changed here: File->ProjectStructure->Project SDK

Getting Error while starting glassfish server

when I am starting glass fish server through command prompt I am getting an
error. I am using jdk 1.5 and jdk1.6 also. Due to java version am I getting that error or any other reason.
I am using two tomcat server also that port no is 8080 and 8081.
For glass fish-domain purpose I am using 4545 port number.
Error starting domain mydomain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
FATAL ERROR in native method: processing of -javaagent failed
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 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:133)
Exception in thread "main"
This is the important bit.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
It means that the class loader does not understand the version number of one of the ".class" files that it is trying to load.
The most likely explanation is that you are trying to load classes that have been compiled on a Java 7 development platform on an earlier (e.g. Java 5 or Java 6) JRE / JVM installation. You either need to upgrade your execution platform to Java 7 (best option), or downgrade your development platform to Java 5 or Java 6 (or whatever you are using).
Note that both Java 5 and Java 6 have reached "end of life", and there will not be any more patch releases available ... unless you take out an Oracle Java support contract.

Sonar for Eclipse: unable to run local analysis

I have successfully installed sonar plug-in for eclipse, however when I try to 'Run Local Analysis' for sonar, eclipse gives an error saying:
An internal error occurred during: "Sonar Analysis".
Unable to create markers
and console for Sonar has following info printed:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash: show splash screen with specified image
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Plz help with how to proceed for Local analysis in eclipse.
[Update: Version Details]
Eclipse: Indigo (3.7.1)
Sonar Plug-in: 3.0.0
Sonar(Server): 3.4.1
Sonar Web Service Client: 3.4.0
Java: 1.4.1 ('Java EE IDE' property in Eclipse Features)
Local Java Installation: 1.6