aws serverless spring boot set up is failing - spring-boot

here is my setup below,
#SpringBootApplication
#ComponentScan(basePackages = "com.amazonaws.serverless.sample.springboot.controller")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
public class LambdaHandler implements RequestStreamHandler {
private SpringBootLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;
private static ObjectMapper mapper = new ObjectMapper();
private Logger log = LoggerFactory.getLogger(LambdaHandler.class);
#Override
public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
throws IOException {
if (handler == null) {
try {
handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class);
} catch (ContainerInitializationException e) {
e.printStackTrace();
outputStream.close();
return;
}
}
AwsProxyRequest request = mapper.readValue(inputStream, AwsProxyRequest.class);
AwsProxyResponse resp = handler.proxy(request, context);
mapper.writeValue(outputStream, resp);
// just in case it wasn't closed by the mapper
outputStream.close();
}
}
each time when when I am trying invoke my lambda from local console using command - "serverless invoke local -f hello" I am getting below exception,
j
ava.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.serverless.InvokeBridge.invoke(InvokeBridge.java:102)
at com.serverless.InvokeBridge.<init>(InvokeBridge.java:40)
at com.serverless.InvokeBridge.main(InvokeBridge.java:153)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(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 java.lang.ClassLoader.loadClass(Unknown Source)
at com.amazonaws.serverless.proxy.spring.SpringBootLambdaContainerHandler.initialize(SpringBootLambdaContainerHandler.java:167)
at com.amazonaws.serverless.proxy.spring.SpringBootLambdaContainerHandler.getAwsProxyHandler(SpringBootLambdaContainerHandler.java:77)
at com.techprimers.serverless.services.AWSLambdaHandler.handleRequest(AWSLambdaHandler.java:172)
... 7 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContainerInitializer
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)
... 23 more
at line - "handler = SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class);"
Please HELP me resolve this, I tried various ways of boot setup with aws lambda but failed every time. Please help me fix this or help me out in setting up in any other way. Thanks.

In your logs we can see :
NoClassDefFoundError: javax/servlet/ServletContainerInitializer
ClassNotFoundException: javax.servlet.ServletContainerInitializer
Could you please check if libs are loaded , there must be something missing and not loaded up correctly
Also, something like this has been done
<dependency>
<groupId>com.amazonaws.serverless</groupId>
<artifactId>aws-serverless-java-container-spring</artifactId>
<version>1.3.2</version>
</dependency>
Also double check steps in :
https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot

I had the same issue. I was using version 0.2 of aws-serverless-java-container-spring and had to switch to version 1.3.2 as the former version didn't have SpringBootLambdaContainerHandler class.

Related

JPackage Unable to Launch JVM - Circular loading of URL stream handler providers detected

