Is it possible to use jOOQ with Quarkus? - jooq

I was curious if jOOQ would work with Quarkus so I created a Gradle project. I'm getting this build error:
Caused by: io.quarkus.creator.AppCreatorException: Failed to augment application classes
at io.quarkus.creator.phase.augment.AugmentTask.run(AugmentTask.java:188)
at io.quarkus.creator.phase.augment.AugmentTask.run(AugmentTask.java:53)
at io.quarkus.creator.CuratedApplicationCreator.runTask(CuratedApplicationCreator.java:139)
at io.quarkus.gradle.tasks.QuarkusBuild.buildQuarkus(QuarkusBuild.java:91)
... 92 more
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jooq.DSLContext and qualifiers [#Default]
- java member: com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter#<init>()
- declared on CLASS bean [types=[com.hexarchbootdemo.application.port.output.persistence.FindVoterPort, com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter, com.hexarchbootdemo.application.port.output.persistence.RegisterVoterPort, java.lang.Object], qualifiers=[#Named(value = "voterPersistenceH2Adapter"), #Default, #Any], target=com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter]
at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:879)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:231)
at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:117)
at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
at io.quarkus.builder.BuildContext.run(BuildContext.java:279)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.jooq.DSLContext and qualifiers [#Default]
- java member: com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter#<init>()
- declared on CLASS bean [types=[com.hexarchbootdemo.application.port.output.persistence.FindVoterPort, com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter, com.hexarchbootdemo.application.port.output.persistence.RegisterVoterPort, java.lang.Object], qualifiers=[#Named(value = "voterPersistenceH2Adapter"), #Default, #Any], target=com.hexarchbootdemo.adapter.output.persistence.h2.VoterPersistenceH2Adapter]
I tried adding DI hints (https://quarkus.io/guides/cdi-reference) to application.properties, but it made no difference.
quarkus.index-dependency.jooq.group-id=org.jooq
quarkus.index-dependency.jooq.artifact-id=jooq
jOOQ dependency exists:
compileClasspath - Compile classpath for compilation 'main' (target (jvm)).
+--- org.springframework.boot:spring-boot-starter-jooq:2.2.3.RELEASE
| +--- org.springframework.boot:spring-boot-starter-jdbc:2.2.3.RELEASE
...
...
| \--- **org.jooq:jooq:3.12.3**
Is it possible to use jOOQ and Quarkus?

I found this repo with an example of using jOOQ and Quarkus which got me past the above error: https://github.com/jean-merelis/jOOQ-mcve.
Changes I made were:
Added a class similar to https://github.com/jean-merelis/jOOQ-mcve/blob/master/src/main/java/org/jooq/mcve/JooqContextProducer.java
Added a similar config file like https://github.com/jean-merelis/jOOQ-mcve/blob/master/src/main/resources/reflection-config.json
Update 2022-01-13
There's an "official" jOOQ extension for Quarkus at https://github.com/quarkiverse/quarkus-jooq that started in February 2021.

Related

Java11 Migration : Powermock error while instantiating the test cases

I am attaching error log here. It is causing compilation failure in a maven project. Seems that tests are not running after all saying that no tests were found. What I have done during migration is excluding all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.powermock.modules.testng.internal.TestClassInstanceFactory.create(TestClassInstanceFactory.java:48)
... 24 more
Caused by: java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)
at com.sun.proxy.$Proxy32.isTypeMockable(Unknown Source)
at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)
at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:241)
at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:229)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
at org.mockito.Mockito.mock(Mockito.java:1908)
at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)
at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)
at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)
at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:126)
... 29 more
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration#e146f93
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:54)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)
at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:22)
at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:19)
at org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
... 41 more
Caused by: java.lang.ClassCastException: Cannot cast org.powermock.api.mockito.mockmaker.PowerMockMaker to org.mockito.plugins.MockMaker
at java.base/java.lang.Class.cast(Class.java:3605)
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:50)
... 46 more`
What I have done during migration is excluded all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).
I was expecting the tests to run, but they are not even being initiated.

Deploy TomCat problem: Could not find backup for factory javax.faces.application.ApplicationFactory [duplicate]

This question already has answers here:
java.lang.IllegalStateException:Could not find backup for factory javax.faces.application.ApplicationFactory
(5 answers)
Closed 3 years ago.
I have a application with JSF 2.3, Primefaces 6.3, I always deploy with Wildfly 15. But now I need deploy with Tomcat 8.5 or higher, but when I run "startup.bat", always not successfull. I already changes the jsf-api jar, impl.jar, and another things. Someone know who I Fix it?
Already changed some jars, alredy add listener on web.xml
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:377)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4680)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1849)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:929)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:932)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: java.lang.UnsupportedOperationException
at javax.faces.application.Application.addSearchKeywordResolver(Application.java:2055)
at org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27)
at org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:147)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2169)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2145)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:296)
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:602)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:371)
... 42 more
04-Jun-2019 11:38:06.401 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
04-Jun-2019 11:38:06.651 ADVERTÊNCIA [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [242] milliseconds.
04-Jun-2019 11:38:06.651 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal Context [/hstchipcentre-web] startup failed due to previous errors
04-Jun-2019 11:38:06.666 GRAVE [main] javax.faces.FactoryFinderInstance.getFactory O aplicativo não foi iniciado corretamente na inicialização. Não foi possível encontrar Fábrica: javax.faces.application.ApplicationFactory. Attempting to find backup.
04-Jun-2019 11:38:06.682 GRAVE [main] com.sun.faces.config.ConfigureListener.contextDestroyed Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:541)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292)
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:136)
at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4727)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5388)```
In the project I founded jsf-api jar, impl.jar duplicated. Problem solved.

