Kie Business Central Installation Failed - java

I try to install Business Workbench downloaded from drools site here
into latest WildFly server but always failed with below error:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"business-central.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type KeyCloakUserManager with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public org.uberfire.ext.security.management.keycloak.KCCredentialsUserManagementService(KeyCloakUserManager, KeyCloakGroupManager, CredentialsClientFactory, #Named UberfireRoleManager)
at org.uberfire.ext.security.management.keycloak.KCCredentialsUserManagementService.<init>(KCCredentialsUserManagementService.java:0)
WELD-001474: Class org.uberfire.ext.security.management.keycloak.KeyCloakUserManager is on the classpath, but was ignored because a class it references was not found: org.jboss.resteasy.client.ClientResponseFailure from [Module \"deployment.business-central.war\" from Service Module Loader].
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Exception 1 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type KeyCloakGroupManager with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 2 of [BackedAnnotatedConstructor] #Inject public org.uberfire.ext.security.management.keycloak.KCAdapterUserManagementService(KeyCloakUserManager, KeyCloakGroupManager, KCAdapterClientFactory, HttpServletRequest, #Named UberfireRoleManager)
at org.uberfire.ext.security.management.keycloak.KCAdapterUserManagementService.<init>(KCAdapterUserManagementService.java:0)
WELD-001474: Class org.uberfire.ext.security.management.keycloak.KeyCloakGroupManager is on the classpath, but was ignored because a class it references was not found: org.jboss.resteasy.client.ClientResponseFailure from [Module \"deployment.business-central.war\" from Service Module Loader].
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.core#3.1.9.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Please I need some help on how to deploy this. Thanks.

Related

Playframework [2.6.6] to [2.7.0] causes CreationException

I try to migrate my play 2.6.6 application to 2.7.0. I am using Hibernate 4.2.3-Final. Does anybody know the cause of those Exceptions?
GeneralDao.java:71 is:
#Inject
public GeneralDao(JPAApi jpaApi) {}
OnStartup.java:66 is similar to above.
CreationException: Unable to create injector, see the following errors
1) Error injecting constructor, javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:59)
at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:50)
while locating play.db.jpa.JPAApi
for the 1st parameter of dao.GeneralDao.<init>(GeneralDao.java:71)
for the 2nd parameter of modules.OnStartup.<init>(OnStartup.java:66)
at modules.OnStartupModule.configure(OnStartupModule.java:10) (via modules: com.google.inject.util.Modules$OverrideModule -> modules.OnStartupModule)
while locating modules.OnStartup
Caused by: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
[cut]
Caused by: java.lang.RuntimeException: Error while reading file:/R:/appDir/target/scala-2.12/classes/
at org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:131)
[cut]
Caused by: java.io.IOException: invalid constant type: 18
[cut]
Full Stacktrace: https://pastebin.com/nEt1iavu
Updating to Hibernate 4.2.8-Final resolved the errors.
Thank you Stephen C for the hint.

Spring Redisson Sentinel Error - At least two sentinels are required

