Hazelcast exception with hazelcast-hibernate5 - hazelcast

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.

Related

Spark do not resolve ivy specified repositories after upgrade form 2.2.1 to 2.3

We have spark configuration that uses spark.jars.ivySettings to customize jars resolution.
Spark jobs run in environment without internet access, so we want to skip maven central calls and use our repositories.
In spark 2.2.1 everything was working fine, but when we upgraded to 2.3, repositories specified in ivy settings are ignored. As the result our jobs are failing due to missing dependencies.
Specifying our repos with new spark.jars.repositories makes it visible for spark, but does not change an order (so it will always first check maven central, which we cannot allow).
Is this some bug introduced in new version? Or I'm doing something wrong here?
Ok, I found where is the problem. So apparently the way of acquiring spark.jars.ivySettings has changed in 2.3. Now system properties are used for that:
sys.props.get("spark.jars.ivySettings")
This change is not followed by documentation update, and for me it seems like a bug.

jsf 1.2 to jsf 2.2 migration causes: javax.faces.FacesException

I'm working on a project about migrating from jsf1.2 to JSF 2.2,I already removed the jsf 1.2 jars and I replaced them by jsf 2.2 jars! But when I'm trying to change schema namespace in faces-config file(new namespace definition for jsf 2.2) I got this exeception:
Caused by: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is
not an instance of com.sun.faces.spi.AnnotationProvider
This seems like an inconsistence in your dependencies.
This Exception obviously points out, that
org.jboss.as.web.deployment.jsf.JandexAnnotationProvider
is not an extension of
com.sun.faces.spi.AnnotationProvider
However, I've done a little research using http://grepcode.com to get a better Picture of this Problem.
It seams, that JandexAnnotationProvider actualy is an extension of AnnotationProvider, at least after jboss-as-web version 7.0.0
Also Interesting was, that JandexAnnotationProvider disappeared after version 7.1.2.Final
I would suggest updating to the latest Version of jboss-as-web, which is 7.2.0
This class might got replaced for a reason related to your problem.
You can acquire this version at:
http://central.maven.org/maven2/org/jboss/as/jboss-as-web/7.2.0.Final/jboss-as-web-7.2.0.Final.jar
or as Maven dependency:
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-web</artifactId>
<version>7.2.0.Final</version>
</dependency>
Best regards,
J.Adam

How to use kernal in ServiceStack version="4.0.36"

I want to use StandardKernel object in my IOC container for that I downloaded “ServiceStack.ContainerAdapter.Ninject”. this Ninject is dependency with ServiceStack.Common (≤ 3.9.59) but I AM using the latest version of ServiceStack version="4.0.36".
Can anyone suggest me how to use kernel in ServiceStack version="4.0.36".
IKernel kernel = new StandardKernel
According to the package's nuGet page , this package has a dependency on ServiceStack 3.9.59 and below. It doesn't appear to currently support the 4.x version of ServiceStack.
Looks like the code is hosted on github. You could contact the author and ask him about supporting 4.x or you could fork it, make it compatible with 4.x and then submit a pull request.

IllegalArgumentException: com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider

I am trying to deploy an application on Websphere 8.5.5
I've created a shared library for Websphere that includes myfaces 2.2 jars and other dependencies like commons-collections.
I also made the class loader of my application as PARENT_LAST.
When I deploy the application, I get this exception:
An error occured while initializing MyFaces: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
java.lang.IllegalArgumentException: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:557)
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:524)
I was looking at running a newer version of MyFaces on WAS 8.5.5, and ran into a similar issue. It appears to be a conflict between the code IBM wrote to support its embedded version of MyFaces, and an application- or shared library-provided MyFaces.
IBM provides a way to circumvent this issue. When WAS 8.0 shipped, it provided a feature to allow select either "SunRI1.2" or "MyFaces" as the server-provided JSF. Setting the default to "SunRI1.2" would remove the server-provided MyFaces from the classpath and allow the developer to provide their own.
Select any application
Click JSP and JSF Options
In the JSF implementation section, change the drop-down to SunRI1.2
Click OK
Save configuration and restart server

Why are some RichFaces artifacts not in Maven Central?

In order to get the RichFaces Validator artifact org.richfaces.ui.validator:richfaces-ui-validator-ui (4.2.2 Final) in my build, I had to add https://repository.jboss.org/nexus/content/repositories/releases as repository in my POM.
I went that way after my build complained it couldn't find that artifact and a search for 'richfaces' in Maven Central did not return the "complete set" of RichFaces artifacts.
Just curious if anyone knows how RichFaces artifacts are chosen for inclusion in Maven Central.
Short answer: if you need this, you're probably doing something wrong. Maven Central should have all the dependencies required to create an app with RichFaces.
I was trying to add the ui-validator component separately (which is not deployed to Maven central) under the mistaken assumption that I needed it explicitly identified as a dependency. Including it caused me a considerable amount of pain (multiple csv.xml files in deployment).
In the end, I realized that the ui-components dependency (which is installed on Maven Central) bundles up the validation dependency (and many others).
In the end, I wasn't getting the components I was looking for anyway. I thought I needed the rich:ajaxValidator, but that was only because I was attempting to use code from the 3.x RichFaces Showcase in a 4.x app (and that tag was removed in 4.x).

Resources