java.lang.VerifyError: org/primefaces/behavior/confirm/ConfirmBehaviorHandler Wrong return type in function

This morning (South African time), Maven downloaded the latest primefaces jar (version 5.3). While my project is setup in a manner that maven deploys the project to my Web Container (in this case, Wildfly 9.0.1.Final), it failed deployment due to the following exception:
2015-10-19 09:52:36,696 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 82) Critical error during deployment: : java.lang.VerifyError: (class: org/primefaces/behavior/confirm/ConfirmBehaviorHandler, method: createBehavior signature: (Ljavax/faces/view/facelets/FaceletContext;Ljava/lang/String;)Lorg/primefaces/behavior/base/AbstractBehavior;) Wrong return type in function
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.faces.util.Util.loadClass(Util.java:364)
at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:420)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processBehavior(FaceletTaglibConfigProcessor.java:402)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:374)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:441)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
2015-10-19 09:52:36,702 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 82) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./vldm-admin: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./vldm-admin: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.VerifyError: (class: org/primefaces/behavior/confirm/ConfirmBehaviorHandler, method: createBehavior signature: (Ljavax/faces/view/facelets/FaceletContext;Ljava/lang/String;)Lorg/primefaces/behavior/base/AbstractBehavior;) Wrong return type in function
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.VerifyError: (class: org/primefaces/behavior/confirm/ConfirmBehaviorHandler, method: createBehavior signature: (Ljavax/faces/view/facelets/FaceletContext;Ljava/lang/String;)Lorg/primefaces/behavior/base/AbstractBehavior;) Wrong return type in function
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:224)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: java.lang.RuntimeException: java.lang.VerifyError: (class: org/primefaces/behavior/confirm/ConfirmBehaviorHandler, method: createBehavior signature: (Ljavax/faces/view/facelets/FaceletContext;Ljava/lang/String;)Lorg/primefaces/behavior/base/AbstractBehavior;) Wrong return type in function
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)
... 8 more
Caused by: java.lang.VerifyError: (class: org/primefaces/behavior/confirm/ConfirmBehaviorHandler, method: createBehavior signature: (Ljavax/faces/view/facelets/FaceletContext;Ljava/lang/String;)Lorg/primefaces/behavior/base/AbstractBehavior;) Wrong return type in function
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.faces.util.Util.loadClass(Util.java:364)
at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:420)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processBehavior(FaceletTaglibConfigProcessor.java:402)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:374)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:441)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
... 10 more
I have reverted back to PrimeFaces 5.2 for now do get the application up and running.
How do I resolve this problem?
I had the exact same error message. The problem was that there still was the old primefaces-5.2.jar in my WAR (pulled in by Maven in my case). After cleaning the whole project the problem was gone.
So make sure that there is no older version of Primefaces hidden somewhere in your project or deployment.
You must clean the logs, data and tmp folders on Wildfly. Additionally, you must verify in your WEB-INF/lib folder and erase all the libraries related to primefaces. Finally, run other time the Maven on the project.
Try this:
in eclipse in "servers" tab right-click on the Tomcat instance and click on "Clean Tomcat Work Directory ...".

