Connecting ONOS web application with MariaDB . ClassNotFoundException - jdbc

I am trying to make a custom web application on top of ONOS and I am having a difficulty to connect my application to the MariaDB server located on my localhost. What I've done is applying MariaDB dependencies to the POM.xml file of my application.I am using IntelliJ Idea Community version and I have less knowledge in developing Java web application.
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
Your help is much appreciated.

Related

Compatibility (as Spring boot Maven dependencies) between Elasticsearch 7.17, spring data elasticsearch and elasticsearch-rest-high-level-client

I have an Spring Boot + Elasticsearch application that had the now deprecated High Level Rest Client. I am trying to migrate the existing queries/methods to the new Java API Client but want to keep the HLRC for a bit (in case I break anything).
I seem to be running into a dependency problem that I'm not getting. I am currently getting the error java.lang.NoClassDefFoundError: org/elasticsearch/xcontent/ToXContentObject which I assume is due to compatibility issues. These are my current (relevent) dependencies:
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.17.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>4.3.4</version>
</dependency>
The Elasticsearch is on 7.17 . As for the maven dependencies... I don't really know what versions to use so that it can run the old HLRC still while I test out newer code? (So I set the versions to the newest possible ones)
Edit infos:
current spring boot version is 2.2.8
before manually setting the version, org.elasticsearch.client was on 6.8.x
is my approach dumb and I should just scrap all the HLRC in favor of implementing/testing Java API Client?
Any pointers/fixes appreciated!
If I remember correctly it was in version 7.15 or 7.16 that Elasticsearch had a breaking change moving the xcontent classes to a different package. You cannot use Spring Data Elasticsearch 4.3.x with Elasticsearch 7.17

Spring Boot app starts on Windows 10 but not on OS X (HS)

I have a Spring Boot application that connects to a postgresql-database. I am working on it on windows 10 (work) and macos (home). The code is shared via github. On win10 the app starts without any problems but when I update the code on macos and restart the app I often get the error Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class
The one way I can remedy the issue is to include the H2 in-memory-db in pom.xml, start the app, remove it again and restart the Spring Boot app. But it doesn't always work.
My application.properties file:
spring.datasource.url=jdbc:postgresql://localhost:5432/john
spring.datasource.username=doe
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
I am using Java JDK 10 in both environments with the Spring Tools suite in eclipse.
I have cleaned the project, updated maven right-clicking on the project -> Maven -> Update Project but without luck.

Web Application using JavaCV and deployed on SAP HANA Cloud Platform error

I'm currently working on a face recognition web application using JavaCV. I send snapshots of a live webcam stream on a client's browser over websockets and the face recognition system does all the rest on the server side. However, I receive the following error when deploying my application on HCP.
no jniopencv_core in java.library.path
I have added all the jar files related to javacv/javacpp in my project lib folder and
this is my pom.xml
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.0.0-1.1</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.1</version>
</dependency>
Any ideas? Thanks in advance.
For some reason, Maven isn't picking up the platform dependencies properly. Add something like the following to fix that error:
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.0.0-1.1</version>
<classifier>linux-x86_64</version>
</dependency>

How can i find which release of OSGI is supported by CQ5.5 .?

How can we find which release of OSGi is supported by CQ5.5 version, Is there any log file where i can find out the OSGi release in the CQ5 product?
CQ5.5 uses Apache Felix which is
... a community effort to implement the OSGi R4 Service Platform and other interesting OSGi-related technologies under the Apache license
The references to OSGI in the javadocs at dev.day.com point to R4 v4.2 specifically. This matches the compliance tests for the felix project
If you're building against the OSGI APIs in your application, then you'll need to add the following to your project pom.xml (assuming you're using maven):
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>4.2.0</version>
<scope>provided</scope>
</dependency>
in CQ 5.6 we don't use the org.ogsi dependencies anymore. instead we have (amongst others)
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.osgi</artifactId>
<version>2.2.0</version>
<scope>provided</scope>
</dependency
also you have (again in 5.6, not sure about 5.5) a depfinder
http://localhost:4502/system/console/depfinder
here you can see which package/version a certain class you need belongs to.
The implementation of OSGi used by CQ is Apache Felix, which implements OSGi Service Platform Release 4.
You can find out more detail about CQ's Technical Foundation at http://dev.day.com/docs/en/cq/5-5/exploring/concepts.html

Looking for Tomcat6 customisation on Cloudbees to add 3rd party jars

I have been searching in the documentation for Clickstack and on the Cloudbees Community Github to create a custom container. There is a standard template for apps and one project for Tomcat7 but none forking the Cloudbees default Tomcat6.
I would like to add some dependencies into the Tomcat6 container instead of bundling them in the application WAR.
For example, an application could have AWS sdk as provided in pom.xml
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.4.5</version>
<scope>provided</scope>
</dependency>
this seems simple. However (in my little understanding of things) do I need to develop the container from scratch?
The tomcat6 one has a long history - and is called "staxcat"
https://github.com/CloudBees-community/staxcat-clickstack
You can certainly fork and base it off that. The approach with tomcat7 was to have a less customised stack - closer to vanilla tomcat7.
My recommendation is to use tomcat7 as a starting point - if you can at all (tomcat6 is becoming a tad old now!)- but if you really need tomcat6, staxcat might be the repo to look at!

Resources