Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am deploying camel application in widlfly8.2.0Final gives error on Bindy. #549

Closed
SanjayGautam opened this issue Apr 17, 2015 · 6 comments
Labels

Comments

@SanjayGautam
Copy link

Please let me know what we need to do , I have packed everything inside the wars lib and I am not using the patch at all. I am not able to use CSV Bindy @CSVRecord
any suggestion will be very helpful

<route id = "iceGasActivity" routePolicyRef="iceStartPolicy" autoStartup="false">
           <from uri="file://E:\ravi\FEED\20150410\ICE\?noop=true&amp;fileName=gasactivity.txt" />     
           <log message="Reading file....${file:name}"              loggingLevel="INFO" />
           <setHeader headerName="TRADE_DATE"> 
             <simple>${date:now:yyyyMMdd}</simple> 
           </setHeader>        
            <unmarshal ref="bindyDataformat">
                <bindy type="Csv" classType="com.abcd.ecic.bindy.ice.gasactivity.IceGasActivity" />
            </unmarshal>
    <bean ref="iceDataProcessor" method="processGAData" />
    <log message="Deleting the existing records for TRADE_DATE......$simple{in.header.TRADE_DATE} from EF_ICE_GA"           loggingLevel="INFO" />

        <to     uri="sql:DELETE FROM RLC.EF_ICE_GA WHERE TRUNC(TRADE_DT) = TO_DATE(:#TRADE_DATE,'YYYYMMDD')" />

            <log    message="Persisting Data into EF_ICE_GA....."           loggingLevel="INFO" />

            <to     uri="jpa:com.abcd.ecic.bindy.ice.gasactivity.IceGasActivity?entityType=java.util.ArrayList" />

        </route>


ERROR 
---------------------------------------------------------------------------------------------------------------------------------------
Exchange[
        Id                  ID-VDEV20-54454-1429233771380-0-328
        ExchangePattern     InOnly
        Headers             {breadcrumbId=ID-VDEV20-54454-1429233771380-0-327, CamelFileAbsolute=true, CamelFileAbsolutePath=E:\ravi\FEED\20150410\ICE\gasactivity.txt, CamelFileContentType=t
ext/plain, CamelFileLastModified=1428638410000, CamelFileLength=347403, CamelFileName=gasactivity.txt, CamelFileNameConsumed=gasactivity.txt, CamelFileNameOnly=gasactivity.txt, CamelFilePare
nt=E:\ravi\FEED\20150410\ICE, CamelFilePath=E:\ravi\FEED\20150410\ICE\gasactivity.txt, CamelFileRelativePath=gasactivity.txt, CamelRedelivered=false, CamelRedeliveryCounter=0, TRADE_DATE=201
50416}
        BodyType            org.apache.camel.component.file.GenericFile
        Body                [Body is file based: GenericFile[E:\ravi\FEED\20150410\ICE\gasactivity.txt]]
]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------: java.lang.IllegalArgumentException: The separator has
 not been defined in the annotation @CsvRecord or not instantiated during initModel. must be specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:293) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:137) [camel-bindy-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.15.0.jar:2.15.0]
        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.15.0.jar:2.15.0]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_71]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [rt.jar:1.7.0_71]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [rt.jar:1.7.0_71]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [rt.jar:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
@jamesnetherton
Copy link
Collaborator

You'll get a better response over at the camel user or camel dev mailing lists as all of the Camel experts are on there. You can try the Camel IRC channel as well.

The bindy component works fine on the WildFly Camel subsystem as our integration tests demonstrate. Maybe this will give you some pointers to get things working.

@tdiesler
Copy link
Contributor

Rejected. This project is about WildFly-Camel integration. If you also have these issues with our latest release (without packing anything in your WAR) this is the right place to file an issue.

If you choose to package/integrate Camel yourself (i.e. ignore the provided integration) you would want to go elsewhere.

@SanjayGautam
Copy link
Author

Thanks James,

Thanks for the information and prompt answer on this. So if I deploy the my war into the patched version of the wildfly-camel and if i still get the above error with the Bindy Do you think that this is the right place. Thats what I have interpereted from you comments . Please let me know if that correct understanding. Becuase I am going to try that option now . - Thanks Sanjay

@SanjayGautam
Copy link
Author

Hi James
I had one more question , if I am using wildfly-camel as subsystem and if I use war with using spring-web do you think it will have any impacts , Please let me know if you think there will be issue, I see that from the camel -widlfly subsystem you doesnt used spring web at all. though.

thanks
Sanjay Gautam

@SanjayGautam
Copy link
Author

Hi James
Weird Class Loading Issue So far not happy still with new class loading strategy
This question is Not Answered.(Mark as assumed answered)
SANJAY GAUTAM
Apprentice
SANJAY GAUTAM Apr 17, 2015 7:42 PM
I have a application war . which uses following .

1 Wildfly 8.2.0Final +Wildfly Camel Patch
2. War which uses Spring and its a Camel application.

More Details
I can see fuse folder in the modules\system which have spring framework some of the modules defined which are used by the wildfly-camel
my war also have the spring jars inside it as well. I can say that it is happening because of that but I am not able to resolve this issue.

I tried excluding totally the spring modules from the camel springs but it still fails due other dependency this same war works fine in the tomcat with out any issue
any guys experts in class modules might help me in suggesting what needs to be done here. I dont know why I am not abel to get some thumb rule in class loading so that I can resolve these issues whenever I migration the new application .

can any one explain me the class loading strategy inside the wildfly.

Summary
myCamelProject.war has spring jars and camel-wildfly also uses camel-spring and spring-framework jars which is configured as extension or a subsystem please let me know how should I make the war so that it works and doesn through below error we are migrating this application and deadlines are approaching ..any help would be great. for experts in class loading in widlfly it should be trivial thing to resolve.

Thanks in advance

I am deploying the war and getting below error

19:25:16,758 INFO [io.undertow.servlet](MSC service thread 1-1) Initializing Spring root WebApplicationContext
19:25:16,762 INFO [org.springframework.web.context.ContextLoader](MSC service thread 1-1) Root WebApplicationContext: initialization started
19:25:16,778 ERROR [org.springframework.web.context.ContextLoader](MSC service thread 1-1) Context initialization failed: java.lang.LinkageError: loader constraint violation: when resolving
overridden method "org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.getResourcePatternResolver()Lorg/springframework/core/io/support/ResourcePatternResolver;
" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/springframework/web/context/support/AbstractRefreshableWebApplicationContext, and its superclas
s loader (instance of org/jboss/modules/ModuleClassLoader), have different Class objects for the type ork.web.context.support.AbstractRefreshableWebApplicationContext.getResourcePatternResol
ver()Lorg/springframework/core/io/support/ResourcePatternResolver; used in the signature
at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_71]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585) [rt.jar:1.7.0_71]
at java.lang.Class.getConstructor0(Class.java:2885) [rt.jar:1.7.0_71]
at java.lang.Class.getDeclaredConstructor(Class.java:2058) [rt.jar:1.7.0_71]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104) [spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:360) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]

