Java CDI PersistenceContext with Tomcat 8 - cdi

I am using Java CDI with Tomcat 8, with this how to configure database configuration?

Tomcat 8 is a servlet container and as far as I know, it does not contain any CDI implementation. Are you shipping it with your application?
In order to connect to a relational database, the obvious choice with Java EE is to use JPA, available in Apache TomEE.
Other way is to instantiate Hibernate, myBatis, JOOQ, plain JDBC or anything you would like on your own using CDI producers.

Related

Is there any equivalent to use something like MappingManager on datastax java client 4.x

In datastax 3.x there used to be mappingManager. We used it to get different mappers using com.datastax.driver.mapping.MappingManager.
Can someone help me, What can I use in datastax 4.x.

Spring Boot Starters for Azure java 11

I was following this document from Microsoft on spring boot on Azure, which state that I must use java 8 and not java 11 in order to use Spring Boot Starters for Azure, from the doc:
"Spring Initializr uses Java 11 as the default version. To use the Spring Boot Starters described in this topic, you must select Java 8 instead",
doc: https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/spring-boot-starters-for-azure
in Azure SDK docs for java/spring boot it says:
Java Development Kit (JDK) with version 8 or above
The question is can I use spring boot with java 11 on Azure with or without spring boot starters?
it seems to work as Azure supports java 11.
thanks,
Liav
Can I use spring boot with java 11 on Azure with or without spring
boot starters?
Yes. Azure supports spring boot with java 11.
The article walks you through deploying a Spring Boot app to Azure, see here.

Cassandra: need to migrate cassandra to log4j

We are using embedded cassandra in our groovy test cases, we are migrating from logback to log4j2. Whenever i run the groovy test which uses cassandra it gives an exception of NoClassDefFoundError for ch/qos/logback /classic /Logger. I have excluded logback dependency from all existing cassandra dependency still its looking for logback. How should i make cassandra log using log4j2
Cassandra isn't setup or designed to run embedded so while there might be some hacks that can get you by it will be something difficult to keep working across versions.
I would recommend using ccm for your tests to run it out of jvm and it will also give you more control for interesting configurations. The java driver has a useful bridge for java applications in their tests here: CCMBridge.java
Longterm you might be able to use something CASSANDRA-14821 as there will be native connections exposed and give you a lot more control over results of queries and such.

Using Spring kafka 1.1.2 with Spring framework 3.1.1

I am fairly new to spring integration and spring kafka.
I am having to write a producer for kakfa and am planning to using spring kafka 1.1.2 (as i have used it earlier) and the parent project is using spring framework 3.1.1
I am wanting to understand how do i write the xml configuration for spring kafka 1.1.2 as i could not find anything in the documentation.
Also, I read a little about spring integration kafka module and am not too sure if that's the one i should use.
You cannot use Spring Kafka with Spring 3.x. It is tested with 4.3.x and will probably work with earlier 4.x releases.
Spring Integration Kafka is an extension to Spring Integration which (since 2.0) sits on top of spring-kafka.

Does Cassandra works with IBM JVM

Can I install and start Cassandra into a x-linux OS with a IBM SDK for Java?
Will that work? Any specific version? 2.1, 2.0 that will work ?
Thanks in advance.
You are right, it should work. The only issue is in the Cassandra-env.sh, you need to comment out some checking.
Yes it should. According to the Apache Cassandra project site:
Cassandra requires the most stable version of Java 7 or 8 you can deploy, preferably the Oracle/Sun JVM. Cassandra also runs on OpenJDK and the IBM JVM.
As far as I can tell, it doesn't indicate that only specific versions of Cassandra work with the IBM JVM. That being said, the documentation on the DataStax site specically mentions the Oracle JVM in the installation steps. It is the recommeded JVM to use.
I can't remember for sure, but I have heard of people running into issues that were traced back to the OpenJDK. I don't recall anything specific to the IBM JVM. So it might work, but it isn't supported and you might leave yourself open to some unforeseen errors.

Resources