ClassNotFoundException: org.springframework.cassandra.core.Cancellable with spring-data-cassandra version 1.2.1

I'm getting the following exception when using current GA version 1.2.1. The repository object is autowired in my sample code.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/vmware/vrack/CassandraConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminOperations]: Factory method 'cassandraTemplate' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/cassandra/core/Cancellable
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 37 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminOperations]: Factory method 'cassandraTemplate' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/cassandra/core/Cancellable
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 46 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/cassandra/core/Cancellable
at org.springframework.data.cassandra.config.java.AbstractCassandraConfiguration.cassandraTemplate(AbstractCassandraConfiguration.java:85)
at mine.samples.CassandraConfiguration$$EnhancerBySpringCGLIB$$831105a6.CGLIB$cassandraTemplate$5(<generated>)
at mine.samples.CassandraConfiguration$$EnhancerBySpringCGLIB$$831105a6$$FastClassBySpringCGLIB$$2a9e6652.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at mine.samples.CassandraConfiguration$$EnhancerBySpringCGLIB$$831105a6.cassandraTemplate(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 47 more
Caused by: java.lang.ClassNotFoundException: org.springframework.cassandra.core.Cancellable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:170)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:136)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 58 more
Is there a fix or workaround for this?
After much snooping around I found out that the issue was due to an older version of spring-cql being used.
I fixed it by using dependency management to explicitly use the latest spring-cql version. Add this to your pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-cql</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
The spring-data-cassandra 1.1.3 release does not have this problem. You can switch back to that if you just need to get things running.
(I am also watching this issue to see if it gets fixed.)

java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder

My application, which uses JSF 2 and Richfaces 3.3.3, and mojarra 2.0.2 works fine on Glassfish 3.1 , but whenever i port it on Tomcat 7.0.10, every time i get one or the other problem.
It started with failure to detect jsf_core.tld , followed by some JSF rendering issue and finally this one.
Lastly i found some which i m mentioning here and which i cannot find a way around to fix.
Mar 31, 2011 8:57:52 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:294)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4651)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5154)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5149)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:357)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:226)
... 8 more
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder
at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:586)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:472)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:796)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:294)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:213)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:338)
... 9 more
You've the RichFaces impl JAR file, but not the RichFaces API JAR in the runtime classpath.
The stacktrace is evidence of this:
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder
at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62)
The at org.ajax4jsf.renderkit.ChameleonRenderKitFactory line indicates that this particular class was successfully loaded and executed (otherwise it wouldn't have shown up as an at xxx in the stacktrace at all). This class is part of RichFaces impl JAR file. The InternetResourceBuilder is in turn part of the RichFaces API JAR file. This is apparently missing in the runtime classpath. At least, that's just exactly what the exception is telling us.
From the exception it seems that Richfaces cannot be found. Put the jar in your classpath (for Tomcat WEB-INF/lib or WEB-INF/classes) and try again.

Resources