19:25:16,865 ERROR [org.jboss.msc.service.fail](MSC service thread 1-1) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host."/ECIC-0.0.1": org.jboss.msc
.service.StartException in service jboss.undertow.deployment.default-server.default-host."/ECIC-0.0.1": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.getResource
PatternResolver()Lorg/springframework/core/io/support/ResourcePatternResolver;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/springframework/w
eb/context/support/AbstractRefreshableWebApplicationContext, and its superclass loader (instance of org/jboss/modules/ModuleClassLoader), have different Class objects for the type ork.web.co
ntext.support.AbstractRefreshableWebApplicationContext.getResourcePatternResolver()Lorg/springframework/core/io/support/ResourcePatternResolver; used in the signature
at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_71]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585) [rt.jar:1.7.0_71]
at java.lang.Class.getConstructor0(Class.java:2885) [rt.jar:1.7.0_71]
at java.lang.Class.getDeclaredConstructor(Class.java:2058) [rt.jar:1.7.0_71]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:360)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more

19:25:17,189 ERROR [org.jboss.as.controller.management-operation](DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure descripti
on: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host."/ECIC-0.0.1"" => "org.jboss.msc.service.StartException in service jboss.un

@jamesnetherton
Copy link
Collaborator

What are you using spring-web for? Is it just being used to bootstrap your Camel context?

If so, this is not required. The Camel subsystem will do this automatically for you. Take a look at the documentation or my Introduction to the WildFly Camel subsystem article, as it explains how to configure a Camel context without spring-web.

Also, most Camel or Spring dependencies should be configured as scope 'provided' (I presume you're using Maven? Again, refer to my article for an example) as the Camel subsystem provides modules for these jars. Hence you don't them packaged with your WAR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants