You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by niteshjain <ni...@gmail.com> on 2014/12/17 08:45:16 UTC
SAXParseException -Cannot find the declaration of element 'beans'
Camel+cxf - Unable to parse the *camel_context.xml *when called from a java
code as below. i don't get any such error when i run in eclipse.
ApplicationContext ac = new ClassPathXmlApplicationContext("nite.xml");
CamelContext context = SpringCamelContext.springCamelContext(ac);
*camel_context.xml:*
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tool="http://www.springframework.org/schema/tool"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tool
http://www.springframework.org/schema/tool/spring-tool-2.5.xsd">
<bean id="testRoute"
class="com.hp.som.devicecapabilities.actions.TestRouter" />
</beans>
log:
2014-12-16 10:35:57,969 | INFO | ClassPathXmlApplicationContext | 128 -
org.apache.servicemix.bundles.spring-context - 3.2.8.RELEASE_1 | Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@302d6c6e:
startup date [Tue Dec 16 10:35:57 IST 2014]; root of context hierarchy
2014-12-16 10:35:57,969 | INFO | XmlBeanDefinitionReader | 131 -
org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Loading XML
bean definitions from class path resource [camel_context.xml]
2014-12-16 10:36:24,310 | WARN | XmlBeanDefinitionReader | 131 -
org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Ignored XML
validation warning
Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the
declaration of element 'beans'.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)[:]
at org.apache.xerces.util.ErrorHandlerWrapper.error(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.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)[:]
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)[:]
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)[:]
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)[:]
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)[:]
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
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.loadDocument(DefaultDocumentLoader.java:75)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
When I deploy it in OSGI Container I get
Org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of
element 'beans'.
Whereas it worked in Jboss IDE
On 1:32PM, Wed, 17 Dec 2014 Grzegorz Grzybek [via Camel] <
ml-node+s465427n5760810h26@n5.nabble.com> wrote:
> Hi
>
> Are you sure you're not running inside OSGi environment? (hint:
> org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1)
> See this thread then:
> https://developer.jboss.org/thread/245670?start=0&tstart=0
>
> regards
> Grzegorz Grzybek
>
> 2014-12-17 8:45 GMT+01:00 niteshjain <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5760810&i=0>>:
>
> >
> > Camel+cxf - Unable to parse the *camel_context.xml *when called from a
> java
> > code as below. i don't get any such error when i run in eclipse.
> >
> >
> > ApplicationContext ac = new ClassPathXmlApplicationContext("nite.xml");
> >
> > CamelContext context = SpringCamelContext.springCamelContext(ac);
> >
> > *camel_context.xml:*
> >
> > <beans xmlns="http://www.springframework.org/schema/beans"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:tool="http://www.springframework.org/schema/tool"
> > xsi:schemaLocation="http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> > http://www.springframework.org/schema/tool
> > http://www.springframework.org/schema/tool/spring-tool-2.5.xsd">
> > <bean id="testRoute"
> > class="com.hp.som.devicecapabilities.actions.TestRouter" />
> > </beans>
> >
> >
> > log:
> >
> > 2014-12-16 10:35:57,969 | INFO | ClassPathXmlApplicationContext | 128
> -
> > org.apache.servicemix.bundles.spring-context - 3.2.8.RELEASE_1 |
> Refreshing
> >
> org.springframework.context.support.ClassPathXmlApplicationContext@302d6c6e
> > :
> > startup date [Tue Dec 16 10:35:57 IST 2014]; root of context hierarchy
> >
> > 2014-12-16 10:35:57,969 | INFO | XmlBeanDefinitionReader | 131
> -
> > org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Loading
> XML
> > bean definitions from class path resource [camel_context.xml]
> >
> > 2014-12-16 10:36:24,310 | WARN | XmlBeanDefinitionReader | 131
> -
> > org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Ignored
> XML
> > validation warning
> >
> > Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the
> > declaration of element 'beans'.
> > at
> >
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> > Source)[:]
> > at org.apache.xerces.util.ErrorHandlerWrapper.error(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.xs.XMLSchemaValidator.handleStartElement(Unknown
> > Source)[:]
> > at
> > org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> > Source)[:]
> > at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> > Source)[:]
> > at
> >
> >
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
>
> > Source)[:]
> > at
> >
> >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>
> > Source)[:]
> > at
> >
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > 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.loadDocument(DefaultDocumentLoader.java:75)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
>
> > at
> >
> >
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
>
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809.html
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760810.html
> To unsubscribe from SAXParseException -Cannot find the declaration of
> element 'beans', click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5760809&code=bml0ZXNoamFpbjEzMkBnbWFpbC5jb218NTc2MDgwOXwxNTcxMDAyOTM2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760942.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Thanks alot Grzegorz!
You are Best :)
On 5:59PM, Fri, 19 Dec 2014 Grzegorz Grzybek [via Camel] <
ml-node+s465427n5760917h43@n5.nabble.com> wrote:
> Hello
>
> Here are the changes needed to fix your example:
>
> https://github.com/grgrzybek/CamelSpring/commit/cc44939a5e5daaa58ce91cdeac5644ffa3260bcc
> It produces:
>
> Dec 19, 2014 1:26:44 PM [com.main.TestRouter] process
> INFO: -----TestRouter Called----------
> Dec 19, 2014 1:26:44 PM [com.main.TestRouter] process
> INFO: Messgae :: Hello
>
> on the console
>
> regards
> Grzegorz Grzybek
>
> 2014-12-19 11:29 GMT+01:00 niteshjain <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5760917&i=0>>:
>
> >
> > Sure,
> > here it is https://github.com/niteshjain132/CamelSpring
> >
> > created a simple project with a main class Test.
> >
> > Thanks,
> > Nitesh
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760913.html
>
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760917.html
> To unsubscribe from SAXParseException -Cannot find the declaration of
> element 'beans', click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5760809&code=bml0ZXNoamFpbjEzMkBnbWFpbC5jb218NTc2MDgwOXwxNTcxMDAyOTM2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760941.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
No problem.
Thank you :)
Regards,
Nitesh
On 5:09PM, Sat, 20 Dec 2014 Grzegorz Grzybek [via Camel] <
ml-node+s465427n5760949h35@n5.nabble.com> wrote:
> Hi
>
> I'll be able to check the details after Christmas holidays, but now, try
> copy those
> (
> https://github.com/spring-projects/spring-framework/tree/master/spring-beans/src/main/resources/META-INF)
>
> resources) into your META-INF
> (
> https://github.com/niteshjain132/CamelSpring-WS/tree/master/src/main/resources/META-INF)
>
>
> here are quick findings in google
>
> http://stackoverflow.com/questions/10162853/spring-unable-to-locate-osgi-namespace-handler
> https://community.oracle.com/message/10043469#10043469
>
> regards
> Grzegorz
>
> > Thank you :)
> >
> > can you please look at this
> https://github.com/niteshjain132/CamelSpring-WS
> >
> > i get XmlParseException when i invoke via webservice (deployed it in
> Jboss
> > Fuse Server)
> >
> > Regards,
> > Nitesh
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760945.html
>
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760949.html
> To unsubscribe from SAXParseException -Cannot find the declaration of
> element 'beans', click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5760809&code=bml0ZXNoamFpbjEzMkBnbWFpbC5jb218NTc2MDgwOXwxNTcxMDAyOTM2>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760954.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element 'beans'
Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hi
I'll be able to check the details after Christmas holidays, but now, try
copy those
(https://github.com/spring-projects/spring-framework/tree/master/spring-beans/src/main/resources/META-INF)
resources) into your META-INF
(https://github.com/niteshjain132/CamelSpring-WS/tree/master/src/main/resources/META-INF)
here are quick findings in google
http://stackoverflow.com/questions/10162853/spring-unable-to-locate-osgi-namespace-handler
https://community.oracle.com/message/10043469#10043469
regards
Grzegorz
> Thank you :)
>
> can you please look at this https://github.com/niteshjain132/CamelSpring-WS
>
> i get XmlParseException when i invoke via webservice (deployed it in Jboss
> Fuse Server)
>
> Regards,
> Nitesh
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760945.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Thank you :)
can you please look at this https://github.com/niteshjain132/CamelSpring-WS
i get XmlParseException when i invoke via webservice (deployed it in Jboss
Fuse Server)
Regards,
Nitesh
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760945.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element 'beans'
Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hello
Here are the changes needed to fix your example:
https://github.com/grgrzybek/CamelSpring/commit/cc44939a5e5daaa58ce91cdeac5644ffa3260bcc
It produces:
Dec 19, 2014 1:26:44 PM [com.main.TestRouter] process
INFO: -----TestRouter Called----------
Dec 19, 2014 1:26:44 PM [com.main.TestRouter] process
INFO: Messgae :: Hello
on the console
regards
Grzegorz Grzybek
2014-12-19 11:29 GMT+01:00 niteshjain <ni...@gmail.com>:
>
> Sure,
> here it is https://github.com/niteshjain132/CamelSpring
>
> created a simple project with a main class Test.
>
> Thanks,
> Nitesh
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760913.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Sure,
here it is https://github.com/niteshjain132/CamelSpring
created a simple project with a main class Test.
Thanks,
Nitesh
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760913.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element 'beans'
Posted by Grzegorz Grzybek <gr...@gmail.com>.
Could you share your testcase/project? via github maybe?
regards
Grzegorz Grzybek
2014-12-19 8:33 GMT+01:00 niteshjain <ni...@gmail.com>:
>
> Do i need to add something in pom.xml ?
>
> *Pom.xml*
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.test</groupId>
> <artifactId>CamelSpringTest</artifactId>
> <version>1.0</version>
>
> <properties>
> <log4j.version>1.2.17</log4j.version>
> <camel-version>2.12.0</camel-version>
> <cxf-version>2.7.0</cxf-version>
> </properties>
>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.4</version>
> </dependency>
> <dependency>
> <groupId>log4j</groupId>
> <artifactId>log4j</artifactId>
> <version>${log4j.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-core</artifactId>
> <version>${camel-version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-spring</artifactId>
> <version>2.7.0</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-cxf</artifactId>
> <version>${camel-version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-frontend-jaxws</artifactId>
> <version>${cxf-version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-transports-http</artifactId>
> <version>${cxf-version}</version>
> </dependency>
> </dependencies>
>
> <packaging>bundle</packaging>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.felix</groupId>
>
> <artifactId>maven-bundle-plugin</artifactId>
> <version>2.3.7</version>
> <extensions>true</extensions>
> <configuration>
> <instructions>
> </instructions>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </project>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760906.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Do i need to add something in pom.xml ?
*Pom.xml*
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>CamelSpringTest</artifactId>
<version>1.0</version>
<properties>
<log4j.version>1.2.17</log4j.version>
<camel-version>2.12.0</camel-version>
<cxf-version>2.7.0</cxf-version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf-version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf-version}</version>
</dependency>
</dependencies>
<packaging>bundle</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760906.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Thank you for your reply.,
i modified the came_context.xml as below :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
<b>http://www.springframework.org/schema/beans/spring-beans.xsd*
http://camel.apache.org/schema/spring
*http://camel.apache.org/schema/spring/camel-spring.xsd*">
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring" />
</beans>
but still the same ERROR
*SAXParseException *-Cannot find the declaration of element '*beans*'
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760905.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element 'beans'
Posted by Christian Müller <ch...@gmail.com>.
You should not use the schema location
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd or
http://www.springframework.org/schema/tool/spring-tool-2.5.xsd if you are
using Spring 3.2...
Best,
Christian
On Wed, Dec 17, 2014 at 11:58 AM, niteshjain <ni...@gmail.com>
wrote:
>
> Thanks,
>
> yes it is OSGI Environment.
> Runtime: ServiceMix 4.5
>
> https://developer.jboss.org/thread/245670?start=0&tstart=0 ,did not help
> me.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760821.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
Re: SAXParseException -Cannot find the declaration of element
'beans'
Posted by niteshjain <ni...@gmail.com>.
Thanks,
yes it is OSGI Environment.
Runtime: ServiceMix 4.5
https://developer.jboss.org/thread/245670?start=0&tstart=0 ,did not help me.
--
View this message in context: http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809p5760821.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: SAXParseException -Cannot find the declaration of element 'beans'
Posted by Grzegorz Grzybek <gr...@gmail.com>.
Hi
Are you sure you're not running inside OSGi environment? (hint:
org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1)
See this thread then:
https://developer.jboss.org/thread/245670?start=0&tstart=0
regards
Grzegorz Grzybek
2014-12-17 8:45 GMT+01:00 niteshjain <ni...@gmail.com>:
>
> Camel+cxf - Unable to parse the *camel_context.xml *when called from a java
> code as below. i don't get any such error when i run in eclipse.
>
>
> ApplicationContext ac = new ClassPathXmlApplicationContext("nite.xml");
>
> CamelContext context = SpringCamelContext.springCamelContext(ac);
>
> *camel_context.xml:*
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:tool="http://www.springframework.org/schema/tool"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> http://www.springframework.org/schema/tool
> http://www.springframework.org/schema/tool/spring-tool-2.5.xsd">
> <bean id="testRoute"
> class="com.hp.som.devicecapabilities.actions.TestRouter" />
> </beans>
>
>
> log:
>
> 2014-12-16 10:35:57,969 | INFO | ClassPathXmlApplicationContext | 128 -
> org.apache.servicemix.bundles.spring-context - 3.2.8.RELEASE_1 | Refreshing
> org.springframework.context.support.ClassPathXmlApplicationContext@302d6c6e
> :
> startup date [Tue Dec 16 10:35:57 IST 2014]; root of context hierarchy
>
> 2014-12-16 10:35:57,969 | INFO | XmlBeanDefinitionReader | 131 -
> org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Loading XML
> bean definitions from class path resource [camel_context.xml]
>
> 2014-12-16 10:36:24,310 | WARN | XmlBeanDefinitionReader | 131 -
> org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Ignored XML
> validation warning
>
> Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the
> declaration of element 'beans'.
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)[:]
> at org.apache.xerces.util.ErrorHandlerWrapper.error(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.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)[:]
> at
>
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)[:]
> at
>
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> 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.loadDocument(DefaultDocumentLoader.java:75)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SAXParseException-Cannot-find-the-declaration-of-element-beans-tp5760809.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>