I am using Sentinel mode for Redis. I am using Redisson Client version 3.9.1
<dependencies>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-data-20</artifactId>
<version>${redisson-version}</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>${redisson-version}</version>
</dependency>
</dependencies>
The configuration of Sentinel using Redisson:
#EnableCaching
public class RedisCache {
#Autowired
private ObjectMapper objectMapper;
#Bean
public RedissonClient redissonClient() {
Config config = new Config();
config.setCodec(new JsonJacksonCodec(objectMapper));
config.useSentinelServers()
.setMasterName("redis-master")
.addSentinelAddress("redis://localhost:26378")
.addSentinelAddress("redis://localhost:26379");
return Redisson.create(config);
}
#Bean
public RedissonConnectionFactory redissonConnectionFactory(RedissonClient redisson) {
return new RedissonConnectionFactory(redisson);
}
}
I am running two sentinel servers and one Redis master with no slave.
This is just a setup on my local environment.
Output of some commands:
redis-cli -p 26379
127.0.0.1:26379> SENTINEL get-master-addr-by-name redis-master
1) "127.0.0.1"
2) "6379"
redis-cli -p 26378
127.0.0.1:26378> SENTINEL get-master-addr-by-name redis-master
1) "127.0.0.1"
2) "6379"
Whenever I am running my Spring Boot Application, I get the following error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [xxxx/cache/impl/redis/config/RedisCache.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: At least two sentinels should be defined in Redis configuration!
......
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:204)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType (ServletContextInitializerBeans.java:226)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType (ServletContextInitializerBeans.java:214)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans (ServletContextInitializerBeans.java:91)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init> (ServletContextInitializerBeans.java:80)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans (ServletWebServerApplicationContext.java:250)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize (ServletWebServerApplicationContext.java:237)
at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup (TomcatStarter.java:54)
at org.apache.catalina.core.StandardContext.startInternal (StandardContext.java:5245)
at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call (ContainerBase.java:1420)
at org.apache.catalina.core.ContainerBase$StartChild.call (ContainerBase.java:1410)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.566 s
[INFO] Finished at: 2018-12-07T13:44:14+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:run (default-cli) on project xxx: An exception occurred while running. null: InvocationTargetException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redissonConnectionFactory' defined in class path resource [xxxxxxx/cache/impl/redis/config/RedisCache.class]: Unsatisfied dependency expressed through method 'redissonConnectionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redissonClient' defined in class path resource [xxxxxx/cache/impl/redis/config/RedisCache.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.redisson.api.RedissonClient]: Factory method 'redissonClient' threw exception; nested exception is org.redisson.client.RedisConnectionException: At least two sentinels should be defined in Redis configuration!
How do I resolve this error?
PS: I have tried master-slave configuration also, with one sentinel attached to the host and other one attached to the slave, but the error remains the same. I have tried sentinels running on different local machines with different private IPs, but the error remains the same.
Tried with 3 sentinel servers, no benefits.
Redisson doesn't seem to be working with localhost addresses. When I replaced the sentinel nodes addresses with the ones hosted on AWS, it worked fine.
Redisson, in my opinion, is a very immature client. Consider using lettuce or jedis.
See the bug filed at https://github.com/redisson/redisson/issues/1736
which doesn't allow it to shut down.
Most of the problems I faced were when I used the sentinel mode. Cluster mode I have not tried. Works fine in single mode.
Also, they don't cater to bugs or issues filed on github for months which is obvious as they have a pro and paid version, so you are on your own.
I won't recommend using Redisson as of now.
Redisson perfectly works with localhost addresses. In your case SENTINEL SENTINELS command returns empty result. Which means that Redis setup is not configured properly.
Make sure you run both redis-server as well as redis-sentinal <config>.
Once done, check which port sentinal is running at. It could also be 5000, it was in my case. Then pass "redis://localhost:5000" to addSentinelAddress.

Injecting JOOQ Context using CDI and JNDI

