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

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>

Related

Spring Boot 3 JSP Issue

I've been having issues with JSP since moving to Java 17 and Spring Boot 3. I know that we need to use jakarta.* instead of javax.*, but is there something I'm missing? I am using Spring Tools 4 and just running a basic web app using JSP. When using the following dependencies
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
</dependency>
The project runs, but I get the following error
The superclass "javax.servlet.http.HttpServlet", determined from the Dynamic Web Module facet version (2.5), was not found on the Java Build Path
I can get rid of it by adding the javax servlet dependency
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
But that goes against using javax.* dependencies with Spring Boot 3.
I have read these articles and tried adding the jakarta.servlet.jsp dependency with no luck.
https://debugah.com/solved-tomcat10-error-jakarta-servlet-servletexception-class-com-kuang-servlet-helloservlet-is-not-a-servlet-22749/
https://howtodoinjava.com/java/exception-handling/solved-the-superclass-javax-servlet-http-httpservlet-was-not-found-on-the-java-build-path-in-eclipse/
Solved!
All I had to do was go into Project Properties and under Project Faces, change my Dynamic Web Module from 2.5 to 5.0
The JSTL warning can be suppressed under Properties->Web->JSP Files->Validation->Custom actions->Other problems with TagExtraInfo class (Just change from 'Warning' to 'Ignore')

Supported libraries for Quarkus AWS S3

Good evening,
I was redirected to ask my question here instead of Quarkus github.
I would like to check which AWS S3 library is supported by Quarkus?
Searching through the maven repository:
https://mvnrepository.com/search?q=quarkus+s3
The closest I could find was the Camel Quarkus :: AWS S3 :: Runtime but I believe that's not the right one. Thank you!
There is a PR, under review at the moment, that introduces AWS S3 extension both JVM & Native.
AWS clients are fully Quarkified, meaning configured via application.properties and enabled for dependency injection. In a longer term it will enable other AWS clients too.
I've used the S3 client from Amazon SDK in JVM mode without any problem with this dependency:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>${amazon.sdk.version}</version>
</dependency>
But it won't work in native mode though.
software.amazon.awssdk.services.s3.S3AsyncClient works out of the box for Quarkus/JVM application.
Add this to your Dependency Management section of your pom.xml file:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.10.70</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Then add the S3 dependencies:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
</dependency>
However in order to work in Native mode you have to register for reflection some filters.
I've created a simple AWS S3 extension about it.
Just add this dependency to your pom.xml:
<dependency>
<groupId>com.github.tpenakov.otaibe-commons-quarkus</groupId>
<artifactId>otaibe-commons-quarkus-aws-extension</artifactId>
<version>00.00.07.01</version>
</dependency>
Then add the Jitpack repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>

Connecting ONOS web application with MariaDB . ClassNotFoundException

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.

No suitable driver found for jdbc (only in jar file)

I'm using netbeans to create a simple java maven application with a very simple JavaDB database connectivity. I've configured the dependencies in maven pom.xml file as follows, and my application works correctly when I run it from the IDE.
pom.xml
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.12.1.1</version>
</dependency>
Yet when I build the project with dependencies and try to run the final jar, I get the following error.
java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/TestDB
I've even tried copying the derby.jar to the application jar file location. But still the above error appears. I'm not sure what I'm doing wrong.

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