Hazelcast new compact-serialization is not working with Hazelcast Jet Pipeline - hazelcast

I have tested Compact serialization is working well with Hazelcast Version 5.0.2 but when I try to use it with Jet Pipeline job then getting below error of serialization.
Exception in thread "main" java.util.concurrent.CompletionException: com.hazelcast.jet.JetException: Exception in ProcessorTasklet{tb-batch-compact/mapSink(mymap1)#0}: com.hazelcast.nio.serialization.HazelcastSerializationException: Failed to serialize 'MyClass'
at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:375)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
at com.hazelcast.jet.Job.join(Job.java:78)
at HzCompactBatch.main(HzCompactBatch.java:57)

I have tested my application with Hazelcast 5.1 BETA version with updating pom.xml file to use Hazelcast 5.1 beta dependency and seems to be working my sample application with compact serialization.
I am posting this answer as it may be helpful to someone else.

Related

What is LongAdder related to cassandra+spark connector?

When i load data into cassandra with using databricks, its getting the issue with
Caused by: java.lang.NoClassDefFoundError: com/twitter/jsr166e/LongAdder
Its simple saveToCassandra to table.
I looked this twitter jsr166e jar in maven , its very old, added in 2013,
I don't know why this jar is not available in Spark+cassandra_coonector
That error indicates you are missing dependencies and / or the Spark Cassandra connector is not on the runtime classpath of the Spark application. Not sure how you installed the connector but you should have used the packages method to ensure that dependencies are met and the Connector is correctly configured.
Read more HERE
Hope that helps,
Pat

Spring Integration DSL deprecated class usage

I use spring integration and java-dsl dependencies with this versions.
spring-integration-jdbc- 5.0.0M6
spring-integration-ws- 5.0.0M6
spring-integration-http- 5.0.0M6
spring-integration-jmx- 5.0.0M6
spring-integration-core- 5.0.0M6
spring-integration-java-dsl-
1.2.2RELEASE
I must use 5.0.0M6 version because of new JdbcMetadataStore.
Last week, I used spring integration 4.3.11RELEASE and java-dsl-1.2.2RELEASE and my application worked.
After the upgrade process, this runtime exception is thrown:
Caused by: java.lang.NoClassDefFoundError: org/springframework/integration/expression/IntegrationEvaluationContextAware
at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.registerComponent(IntegrationFlowBeanPostProcessor.java:280) ~[spring-integration-java-dsl-1.2.2.RELEASE.jar:na]
at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.processStandardIntegrationFlow(IntegrationFlowBeanPostProcessor.java:242) ~[spring-integration-java-dsl-1.2.2.RELEASE.jar:na]
at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.processIntegrationFlowImpl(IntegrationFlowBeanPostProcessor.java:254) ~[spring-integration-java-dsl-1.2.2.RELEASE.jar:na]
at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.postProcessBeforeInitialization(IntegrationFlowBeanPostProcessor.java:103) ~[spring-integration-java-dsl-1.2.2.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1707) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.0.0.RC3.jar:5.0.0.RC3]
... 15 common frames omitted
There are 2 of The IntegrationFlowBeanPostProcessor class definition and my application work to use this:
org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor
and the code below, it throws class not found exception:
if (component instanceof org.springframework.integration.expression.IntegrationEvaluationContextAware)
The other class is in this package:
org.springframework.integration.config.dsl
It don't use IntegrationEvaluationContextAware.
But my application works to use the first one.
What can be the reason of it?
Thanks
I read Spring Integration 4.3 to 5.0 Migration Guide now and I see this: Java DSL The Spring Integration Java DSL has been merged to the Core project with Java 8 code base. The old project remains for the previous Spring Integration versions and isn't compatible with version 5.0. I remove the java-dsl dependency and my project works. Sorry for my question

Hazelcast exception with hazelcast-hibernate5

