Weblogic 10.3.3 :: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode() - spring-data-jpa

I get the error
Caused By: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:39)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:520)
at org.springframework.orm.jpa.vendor.SpringHibernateEjbPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateEjbPersistenceProvider.java:50)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:370)
I'm using weblogic 10.3.3 and hibernate-jpa-2.0-api-1.0.1.Final.jar.
I even tried setting this jar in the server's startup classpath so it doesn't conflict with the server's JPA but the error still exists.
Not sure how to resolve this error . Any suggestions?

Related

NoClassDefFoundError Fop Library when deployed in Prod Server - Jdeveloper 11 Oracle ADF

Oracle Jdeveloper (Version 11.1.1.6.0) building ADF application that generate PDF file using Apache FOP Library. My Application runs local web server. But when deploy in production server, below NoClassDefFoundError exception is showing and failing to generate PDF file.
Exception output:
<code>
javax.el.ELException: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException
at com.sun.el.parser.AstValue.invoke(AstValue.java:191)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
...
...
Caused by: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException
at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:153)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:177)
...
...
Caused by: java.lang.ClassNotFoundException: org.apache.avalon.framework.configuration.ConfigurationException
...
...
</code>
A NoClassDefFoundError with a caused by ClassNoFoundException points to a missing library on the server. Have you checked your deployment artifact (the EAR) if it contains all the needed FOP jars?
If all jars are part of the EAR (or better the WAR inside the EAR), you need to tell the Weblogic Server to load the jars from your deployment first before looking into jars already on the server. See https://tompeez.wordpress.com/2015/06/06/pitfalls-when-using-newer-versioned-libraries-than-shipped-with-jdeveloper-or-weblogic-server/ for more info on that.

Resteasy migration from JBoss 7.1.1 to Wildfly 9.0 special tasks?

After ensuring that all the libraries (only newer) seemed to exist on Wildfly 9, and checking the RestEasy migration page, I tried to deploy an app that works find on AS 7.1.1 (uses Resteasy 2.3.2) to WF9 (Resteasy 3.0.11) but it was unable to deploy due to this error:
Caused by: java.lang.NoClassDefFoundError: org/jboss/resteasy/core/ResourceMethod
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.core.ResourceMethod from [Module \\\"deployment.CodecMapper.war:main\\\" from Service Module Loader]\"}}"
I jarfinded the class and looked in the catalog of resteasy-jaxrs-3.0.11-Final.jar but didn't find it (it was in the 2.3.2 version). Is it in a new jar or failed dependency? Or is this a migration issue I'll need to address in my code (even though it's not listed as one on the Resteasy migration page)?
I have also reviewed the Wildfly migration page specific to Resteasy, but I don't see any changes required.

Failed to startup Jboss 5.1

I am on Redhat, using Jboss 5.1 I am not able to start my Jboss. previously it was working i added some jar file in lib. Now its throwing error saying
Failed to boot JBoss:
java.lang.NullPointerException
at org.jboss.Main.boot(Main.java:136)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:745)
What can be the possible cause of this ???

Libraries of Tomcat 7.0 in conflict with httpcore-4.3.2.jar

I created dynamic web project in eclipse and want to add httpcore-4.3.2.jar lib. Every time I try to add it, Tomcat stops working. I have to use HttpClient and I can't use anything else.
How to resolve this problem?
this is the error message:
Grave: Exception starting Context with name [/FitsInterface]
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/FitsInterface]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
....
....
Caused by: java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
....
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 22 more
I found a solution: you have to deploy the libraries you included in the project build path.
If you are using eclipse, then: Properties > Deployment Assembly > add libraries from build path

Tomcat 7 Start up problem in Eclispse for maven project

I m getting this intermittent problem in eclipse, when i try to run a maven project in tomcat
Details are as follows :
Eclipse version : 3.6
Maven version : 2.2.1
Tomcat version : 7
Error log :
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3712)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Deleting and Recreating the server solves the problem, but still i would like to know why this error is created.
This error usually occurs when Spring misses a jar file on the classpath. The main reason for this is that Eclipse not always deploys a project correctly to its Tomcat server. Instead of deleting the server, you can also clean the server and redeploy the application.
Thanks for your reply. Well my problem was fixed by doing a mvn eclipse:clean eclipse:eclipse
I encountered the same error
I added my spring library in deployment assembly and build path of the project.
I think your server did not detect the library and restarting it made the server check for the build paths.