After running jpackage on my JavaFX application using following command:
.\jpackage.exe
--input C:\Users\My\Documents\NetBeansProjects\MyFX\target\
--dest C:\Users\My\Documents\NetBeansProjects\MyFX\
--name "MyFX"
--main-jar C:\Users\My\Documents\NetBeansProjects\MyFX\target\MyFX-2.0.jar
--main-class my.myfx.App
--module-path 'C:\Program Files\Java\jmods\\'
--add-modules javafx.controls,javafx.fxml,java.sql --win-console
I'm getting error on launching the program:
Unable to launch JVM
Error on console:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.Error: Circular loading of URL stream handler providers detected
at java.base/java.net.URL.lookupViaProviders(Unknown Source)
at java.base/java.net.URL.getURLStreamHandler(Unknown Source)
at java.base/java.net.URL.<init>(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.tryResolveFile(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.tryResolve(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.parseClassPath(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.getClassPath(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath.getLoader(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$1.next(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$1.hasMoreElements(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasNext(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader$1.hasMoreElements(Unknown Source)
at java.base/java.lang.CompoundEnumeration.next(Unknown Source)
at java.base/java.lang.CompoundEnumeration.hasMoreElements(Unknown Source)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(Unknown Source)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(Unknown Source)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(Unknown Source)
at java.base/java.util.ServiceLoader$2.hasNext(Unknown Source)
at java.base/java.util.ServiceLoader$3.hasNext(Unknown Source)
at java.base/java.net.URL$1.getNext(Unknown Source)
at java.base/java.net.URL$1.hasNext(Unknown Source)
at java.base/java.net.URL$2.run(Unknown Source)
at java.base/java.net.URL$2.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/java.net.URL.lookupViaProviders(Unknown Source)
at java.base/java.net.URL.getURLStreamHandler(Unknown Source)
at java.base/java.net.URL.<init>(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.tryResolveFile(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.tryResolve(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.parseClassPath(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath$JarLoader.getClassPath(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath.getLoader(Unknown Source)
at java.base/jdk.internal.loader.URLClassPath.getResource(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at java.base/sun.launcher.LauncherHelper.loadMainClass(Unknown Source)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Failed to launch JVM
Are there any more libraries to add? any more JMods? What does "Circular loading of URL streams" have to do with this?
EDIT: MyFX.App
package my.myfx;
public static javafx.scene.image.Image loadingImg,tickImg,appIconImg;
public static javafx.scene.image.ImageView loading,tick,appIcon;
private static javafx.scene.Scene scene;
#Override
public void start(javafx.stage.Stage stage) throws java.io.IOException {
try{
appIcon=new ImageView();
appIconImg=new Image(getClass().getResource("icons/icon.png").toURI().toString());
appIcon.setImage(appIconImg);
loading=new ImageView();
loadingImg=new Image(getClass().getResource("icons/loading.gif").toURI().toString());
loading.setImage(loadingImg);
javafx.concurrent.Task<Exception>work=new javafx.concurrent.Task<>(){
#Override
protected Exception call(){
try{
Thread.sleep(500); //Simulate IO operation
}catch(Exception ex){
return ex;
}
return null;
}
};
new Thread(work).start();
scene = new javafx.scene.Scene(new javafx.fxml.FXMLLoader(getClass().getResource("fxml/main.fxml")).load(), 640, 480);
stage.setScene(scene);
stage.setMaximized(true);
stage.setTitle("MyFX");
stage.getIcons().add(appIconImg);
stage.show();
work.setOnSucceeded(e->{
try{
if(work.get()==null){
System.out.println("Folders initialized");
tick=new ImageView();
tickImg=new Image(getClass().getResource("icons/tick.png").toURI().toString(),true);
tick.setImage(tickImg);
}else{
System.out.println(work.get());
}
}catch(Exception ex){
System.out.println(ex);
}
});
stage.setOnCloseRequest((javafx.stage.WindowEvent t) -> {
Platform.exit();
System.exit(0);
});
}catch(Exception ex){
System.out.println(ex);
}
}
public static void main(String[] args) {
launch();
}
static void setRoot(){
try{
scene.setRoot(new javafx.fxml.FXMLLoader(App.class.getResource("fxml/main.fxml")).load());
}catch(Exception ex){
System.out.println(ex);
}
}
This also contains some functions but they're mostly getters for other classes

How to add Richfx in a layout

I have been trying to add an InlineStyleTextArea and a CodeArea in anylayout both in the main method in javafx and in a fxml file. I receive a thread error. Please if possible with examples how can i add these components to a javafx layout? If possible with a tutorial link.
This is a simple code
public class Main extends Application {
#Override
public void start(Stage primaryStage) {
TextField myTextField = new TextField();
InlineCssTextArea TextArea = new InlineCssTextArea();
HBox hbox = new HBox();
hbox.getChildren().add(myTextField);
hbox.getChildren().add(TextArea);
HBox.setHgrow(myTextField, Priority.ALWAYS);
HBox.setHgrow(TextArea, Priority.ALWAYS);
Scene scene = new Scene(hbox);
primaryStage.setScene(scene);
primaryStage.show();}
public static void main(String[] args) {
launch(args);
}
}
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.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.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/reactfx/value/SuspendableVal
at application.Main.start(Main.java:20)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$53/19776028.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/18503843.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/3799573.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/2180324.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/3326003.run(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException: org.reactfx.value.SuspendableVal
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)
... 15 more
Exception running application application.Main
at com.sun.javafx.application.LauncherImpl$$Lambda$50/14845382.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
From the stack trace, it looks like the Java Runtime can't find (at least one class in) the ReactFX library, which is a dependency of RichTextFX. Since it gets as far as looking for that, it must have found InlineCssTextArea, so the RichTextFX library must be installed.
If you are using some kind of dependency management (Gradle or Maven, for example), that tool should manage all the dependencies for you.
If you are managing the dependencies by hand (i.e. downloading jar files and adding them to the classpath), you need to make sure you either download all the dependent jar files as well, or use the "Fat jar file".

Access hive remotely

I am working on Hive. I want to access Hive table via Hive JDBC. The code I'm using is below :
public class HiveJdbcClient {
private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
public static void main(String[] args) throws SQLException {
try {
Class.forName(driverName);
}catch(ClassNotFoundException e){
e.printStackTrace();
System.exit(1);
}
Connection connection = DriverManager.getConnection("jdbc:hive2://aaaa:10000", "" , "");
Statement statement = connection.createStatement();
String tableName = "tmp_ext_h;
/**
* SELECT* QUERY
* */
String sql = "select * from " + tableName;
System.out.println("Running: " + sql);
ResultSet result = statement.executeQuery(sql);
while (result.next()){
System.out.println(String.valueOf(result.getInt(1)) + "\t" + result.getString(2));
}
/**
* REGULAR HIVE QUERY
* */
sql = "select count(1) from " + tableName;
System.out.println("Running: " + sql);
result = statement.executeQuery(sql);
while (result.next()){
System.out.println(result.getString(1));
}
}
}
and my Libraries are :
hive-jdbc.jar"
hive-exec.jar"
hive-metastore.jar"
hive-service.jar"
libthrift-0.9.0.jar"
mysql-connector-java.jar"
While running this, I get the ERROR :
Exception in thread "main" java.lang.NoClassDefFoundError: com/facebook/fb303/FacebookService$Iface
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(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 java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(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 java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(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 org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:106)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at hadoop_HiveConnector.HiveJdbcClient.main(HiveJdbcClient.java:28)
enter code here
Does anybody know what is the problem? I'm new on Hive
Thanks.
According to this http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/HiveJDBCDriver.html
You need the following jars for Hive 0.13:
hive_metastore.jar
hive_service.jar
HiveJDBC3.jar
libfb303-0.9.0.jar
libthrift-0.9.0.jar
log4j-1.2.14.jar
ql.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar
TCLIServiceClient.jar
However it changes by environment and version. In your case at the least you're missing libfb303-*.jar

Jboss error on deployment bean

I'm trying to deploy a bean that uses #Interceptros annotation in Jboss.
According to documentation I've created beanRefContext.xml and here is Bean code
#Stateless
#LocalBean
#Interceptors(SpringBeanAutowiringInterceptor.class)
public class ClienteBean implements ClienteBeanLocal {
public ClienteBean() {
// TODO Auto-generated constructor stub
}
#Autowired
private IClienteDAO cliente;
#Override
public List<ClienteDTO> selectALL() throws Exception {
return cliente.selectALL();
}
}
I am deploying it inside an EAR. When I try to deploy in Jboss 6 I get the following error:
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(Unknown Source) [:1.7.0_09]
at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source) [:1.7.0_09]
at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source) [:1.7.0_09]
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source) [:1.7.0_09]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source) [:1.7.0_09]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source) [:1.7.0_09]
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source) [:1.7.0_09]
at java.lang.Class.getAnnotations(Unknown Source) [:1.7.0_09]
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.readAnnotations(IntrospectionTypeInfoFactoryImpl.java:610) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getAnnotations(IntrospectionTypeInfoFactoryImpl.java:126) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.reflect.plugins.InheritableAnnotationHolder.getDeclaredAnnotations(InheritableAnnotationHolder.java:96) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.reflect.plugins.ClassInfoImpl.getAnnotations(ClassInfoImpl.java:181) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.reflect.plugins.AbstractAnnotatedInfo.getUnderlyingAnnotations(AbstractAnnotatedInfo.java:63) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:76) [:1.0.0.GA]
at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.GA]
at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.GA]
... 53 more
How can I solve it?
Seems JBoss is not seeing SpringBeanAutowiringInterceptor.class. In your EAR file put your spring jars on the lib directory. See if that works.
If you are using maven to assemble your EAR file you can do something like this:
http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-module-location.html

Https Connection rejected by server

I am trying to write a standalone program that will be called by a bat file. I found something like a trust all certificate manager.
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
URL url = new URL("--insert server url here--");
//url.openStream();
// URLConnection urlConnection = url.openConnection();
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
} catch (MalformedURLException mfe) {
mfe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
it works fine in my ide but after I built in and run it via the bat file it keeps giving me this error
javax.net.ssl.SSLException: Server key
at sun.security.ssl.Handshaker.throwSSLException(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source
)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unk
nown Source)
at sss.Sss.main(Sss.java:65)
Caused by: java.security.NoSuchAlgorithmException: NONEwithRSA Signature not ava
ilable
at java.security.Signature.getInstance(Unknown Source)
at sun.security.ssl.JsseJce.getSignature(Unknown Source)
at sun.security.ssl.RSASignature.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.security.Provider$Service.newInstance(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Signature.getInstance(Unknown Source)
at sun.security.ssl.JsseJce.getSignature(Unknown Source)
at sun.security.ssl.RSASignature.getInstance(Unknown Source)
at sun.security.ssl.HandshakeMessage$DH_ServerKeyExchange.<init>(Unknown
Source)
... 13 more
am I doing something wrong? Should I sign a certificate in order to connect to the server?
Have found the answer for the problem above, will need to include the sunjce_provider.jar into the lib folder of the standalone program.

Resources