Ah indeed, it looks like DeltaSpike Data module impl JAR is included in:

<module name="org.apache.deltaspike.modules"
services="export" />

https://github.com/apache/deltaspike/blob/a82f6ad27486756cc6d80d3a2db1695b779e36be/deltaspike/dist/full/src/main/distribution/modules-module.xml#L25-L26

That being said, it is likely to be an issue at how DeltaSpike integrates with 
WildFly module system rather than a Camel issue. SO I would you post a question 
on the WildFly forum or contact DeltaSpike user group.

Let us know what you think.

Antonin

> On 5 May 2017, at 11:35, Drazen Kozic <kozic.dra...@gmail.com> wrote:
> 
> Hello Antonin,
> Thanks for the help. My assumption also was related to DeltaSpike
> module configuration. Especially having in mind that tests are passing
> OK.
> I have downloaded distribution-full-1.7.2.zip of the DeltaSpike.
> Inside it there are module.xml files for Wildfly. I didn't change
> anything.
> 
> Regards
> 
> 
> Best regards
> 
> Drazen Kozic
> 
> 
> On Fri, May 5, 2017 at 10:34 AM, Antonin Stefanutti
> <anto...@stefanutti.fr> wrote:
>> Hi Drazen,
>> 
>> It looks like the org.apache.deltaspike.data.impl.handler.QueryHandler class 
>> is not visible from the Camel module you’ve deployed. So it’s rather an 
>> issue of using Deltaspike data module within the WildFly module system. So 
>> you may need to add the deltaspike-data-module JARs to your module or 
>> properly create a module for Deltaspike data module.
>> 
>> Antonin
>> 
>>> On 5 May 2017, at 08:05, Drazen Kozic <kozic.dra...@gmail.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I want to use Camel 2.18.3 on WildFly-10.1.0.Final. My desired setup
>>> is as follow:
>>> - to use camel-cdi features
>>> - to deploy camel and all third party dependencies as WildFly modules
>>> - to deploy my application as war on WildFly with all internal
>>> dependencies as jars in web-inf/lib
>>> - I do not want to use WilfFly Camel Subsystem from
>>> https://github.com/wildfly-extras/wildfly-camel
>>> 
>>> I have deployed camel as module by looking at WildFly Camel Subsystem
>>> (wildfly-camel-patch-4.6.0). I took all content starting from
>>> modules/system/layers/fuse/org/apache/camel and put it into my Wildfly
>>> installation into modules/system/layers/base/org/apache/camel.
>>> 
>>> I have created some routes and processors. Everything went fine untill
>>> moment when I modified my processor to trigger one of my services
>>> which are using Deltaspike data module functionality. I got this log
>>> output:
>>> 
>>> 17:27:52,280 INFO
>>> [com.mvneco.tebio.batch.common.BatchCamelContextProducer] (MSC service
>>> thread 1-5) CamelContext configured: batch-camel-context
>>> 17:27:52,297 INFO  [com.mvneco.tebio.batch.simple.MySimpleProcessor]
>>> (MSC service thread 1-5) Processor constructed: MySimpleProcessor
>>> 17:27:52,335 INFO  [com.mvneco.tebio.batch.simple.MySimpleRoute] (MSC
>>> service thread 1-5) Route configured: MySimpleRoute
>>> 17:27:52,341 INFO  [org.apache.camel.cdi.CdiCamelExtension] (MSC
>>> service thread 1-5) Camel CDI is starting Camel context
>>> [batch-camel-context]
>>> 17:27:52,342 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>>> service thread 1-5) Apache Camel 2.18.3 (CamelContext:
>>> batch-camel-context) is starting
>>> 17:27:52,344 INFO
>>> [org.apache.camel.management.ManagedManagementStrategy] (MSC service
>>> thread 1-5) JMX is enabled
>>> 17:27:52,455 INFO
>>> [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service
>>> thread 1-5) Loaded 189 type converters
>>> 17:27:52,493 INFO
>>> [org.apache.camel.impl.DefaultRuntimeEndpointRegistry] (MSC service
>>> thread 1-5) Runtime endpoint registry is in extended mode gathering
>>> usage statistics of all incoming and outgoing endpoints (cache limit:
>>> 1000)
>>> 17:27:52,498 WARN  [org.jboss.as.weld] (MSC service thread 1-5)
>>> WFLYWELD0052: Using deployment classloader to load proxy classes for
>>> module org.apache.camel.core:main. Package-private access will not
>>> work. To fix this the module should declare dependencies on
>>> [org.jboss.weld.core, org.jboss.weld.spi]
>>> 17:27:52,630 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>>> service thread 1-5) StreamCaching is not in use. If using streams then
>>> its recommended to enable stream caching. See more details at
>>> http://camel.apache.org/stream-caching.html
>>> 17:27:52,693 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>>> service thread 1-5) Route: MySimpleRoute started and consuming from:
>>> file://c:/test-folder?move=.done&moveFailed=.error
>>> 17:27:52,694 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>>> service thread 1-5) Total 1 routes, of which 1 are started.
>>> 17:27:52,695 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>>> service thread 1-5) Apache Camel 2.18.3 (CamelContext:
>>> batch-camel-context) started in 0.351 seconds
>>> 17:27:52,968 INFO  [org.wildfly.extension.undertow] (ServerService
>>> Thread Pool -- 59) WFLYUT0021: Registered web context: /tebio-batch
>>> 17:27:53,013 INFO  [org.jboss.as.server] (ServerService Thread Pool --
>>> 34) WFLYSRV0010: Deployed "tebio-batch.war" (runtime-name :
>>> "tebio-batch.war")
>>> 17:27:53,164 INFO  [org.jboss.as] (Controller Boot Thread)
>>> WFLYSRV0060: Http management interface listening on
>>> http://127.0.0.1:9990/management
>>> 17:27:53,165 INFO  [org.jboss.as] (Controller Boot Thread)
>>> WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
>>> 17:27:53,165 INFO  [org.jboss.as] (Controller Boot Thread)
>>> WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final)
>>> started in 17385ms - Started 465 of 713 services (409 services are
>>> lazy, passive or on-demand)
>>> 17:28:14,328 WARN
>>> [org.apache.camel.component.file.GenericFileOnCompletion] (Camel
>>> (batch-camel-context) thread #0 - file://c:/test-folder) Rollback file
>>> strategy: 
>>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@77ab824b
>>> for file: GenericFile[c:\test-folder\test1.txt]
>>> 17:28:14,337 ERROR [com.mvneco.tebio.batch] (Camel
>>> (batch-camel-context) thread #0 - file://c:/test-folder) Failed
>>> delivery for (MessageId: ID-dkozic-PC-58228-1493825271666-0-1 on
>>> ExchangeId: ID-dkozic-PC-58228-1493825271666-0-2). Exhausted after
>>> delivery attempt: 1 caught: java.lang.IllegalStateException: Could not
>>> find beans for Type=class
>>> org.apache.deltaspike.data.impl.handler.QueryHandler
>>> 
>>> Message History
>>> ---------------------------------------------------------------------------------------------------------------------------------------
>>> RouteId              ProcessorId          Processor
>>>                                                   Elapsed (ms)
>>> [MySimpleRoute     ] [MySimpleRoute     ]
>>> [file://c:/test-folder?move=.done&moveFailed=.error
>>>       ] [        33]
>>> [MySimpleRoute     ] [MySimpleProcessor ] [Processor@0x60f6861a
>>>                                                 ] [        20]
>>> 
>>> Stacktrace
>>> ---------------------------------------------------------------------------------------------------------------------------------------:
>>> java.lang.IllegalStateException: Could not find beans for Type=class
>>> org.apache.deltaspike.data.impl.handler.QueryHandler
>>>       at 
>>> org.apache.deltaspike.core.api.provider.BeanProvider.getBeanDefinitions(BeanProvider.java:415)
>>>       at 
>>> org.apache.deltaspike.core.api.provider.BeanProvider.getBeanDefinitions(BeanProvider.java:398)
>>>       at 
>>> org.apache.deltaspike.proxy.api.DeltaSpikeProxyContextualLifecycle.instantiateDelegateInvocationHandler(DeltaSpikeProxyContextualLifecycle.java:124)
>>>       at 
>>> org.apache.deltaspike.proxy.api.DeltaSpikeProxyContextualLifecycle.create(DeltaSpikeProxyContextualLifecycle.java:84)
>>>       at 
>>> org.apache.deltaspike.core.util.bean.ImmutableBean.create(ImmutableBean.java:72)
>>>       at 
>>> org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:70)
>>>       at 
>>> org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
>>>       at 
>>> org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
>>>       at 
>>> org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:742)
>>>       at 
>>> org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:842)
>>>       at 
>>> org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
>>>       at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:364)
>>>       at 
>>> org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:375)
>>>       at 
>>> org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
>>>       at 
>>> org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
>>>       at 
>>> org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:72)
>>>       at 
>>> org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:121)
>>>       at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159)
>>>       at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
>>>       at 
>>> org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
>>>       at 
>>> org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:141)
>>>       at 
>>> org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
>>>       at 
>>> org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
>>>       at 
>>> org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
>>>       at 
>>> com.mvneco.ecofin.service.FinAccountServiceBean$Proxy$_$$_WeldClientProxy.getOptionalFinAccount(Unknown
>>> Source)
>>>       at 
>>> com.mvneco.tebio.batch.simple.MySimpleProcessor.process(MySimpleProcessor.java:37)
>>>       at 
>>> org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
>>>       at 
>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
>>>       at 
>>> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
>>>       at 
>>> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>>>       at 
>>> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>>>       at 
>>> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:460)
>>>       at 
>>> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:227)
>>>       at 
>>> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:191)
>>>       at 
>>> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
>>>       at 
>>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
>>>       at 
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>>>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>>>       at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>>>       at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>>>       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)
>>> 
>>> I have to mention that my tests passes (@RunWith(CamelCdiRunner.class)).
>>> 
>>> My src/main/webapp/META-INF/jboss-deployment-structure.xml is like this:
>>> 
>>> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
>>>       <deployment>
>>>               <dependencies>
>>>                       <module name="org.apache.deltaspike.core"
>>> services="export" />
>>>                       <module name="org.apache.deltaspike.modules"
>>> services="export" />
>>>                       <module name="org.apache.commons.lang3" />
>>> 
>>>                       <module name="org.apache.camel.core"
>>> export="true" services="export" />
>>>                       <module name="org.apache.camel.component.ftp"
>>> export="true" services="export" />
>>>                       <module name="org.apache.camel.component.cdi"
>>> export="true" services="export" />
>>> 
>>>               </dependencies>
>>>       </deployment>
>>> </jboss-deployment-structure>
>>> 
>>> Every of jars declared as dependency in pom.xml have beans.xml. I have
>>> tried different wildfly module configurations without success.
>>> 
>>> Any help is appreciated.
>>> 
>>> 
>>> Drazen Kozic
>> 

Reply via email to