Hi,

I have a basic doubt, Is it possible to run a CXF based application through
a standalone camel instance ?

I am mean using mvn camel:run. I tried creating a project, but maven says :
" Cannot resolve CXF:ENDPOINT "

This is my camel route:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";       
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd             
         http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>

  <import resource="classpath:META-INF/cxf/cxf.xml"/>
  

   
    
    <cxf:cxfEndpoint id="serviceEndpoint"
address="http://localhost:8080/camel-isova-usecase/EnrichmentEndpointService";
                wsdlURL="classpath:wsdl/Enricher.wsdl"
        
serviceClass="com.wipro.isova.usecase.enricher.EnrichmentEndpointImpl"
                endpointName="s:EnrichmentService"
                serviceName="s:EnrichmentEndpointService"
                xmlns:s="http://enricher.usecase.isova.wipro.com";>
     </cxf:cxfEndpoint>
        
        <bean id="customAggregationStrategy"
class="com.wipro.isova.usecase.CustomAggregationStrategy" />

        <bean id="transformerBean" 
class="com.wipro.isova.usecase.TransfromerBean"
/>

        <camelContext id="ISovaUsecase2"
xmlns="http://camel.apache.org/schema/spring";>
                <propertyPlaceholder id="properties" 
location="iSoVA_Usecase.properties"
/>
                <dataFormats>
                        <jaxb id="input" prettyPrint="true"
contextPath="com.wipro.isova.usecase.enricher"
                                
partClass="com.wipro.isova.usecase.enricher.InputObject" />

                        <jaxb id="output" prettyPrint="true"
contextPath="com.wipro.isova.usecase.enricher"
                                
partClass="com.wipro.isova.usecase.enricher.OutputObject" />
                </dataFormats>
                
                <route>
                        <from uri="{{src.xml.file.location}}"/>
                        <to uri="{{src.parentRoute.MQ.QUEUE}}" />
                </route>
                
                <route id="parentroute">
                        <from uri="{{src.parentRoute.MQ.QUEUE}}" />
                        <setHeader headerName="tradeSize">
                                <xpath  
resultType="java.lang.Integer">count(//Trade)</xpath>
                        </setHeader>
                        <log message="No of elements ************ 
${in.header.tradeSize}" />
                        <split parallelProcessing="true" streaming="true" 
timeout="0"
                                stopOnException="false">
                                <xpath>//Trade</xpath>
                                <to uri="{{parent.process.MQ.QUEUE}}" />
                        </split>
                </route>
                
                

                
                <route id="splittedTradesFromParentRoute">
                        <from uri="{{parent.process.MQ.QUEUE}}" />
                        <unmarshal ref="input" />
                        <to uri="cxf:bean:serviceEndpoint" />  
                        <to uri="bean:transformerBean?method=enrich" />
                        <setHeader headerName="correlationId">
                                <simple>TestId</simple>
                        </setHeader>
                        <to uri="{{consolidator.MQ.QUEUE}}" />
                </route>

                <route>
                        <from uri="{{consolidator.MQ.QUEUE}}" />
                        <log message="Sending ${body} with key 
${header.tradeSize}" />
                        <aggregate strategyRef="customAggregationStrategy">
                                <correlationExpression>
                                        <header>correlationId</header>
                                </correlationExpression>
                                <completionSize>
                                        <header>tradeSize</header>
                                </completionSize>
                                <log message="Sending out ${body}" />
                                <to uri="{{final.destination.queue}}" />
                        </aggregate>
                        
                </route>        
                
                <route>
                        <from uri="{{final.destination.queue}}"/>
                        <to uri="{{destination.xml.file.location}}" />
                </route>
        </camelContext>

THIS IS THE ERROR LOG:

\classes\META-INF\spring\camel-context.xml]
[ain.main()] MainSupport                    INFO  Apache Camel 2.10.2
stopping
*************************************
Error occurred while running main from: org.apache.camel.spring.Main
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:440)
        at java.lang.Thread.run(Thread.java:722)
Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
: Line 35 in XML document from file
[F:\OS-Middleware\apache-camel-2.10.2\exampl
es\camel-example-cxf\target\classes\META-INF\spring\camel-context.xml] is
invali
d; nested exception is org.xml.sax.SAXParseException; lineNumber: 35;
columnNumb
er: 58; The prefix "cxf" for element "cxf:cxfEndpoint" is not bound.
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:396)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:334)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:302)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
        at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:126)
        at
org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:92)
        at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at
org.springframework.context.support.AbstractApplicationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:467)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:397)
        at
org.springframework.context.support.ClassPathXmlApplicationContext./(ClassPathXmlApplicationContext.java:139)
        at
org.springframework.context.support.ClassPathXmlApplicationContext./(ClassPathXmlApplicationContext.java:93)
        at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.jav
a:186)
        at org.apache.camel.spring.Main.doStart(Main.java:140)
        at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)

        at org.apache.camel.main.MainSupport.run(MainSupport.java:141)
        at org.apache.camel.main.MainSupport.run(MainSupport.java:332)
        at org.apache.camel.spring.Main.main(Main.java:73)
        ... 6 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 58;
The
prefix "cxf" for element "cxf:cxfEndpoint" is not bound.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
Source)

        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
own Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocum
ent(DefaultDocumentLoader.java:75)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:388)
        ... 25 more
*************************************
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 13.274s
[INFO] Finished at: Tue Dec 18 23:42:04 IST 2012
[INFO] Final Memory: 18M/44M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.camel:camel-maven-plugin:2.10.2:run (d
efault-cli) on project camel-example-cxf: null: MojoExecutionException:
Invocati
onTargetException: Line 35 in XML document from file
[F:\OS-Middleware\apache-ca
mel-2.10.2\examples\camel-example-cxf\target\classes\META-INF\spring\camel-conte
xt.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumbe
r: 35; columnNumber: 58; The prefix "cxf" for element "cxf:cxfEndpoint" is
not b
ound. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
rea
d the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
[  Thread-3] MainSupport$HangupInterceptor  INFO  Received hang up -
stopping th
e main instance.

Please help

Regards
Guru



--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-resolve-CXF-endpoint-tp5724300.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to