I try to use jooq on an PostgreSQL Database. The Web-App is built on the JSF Framework using CDI for dependency injection. The server is WildFly 11.
I use the jooq codegen to generate pojos and daos.
Following the instructions on http://awolski.com/integrating-jooq-easy/
I should be able to inject the DSLContext into any class. When I try to inject it into a controller bean which looks like
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
#Named
#RequestScoped
public class FooView implements Serializable {
private #Inject DSLContext jooq;
...
it simply doesn't work. The framework just doesn't instantiate the Foo.
What am I missing?
The server.log reads as follows:
WARN [org.jboss.modules] (Weld Thread Pool -- 4) Failed to define class model.tables.FooDao in Module "deployment.project.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link model/tables/Foo (Module "deployment.project.war" from Service Module Loader): org/jooq/impl/TableImpl
...
INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "project.war" (runtime-name : "project.war")
...
WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (default task-22) /project/Foo.xhtml #9,91 value="#{FooView.attr}": Target Unreachable, identifier 'FooView' resolved to null: javax.el.PropertyNotFoundException: /project/Foo.xhtml #9,91 value="#{FooView.attr}": Target Unreachable, identifier 'FooView' resolved to null
...
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'FooView' resolved to null
...
ERROR [io.undertow.request] (default task-22) UT005023: Exception handling request to /project/project/Foo.xhtml: javax.servlet.ServletException: /project/Foo.xhtml #9,91 value="#{FooView.attr}": Target Unreachable, identifier 'FooView' resolved to null
...
Caused by: javax.el.PropertyNotFoundException: /project/Foo.xhtml #9,91 value="#{FooView.attr}": Target Unreachable, identifier 'FooView' resolved to null
...
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'FooView' resolved to null
As soon as I remove the injected attribute from FooView, no errors show up, despite that warning.

Cannot Cast CascadingClassLoadHelper to Quartz ClassLoadHelper

I'm getting the following exception while trying to deploy my camel-quartz application in fuse:
Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=test-quartz-impl, config=osgibundle:/META-INF/spring/*.xml))
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route371: Route(route371)[[From[quartz://test/testQuartzJob?c... because of Failed to resolve endpoint: quartz://test/testQuartzJob?cron=0+0%2F15+*+1%2F1+*+%3F due to: Cannot auto create component: quartz
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123)[210:org.apache.camel.camel-spring:2.15.1.redhat-621117]
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)[210:org.apache.camel.camel-spring:2.15.1.redhat-621117]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)[174:org.apache.servicemix.bundles.spring-context:3.2.12.RELEASE_2]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)[174:org.apache.servicemix.bundles.spring-context:3.2.12.RELEASE_2]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:950)[174:org.apache.servicemix.bundles.spring-context:3.2.12.RELEASE_2]
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)[178:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)[178:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[178:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[178:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[179:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_121]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route371: Route(route371)[[From[quartz://test/testQuartzJob?c... because of Failed to resolve endpoint: quartz://test/testQuartzJob?cron=0+0%2F15+*+1%2F1+*+%3F due to: Cannot auto create component: quartz
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:190)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:838)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2897)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2620)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2469)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2465)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2488)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2465)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2434)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)[210:org.apache.camel.camel-spring:2.15.1.redhat-621117]
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)[210:org.apache.camel.camel-spring:2.15.1.redhat-621117]
... 10 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: quartz://test/testQuartzJob?cron=0+0%2F15+*+1%2F1+*+%3F due to: Cannot auto create component: quartz
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:575)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:200)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:70)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1008)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
... 22 more
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: quartz
at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:397)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:373)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:545)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
... 30 more
Caused by: org.quartz.SchedulerConfigException: Unable to instantiate class load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper [See nested exception: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper]
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:692)[662:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1509)[662:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.apache.camel.component.quartz.QuartzComponent.createScheduler(QuartzComponent.java:555)[664:org.apache.camel.camel-quartz:2.15.1.redhat-621117]
at org.apache.camel.component.quartz.QuartzComponent.getScheduler(QuartzComponent.java:407)[664:org.apache.camel.camel-quartz:2.15.1.redhat-621117]
at org.apache.camel.component.quartz.QuartzComponent.doStart(QuartzComponent.java:228)[664:org.apache.camel.camel-quartz:2.15.1.redhat-621117]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2871)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:392)[205:org.apache.camel.camel-core:2.15.1.redhat-621117]
... 32 more
Caused by: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:689)[662:org.apache.servicemix.bundles.quartz:1.8.6.1]
... 39 more
I am using camel-quartz (Quartz1 of camel).
I've seen this JBoss and Quartz but it is specific to JBoss server.
The camel-quartz dependency didn't have any scope.
After checking here http://camel.apache.org/how-to-use-extra-camel-componets-in-servicemix-camel.html, I've added provided and it started working.
Thank You #nmagerko and #ledniov.

How to deploy play framework 2.4 application on glassfish and read application.conf

I tried to deploy play framework 2.4 application on glassfish.
I used maven play2 plugin and made war file with the following instruction.
https://play2-maven-plugin.github.io/play2-maven-plugin/1.0.0-beta4/war-packaging.html
After that, I tried to deploy my war from glassfish console, but it returned the following error.
Error occurred during deployment: Exception while loading the app :
CDI deployment failure:Exception List with 3 exceptions:
Exception 0 : org.jboss.weld.exceptions.DeploymentException:
WELD-001408: Unsatisfied dependencies for type Environment with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public play.api.db.BoneConnectionPool(Environment)
at play.api.db.BoneConnectionPool.<init>(BoneConnectionPool.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:370)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:291)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:165)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:529)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:515)
at org.jboss.weld.bootst .... msg.seeServerLog
Error occurred during deployment: Exception while loading the app :
CDI deployment failure:
WELD-001408: Unsatisfied dependencies for type Database with qualifiers #Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] #Inject public modules.MyBatisModule$PlayDataSourceProvider(Database)
at modules.MyBatisModule$PlayDataSourceProvider.<init>(PlayDataSourceProvider.java:0) .
Please see server.log for more details.
And MyBatisModule is like this.
public class MyBatisModule extends org.mybatis.guice.MyBatisModule {
#Override
protected void initialize() {
environmentId("development");
bindConstant().annotatedWith(Names.named("mybatis.configuration.failFast")).to(true);
bindDataSourceProviderType(PlayDataSourceProvider.class);
bindTransactionFactoryType(JdbcTransactionFactory.class);
addMapperClasses();
}
#Singleton
public static class PlayDataSourceProvider implements Provider<DataSource> {
final Database db;
#Inject
public PlayDataSourceProvider(final Database db) {
this.db = db;
}
public DataSource get() {
return db.getDataSource();
}
}
I think the application can't read application.conf that containts DB setting. But I'm not sure.
Could you give me any advices?
Update 2015/01/13
I disabled "Implicit CDI" option on glassfish console when I deployed application.
I don't get the first error now, but I get another error...
Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException:
ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.google.inject.CreationException:
Unable to create injector, see the following errors:
1) Error in custom provider, Configuration error: Configuration error
[Cannot connect to database [default]] while locating play.api.db.DBApiProvider while locating play.api.db.DBApi for parameter 0
at play.db.DefaultDBApi.<init>(DefaultDBApi.java:28)
at play.db.DefaultDBApi.class(DefaultDBApi.java:28) while locating play.db.DefaultDBApi while locating play.db.DBApi for field
at play.db.DBModule$NamedDatabaseProvider.dbApi(DBModule.java:61) while locating play.db.DBModule$NamedDatabaseProvider
at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
at play.db.DBModule.bindings(DBModule.java:40): Binding(interface play.db.Database qualified with QualifierInstanc .... msg.seeServerLog
My conf/application.conf is here:
db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.url="jdbc:oracle:thin:#url..."
db.default.username=username
db.default.password=password
And it works on local environment.
I think glassfish can't read application.conf in war file.
I'm sorry. Could you give me the advice again?
Update 2015/01/14
The following is the part of full log.
Caused by: Configuration error: Configuration error[Exception during pool initialization]
at play.api.Configuration$.configError(Configuration.scala:178)
at play.api.PlayConfig.reportError(Configuration.scala:1048)
at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:69)
at play.api.db.PooledDatabase.createDataSource(Databases.scala:199)
at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:124)
at play.api.db.DefaultDatabase.dataSource(Databases.scala:122)
at play.api.db.DefaultDatabase.getConnection(Databases.scala:143)
at play.api.db.DefaultDatabase.getConnection(Databases.scala:139)
at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:44)
... 130 more
Caused by: com.zaxxer.hikari.pool.PoolInitializationException: Exception during pool initialization
at com.zaxxer.hikari.pool.BaseHikariPool.initializeConnections(BaseHikariPool.java:542)
at com.zaxxer.hikari.pool.BaseHikariPool.<init>(BaseHikariPool.java:171)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:60)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:48)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:58)
at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:54)
at scala.util.Try$.apply(Try.scala:191)
at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54)
... 136 more
Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported, connection test query must be configured
at com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:441)
at com.zaxxer.hikari.pool.BaseHikariPool.initializeConnections(BaseHikariPool.java:540)
... 144 more
3) Error in custom provider, java.lang.NullPointerException
at play.db.DBModule.bindings(DBModule.java:40):
Binding(interface play.db.Database qualified with QualifierInstance(#play.db.NamedDatabase(value=default)) to ProviderTarget(play.db.DBModule$NamedDatabaseProvider#34850279)) (vi
a modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating play.db.Database annotated with #play.db.NamedDatabase(value=default)
Some thoughts (it should be comment, but I cannot write comments on SO yet).
If your application.conf file is inside WEB-INF/classes directory, it should be found (more info - https://www.playframework.com/documentation/2.4.x/ProductionConfiguration#Specifying-an-alternate-configuration-file).
Does war file contain JDBC driver?
Maybe you should configure JNDI - https://www.playframework.com/documentation/2.4.x/ScalaDatabaseOthers#Exposing-the-datasource-through-JNDI
My problem cause is that:
Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported, connection test query must be configured
https://www.playframework.com/documentation/2.4.x/Migration24#JDBC-connection-pool
After I add the following setting on application.conf, it works.
(This sql is for Oracle DB.)
db.default.hikaricp.connectionTestQuery="SELECT 1 FROM DUAL"
Thank you for your help!

Categories