I am using Hibernate OGM 5.1.0.Final and hazelcast-hibernate5 1.1.3 ( even checked with 1.2 ). The OGM compatible hibernate ORM dependency is 5.1.5 , which is present in POM.
Caused by: java.lang.IncompatibleClassChangeError: Expected static method org.hibernate.cache.internal.DefaultCacheKeysFactory.createEntityKey(Ljava/lang/Object;Lorg/hibernate/persister/entity/EntityPersister;Lorg/hibernate/engine/spi/SessionFactoryIm
at com.hazelcast.hibernate.region.EntityRegionAccessStrategyAdapter.generateCacheKey(EntityRegionAccessStrategyAdapter.java:66)
at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:198)
at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
at org.hibernate.ogm.loader.impl.OgmLoader.initializeEntitiesAndCollections(OgmLoader.java:807)
at org.hibernate.ogm.loader.impl.OgmLoader.doQuery(OgmLoader.java:393)
at org.hibernate.ogm.loader.impl.OgmLoader.doQueryAndInitializeNonLazyCollections(OgmLoader.java:283)
at org.hibernate.ogm.loader.impl.OgmLoader.loadEntity(OgmLoader.java:201)
at org.hibernate.ogm.loader.impl.OgmLoader.loadEntitiesFromTuples(OgmLoader.java:220)
at org.hibernate.ogm.loader.entity.impl.DynamicBatchingEntityLoaderBuilder$DynamicBatchingEntityLoader.loadEntitiesFromTuples(DynamicBatchingEntityLoaderBuilder.java:127)
at org.hibernate.ogm.query.impl.OgmQueryLoader.listOfEntities(OgmQueryLoader.java:92)
at org.hibernate.ogm.query.impl.OgmQueryLoader.list(OgmQueryLoader.java:78)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.ogm.query.impl.OgmQueryTranslator.list(OgmQueryTranslator.java:129)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1339)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
at com.olp.jpa.common.AbstractRepositoryImpl.findAll(AbstractRepositoryImpl.java:137)
The issue looked similar to the one reported here - https://github.com/hazelcast/hazelcast-hibernate5/issues/13 , however I cannot upgrade ORM to 5.2, since it is not supported by OGM yet. Please suggest if there is a solution/workaround for the issue.
Version 1.1.3 and 1.2 of hazelcast-hibernate5 depend on Hibernate version 5.0.9.Final. You might need to exclude that in your Maven configuration and declare Hibernate dependency with version 5.1.5 yourself.
Update
It seems hazelcast-hibernate5 doesn't support Hibernate 5.1.5. So I have modified hazelcast-hibernate5 code to support Hibernate 5.1.5 and released a custom version which can be found here. Note that this is not available on Maven central and it's not an official release of the plugin, just a quick change to support Hibernate 5.1.5 for your use case. It means that you have to install it to your local Maven repository first (or embed the JAR directly to your project). You can see the changes I have made in this branch to examine the code, or build from the source yourself.

Unable to load Oracle JDBC driver in JSF application on Tomcat 7

I wrote a JSF application that uses a connection to an Oracle database. I verified on my local Tomcat (version 7.0) that everything works well. Then when being deployed to a server with a Tomcat 7 that I don't administrate, I get the following error thrown:
Caused by:
java.lang.NoClassDefFoundError - Could not initialize class oracle.jdbc.driver.OracleDriver
On my local system I have the Oracle JDBC Driver (version 11.2.0.4) in CATANIA_HOME/lib. According to the information I have of my deployment server, they use the exact same driver.
At the moment I am using a very basic JSF software that does nothing else than execute
Class.forName("oracle.jdbc.driver.OracleDriver");
on page load. Again, works fine on my local system. Fails on the deployment server. I figured that maybe they missed to include the driver, although they wrote they put it in. So I added the ojdbc5.jar to WEB-INF/lib. However then I get a SealingViolation thrown, which seems to indicate that the class loader found TWO resources containing the oracle driver.
If would be very happy if you were to give me some hints as to how I might solve this problem.
Thanks
Just put the driver jars in your WEB-INF/lib folder, in my case, I put ojdbc6.jar, you must have one ojdbc6.jar in your project, hope this help

Xerces error: org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl

I'm developing a web application using JSF 2.0, NetBeans 6.9.1, GlassFish Server 3.1, mojarra 2.0.3, and JasperReports 3.7.6. Included in my project library is the jar file "xerces-2.8.0.jar". This file was imported as part of the JasperReports jar file library. Whenever I try to deploy, run, or debug my project through NetBeans, I receive this error:
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.
After any change in my project my build fails, and I receive the above error, when I try to deploy, run, or debug it. I have to restart the server and run/debug a second time. I've searched the internet and cannot find a solution to this problem. I've looked at the jar file in question, and and DTDDVFactoryImpl does indeed extend from DTDDVFactory - I don't know why I'm receiving this error. While I can eventually get my project running, it would be much nicer if I wasn't receiving this error.
Can anyone please tell me how I can fix this? Do I need to remove this file from my project library? Do I need to update this file with a newer version/older version?
If you provide your own xerces.jar, you have to do that through the Endorsed Standards Override Mechanism (java -Djava.endorsed.dirs=/path/to/xerces.jar), you are not allowed to just add it on the classpath (and will sooner or later run into trouble if you do). Let me explain.
JAXP is the Java API for XML Processing. The creation of JAXP objects (like parsers, XSLT transfomers, DOM Documents) is done through the factory/factory-method pattern so you can plugin a new JAXP implementation (it has to be newer than the one provided in your JRE). Xerces provides (part of) a JAXP implementation and contains endorsed standards (an endorsed standard is a Java API defined through a standards process other than the Java Community Process, see the Endorsed Standards Override Mechanism). You'll run in all kinds of troubles if you don't use the ESOM.
I got this error when using Selenium with Glassfish. I got around it by copying XML jars (xerces-*, xalan-*, xml-apis*, serialize*) from selenium/libs/ to $AS_HOME/lib/endorsed (for Glassfish 2) or to $AS_HOME/glassfish/lib/endorsed for Glassfish 4.

Resources