Failure to Remove H2 Dependency with Apache ignite 2.14.0 - java

With the Apache Ignite 2.13.0 release. They introduced a new beta sql engine to replace the existing h2 sql engine. Unfortunately it still had a dependency on the h2 indexing module. With the 2.14 release it supposedly removed this dependency. Now I am trying to remove the h2 package completely (due to critical code vulnerabilities in the h2 package). Does anyone know how to remove h2 completely from a java built ignite project?
Documentation:
https://ignite.apache.org/docs/latest/SQL/sql-calcite
Here is how I am setting my ignite configuration explicitely avoiding the h2 engine
igniteConfiguration.setSqlConfiguration(
new SqlConfiguration().setQueryEnginesConfiguration(
new CalciteQueryEngineConfiguration().setDefault(true)
)
);
EDIT:
To resolve our issue we had to remove the dependencies imports for org.apache.ignite:ignite-slf4j:2.14.0 and org.apache.ignite:ignite-spring:2.14.0

In case you configured only one query engine, which is CalciteQueryEngineConfiguration, then the ignite-indexing dependency can be removed from your project, as a result, you will no longer have the h2 in the list of dependencies.
Here is a dependency section example:
<dependencies>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${ignite.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-calcite</artifactId>
<version>${ignite.version}</version>
</dependency>
</dependencies>
You can execute mvn dependency:tree to check the actual list of dependencies.
Also, I should mention that the Calcite-based query engine is currently in beta status.

Related

Upgrading spring-boot without upgrading mongodb driver in maven

Context: in a project composed of 5 different applications and a 20 some packages, i try to update spring-boot (to 2.7.4) and only spring-boot, the project uses an internal enterprise artifactory, if that may have some impact. when i indicated that i need 2.7.4 some packages begun to use mongo-driver 4.6.2. Before it was 3.11.0. I went a head and updated it as well, by indicating in those pom.xml (where it was explicitly said 3.11.0 to use 4.6.2 instead). But that caused many unwanted errors (as some syntaxes have changed between those versions) So i went back to 3.11.0 and i explicitly indicated in all pom.xml that i want to use 3.11.0
The issue is that spring-boot now calls things in my mongodb-driver that are not there yet.
So the question is: can i have spring-boot 2.7.4. with mongodb-driver 3.11.0 (and i am just missing how to tell it to use it correctly) OR that those versions are the strongly coupled with 4.6.2 so i have no choice but update that as well?
Also i did tried to find (for 2 days now), and i am sure it should exist for something so widely used as spring, but not found an explicit list that says "to upgrade from X->Y version of dependancy Z, here is the list of syntax changes that need to be made.", does it and how to find that?
Sorry for no concrete pom.xml exemples i am not on my work PC now.
You can use the <exclusions> tag for this:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<exclusions>
<exclusion>
<!-- dependency you want to exclude (with version) -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- The version you want as a dependency -->
</dependency>

Apache Derby 10.15.* - java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver

While trying to use Apache Derby DB (aka JavaDB, being once part of JDK) as an embedded in-memory DB for tests, I've encountered ClassNotFoundException thrown by HikariCP not being able to instantiate org.apache.derby.jdbc.EmbeddedDriver.
The project set up via Maven.
Derby dependency is:
<dependency>
<artifactId>derby</artifactId>
<groupId>org.apache.derby</groupId>
<version>10.15.2.0</version>
<scope>test</scope>
</dependency>
HikariCP configuration is:
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.apache.derby.jdbc.EmbeddedDriver");
config.setJdbcUrl("jdbc:derby:memory:TestsDB;create=true");
return new HikariDataSource(config);
There are few threads that mention ClientDriver but I do need the EmbeddedDriver for in-memory JDBC access.
Any ideas?
Apparently things changed from Derby version 10.14.* towards version 10.15.*.
The latter (which I'm using) indeed has no such a class in its JAR.
After some search in the sources I've found that org.apache.derby.jdbc.EmbeddedDriver has been moved to the tools JAR, so make sure to add the following dependency to your pom.xml too:
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.15.2.0</version>
<scope>test</scope>
</dependency>
Note: of course, adjust the version of this artifact to be the same as the main one, whatever it is in your case.
To Apache Derby guys: if this change is intent-full, I suggest to change the main Derby artifact description, which still misleadingly states "Contains the core Apache Derby database engine, which also includes the embedded JDBC driver" (emphasis is mine [YG]).

Missing artifact org.apache.flink:flink-table:jar:1.10.1

I am trying to add Flink Table dependency in my POM.xml file and the following is the dependency.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table</artifactId>
<version>1.10.1</version>
</dependency>
This throws the error Missing artifact org.apache.flink:flink-table:jar:1.10.1
My flink version is 1.10.1
I took this dependency from here
And I have also looked at the official documents regarding Table API & SQL setup from here which also did't work.
If you are using IntelliJ you can try File->Invalidate Caches/Restart. Sometimes it happens if downloaded dependencies are corrupted

Elasticsearch method not being found in spring boot

I have been stuck with this issue for a while now and any assistance is appreciated. I am running Spring Boot version 2.2.0 with the ElasticSearch high-level REST Client version 6.4.3 and using version 3.2.0 for the Spring-Data-Elasticsearch version. I am getting the error below. I have tried the following attempts to fix but none do.
Change Spring Boot Version multiple times
Change ES version multiple times
I have cleared my .m2 folder and redownloaded the maven dependencies multiple times.
The issue I am getting below is
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.putMapping(ElasticsearchRestTemplate.java:292)
The following method did not exist:
org.elasticsearch.client.IndicesClient.putMapping(Lorg/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest;Lorg/elasticsearch/client/RequestOptions;)Lorg/elasticsearch/action/support/master/AcknowledgedResponse;
The method's class, org.elasticsearch.client.IndicesClient, is available from the following locations:
jar:file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar!/org/elasticsearch/client/IndicesClient.class
It was loaded from the following location:
file:/Users/user/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.4.3/elasticsearch-rest-high-level-client-6.4.3.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.IndicesClient
My POM is below
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.2.0</version>
</dependency>
Any help is appreciated. I am sure it has to deal with compatibility issues but not sure which. Thanks all!
Update
I was able to get it run sucessfully by changing my elasticsearch version to 6.7.0. But now I am receiving the following error
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=index_not_found_exception, reason=no such index]
My POM looks like this below now also.
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.70</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.70</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>6.70</version>
</dependency>
Previous issue of method that does not exist. was resolved by changing the elasticsearch version to 6.7.0.
To avoid these incompatibility issues its always recommend to use the same version of elasticsearch server and its client.
I faced the exact same issue, I was using elastic search 6.8.18.
and as mentioned changed the version of elastic search by using below in Gradle.
ext['elasticsearch.version'] = '6.8.18'
use this for reference - overriding dependency versions

Neo4j 2.0, java - Failed to start Neo4j with an older data store version

I used to use neo4j-community-1.9.4 with my java maven project. I switched to version 2.0 and made completly new db in 2.0. When I run the same java code, I get error:
Exception in thread "main" org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
at org.neo4j.kernel.impl.storemigration.ConfigMapUpgradeConfiguration.checkConfigurationAllowsAutomaticUpgrade(ConfigMapUpgradeConfiguration.java:39)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.attemptUpgrade(StoreUpgrader.java:64)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.tryToUpgradeStores(StoreFactory.java:104)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.newNeoStore(StoreFactory.java:86)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.<init>(NeoStoreXaDataSource.java:232)
at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:423)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:226)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:79)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:70)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:205)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:56)
at tools.Import.main(Import.java:32)
Any idea? Thank you.
Neo4j 2.0 requires an explicit store upgrade, because older versions will no longer be able to run on the upgraded store. The exception mentions this:
Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
Simply add allow_store_upgrade=true to your neo4j.properties file, and start the database again. Then it should do the upgrade. You can read more about this here:
http://docs.neo4j.org/chunked/stable/deployment-upgrading.html#explicit-upgrade
Solved, I replaced dependency from spring:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
By this:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>2.0.0</version>
</dependency>
For community edition on windows,
click on Options, Database Configuration, Edit
look for allow_store_upgrade

Categories

Resources