You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ian de Beer <ia...@zenaptix.com> on 2009/11/17 12:09:44 UTC

The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Hi 
Ever since I have started using the 2.1-SNAPSHOT, I get the attached
exception. The same code worked fine with 2.0.0 and it still works fine when
I compile and run in Intellij IDE. However when I create a "fat-jar" with
mvn assembly:assembly and run from a terminal, it fails. I have no option ,
but to use the latest SNAPSHOT as it includes RSS component fixes - very
frustrating.

The camel-context.xml reads:
<?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     
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">

  <camel:camelContext id="camel">
    <camel:routeBuilder ref="routeBuilder"/>
  </camel:camelContext>
  
  <bean name="routeBuilder"
class="com.zenaptix.contentServer.ContentManagerRouteBuilder">
  ...
  </bean>
...
<beans>

Exception in thread "main"
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://camel.apache.org/schema/spring]
Offending resource: class path resource [META-INF/spring/camel-context.xml]

	at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
	at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
	at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
	at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
	at com.zenaptix.contentServer.Launcher.start(Launcher.java:53)
	at com.zenaptix.contentServer.Launcher.main(Launcher.java:107)

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p26388081.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by wpeirone <wp...@gmail.com>.
Hi Claus,

Related with this, I´m having same problem with spring.handlers and
spring.schemas. I´m using org.apache.camel.spring;version="2.8.0.fuse-07-16"
on equinox from eclipse.

in xml I´m using xmlns:camel="http://camel.apache.org/schema/spring"
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd 
I tried with trailing  "-v2.0.xsd" and "-2.8.xsd" but didn´t works.

If I copy both files (spring.handlers and spring.schemas) to META-INF of my
bundle, it works. But, without files copied doesn´t works (I think it must
be read from imported packages in the manifest). My bundle is what you
mentioned like fat jar ? It's ok to copy the files ? 



Other question, I just adapted the camel-example-spring-ws but as mentioned
used from osgi. When in the route invoque    "from("spring-ws:rootqname:
..."   it gives me "Failed to resolve endpoint" unless explicitly declare 
<bean id="spring-ws"
class="org.apache.camel.component.spring.ws.SpringWebserviceComponent"/>
is that right ? 

thank you in advance.
Walter




--
View this message in context: http://camel.465427.n5.nabble.com/The-dreaded-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp477346p5733363.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Nov 17, 2009 at 1:50 PM, Ian de Beer <ia...@zenaptix.com> wrote:
>
> Hi Claus
> I have tried with "http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd", but the
> problem persists.
> The puzzling part is that it works when the full classpath is specified
> (referencing the jars in the maven repo). Obviously the fat jar, containing
> all dependencies, is the only jar on the classpath and then it fails.  The
> jar does contain the  CamelNamespaceHandler.class.
> Regards
> Ian
>

Ah you need to copy the spring namespace files in the fat jar.

In camel-spring there are some files in META-INF somewhere that has
the mapping from those XSDs.



>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> You can change to use a fixed 2.0.0 version of the XSD
>>
>>          http://camel.apache.org/schema/spring
>> http://camel.apache.org/schema/spring/camel-spring.xsd">
>>
>> Should be
>>
>>          http://camel.apache.org/schema/spring
>> http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p26389361.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Maciej Prochniak <mp...@touk.pl>.
just a guess - but does fat jar contain needed descriptors in META-INF
i.e. META-INF/spring.handlers
and META-INF/spring.schemas?

br, maciek

On Tue, 2009-11-17 at 04:50 -0800, Ian de Beer wrote:
> Hi Claus
> I have tried with "http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd", but the
> problem persists.
> The puzzling part is that it works when the full classpath is specified
> (referencing the jars in the maven repo). Obviously the fat jar, containing
> all dependencies, is the only jar on the classpath and then it fails.  The
> jar does contain the  CamelNamespaceHandler.class. 
> Regards
> Ian
> 
> 
> Claus Ibsen-2 wrote:
> > 
> > Hi
> > 
> > You can change to use a fixed 2.0.0 version of the XSD
> > 
> >          http://camel.apache.org/schema/spring
> > http://camel.apache.org/schema/spring/camel-spring.xsd">
> > 
> > Should be
> > 
> >          http://camel.apache.org/schema/spring
> > http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">
> > 
> > 
> > 
> 


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Ian de Beer <ia...@zenaptix.com>.
Hi Claus
I have tried with "http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd", but the
problem persists.
The puzzling part is that it works when the full classpath is specified
(referencing the jars in the maven repo). Obviously the fat jar, containing
all dependencies, is the only jar on the classpath and then it fails.  The
jar does contain the  CamelNamespaceHandler.class. 
Regards
Ian


Claus Ibsen-2 wrote:
> 
> Hi
> 
> You can change to use a fixed 2.0.0 version of the XSD
> 
>          http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
> 
> Should be
> 
>          http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p26389361.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can change to use a fixed 2.0.0 version of the XSD

         http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">

Should be

         http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">


On Tue, Nov 17, 2009 at 12:09 PM, Ian de Beer <ia...@zenaptix.com> wrote:
>
> Hi
> Ever since I have started using the 2.1-SNAPSHOT, I get the attached
> exception. The same code worked fine with 2.0.0 and it still works fine when
> I compile and run in Intellij IDE. However when I create a "fat-jar" with
> mvn assembly:assembly and run from a terminal, it fails. I have no option ,
> but to use the latest SNAPSHOT as it includes RSS component fixes - very
> frustrating.
>
> The camel-context.xml reads:
> <?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
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>          http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>  <camel:camelContext id="camel">
>    <camel:routeBuilder ref="routeBuilder"/>
>  </camel:camelContext>
>
>  <bean name="routeBuilder"
> class="com.zenaptix.contentServer.ContentManagerRouteBuilder">
>  ...
>  </bean>
> ...
> <beans>
>
> Exception in thread "main"
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> schema namespace [http://camel.apache.org/schema/spring]
> Offending resource: class path resource [META-INF/spring/camel-context.xml]
>
>        at
> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
>        at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
>        at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
>        at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
>        at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
>        at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
>        at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
>        at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
>        at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
>        at com.zenaptix.contentServer.Launcher.start(Launcher.java:53)
>        at com.zenaptix.contentServer.Launcher.main(Launcher.java:107)
>
> --
> View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p26388081.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by kostabanderas <ko...@gmail.com>.
Ah, mr. Ibsen, thanks for the reply.

I'm sure there are numerous ways to achieve this goal. The assembly plugin
sounded like the quickest (and maybe the dirtiest, since I wanted to pack up
all the dependency jars for this test project). Maybe the problem I had was
more suited for the assembly plugin group but what confused me the most and
what I think should be the main topic here is the existence of
spring.schemas and spring.handlers files in the META-INF folder. Right now,
with the solution I've applied, those two files don't even exist in the
META-INF folder and everything works. When using the assembly plugin, these
two files are auto generated but include some schemas/namespaces that I
haven't specifically added anywhere. When I provide these two files myself
(in the META-INF folder), these two files get overwritten.
Again, I'm new to these concepts and it's quite possible that I haven't
configured the plugin properly, but, again, I'm wondering now how does
everything work without the two files mentioned above?

Thanks and cheers,
Kosta


Claus Ibsen-2 wrote:
> 
> On Thu, Mar 18, 2010 at 12:33 PM, kostabanderas <ko...@gmail.com>
> wrote:
>>
>> Had no luck with assembly plugin. I tried the shade plugin but gave up on
>> it
>> after adding a number of dependencies and still getting runtime errors
>> for
>> the missing classes. In the end, I used the combination of jar plugin to
>> build my jar and manifest file and dependency plugin to copy required
>> dependencies to an appropriate location so I could start the app with
>> java
>> -jar.
>>
>> Thanks, cheers and keep up the good work,
>> Kosta
>>
> 
> Maybe an ANT task can do the assembly the way you like.
> 
> 
> 
>>
>> kostabanderas wrote:
>>>
>>> Thanks for the reply.
>>>
>>> I did create the spring.schemas, spring.handlers files but I believe
>>> that
>>> the assembly plugin overwrites them. When I change the names of the
>>> files
>>> they appear regularly in the generated META-INF folder but when I name
>>> them properly, they get overwriten...
>>>
>>> I took a look at the file you've suggested. Basically, you're suggesting
>>> I
>>> should drop the assembly plugin and use the shade plugin instead? I'll
>>> give it a try and let you know how it turned out.
>>>
>>> Thanks,
>>> Kosta
>>>
>>>
>>> willem.jiang wrote:
>>>>
>>>> Hi,
>>>>
>>>> You can take a look at this pom.xml[1]. If you go through the
>>>> camel-spring-osgi module, you will find most of thing that you want to
>>>> know.
>>>>
>>>> You need to create spring.schemas, spring.handlers file yourself, to
>>>> includes the schemas and handlers those you wrap into a big jar.
>>>>
>>>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/pom.xml
>>>>
>>>>
>>>> Willem
>>>>
>>>>
>>>> kostabanderas wrote:
>>>>> Hi all,
>>>>>
>>>>> For my first post here, first of all, big respect to all developers
>>>>> working
>>>>> on Camel projects.
>>>>>
>>>>> I'm having the same problem but I can't seem to deal with it in the
>>>>> way
>>>>> described above. It is the same handler that is stated missing.
>>>>>
>>>>> I'm also using maven and assembly plugin. I checked the "fat jar"
>>>>> created by
>>>>> this plugin and it does have
>>>>> (spring.schemas and spring.handlers) files in the META-INF dir
>>>>> (without
>>>>> my
>>>>> intervention) but they don't declare this specific schema/handler. I
>>>>> tried
>>>>> modifying the assembly descriptor but it didn't work out. I'm
>>>>> completely
>>>>> new
>>>>> to these concepts so there's a big chance that I'm doing something
>>>>> wrong
>>>>> but
>>>>> what confuses me are those existing (spring.schemas and
>>>>> spring.handlers)
>>>>> files. I tried adding spring-integration jar to my classpath and those
>>>>> schema/handler got inserted in the two files above but this one is
>>>>> still
>>>>> causing me problems and I can't seem to start my app with the java
>>>>> -jar
>>>>> command.
>>>>> Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the
>>>>> root of
>>>>> the "fat jar".
>>>>>
>>>>> I checked my classpath and the pom file contains everything I believe
>>>>> is
>>>>> needed. More specific, it does contain camel-spring (2.2.0) jar which
>>>>> I
>>>>> believe holds this handler.
>>>>>
>>>>> I'm using java 1.6.0_17. and Camel 2.2.0.
>>>>>
>>>>> Thanks and please let me know if there's anything more I can provide
>>>>> to
>>>>> help
>>>>> you help me solve this problem :)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Ian de Beer wrote:
>>>>>> Hi
>>>>>> Thanks to all - it works with the two files (spring.schemas and
>>>>>> spring.handlers) added to my META-INF
>>>>>> Regards
>>>>>> Ian
>>>>>>
>>>>>>
>>>>>> willem.jiang wrote:
>>>>>>> Can you check your "fat-jar" if it contains the file
>>>>>>> /META-INF/spring.handles and /META-INF/spring.schemas like these
>>>>>>> files
>>>>>>> [1]
>>>>>>>
>>>>>>> If not , you need to update your assembly plugin is configuration to
>>>>>>> contain upper files.
>>>>>>>
>>>>>>> [1]
>>>>>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>>>>>>>
>>>>>>> Willem
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27944334.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27945883.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Mar 18, 2010 at 12:33 PM, kostabanderas <ko...@gmail.com> wrote:
>
> Had no luck with assembly plugin. I tried the shade plugin but gave up on it
> after adding a number of dependencies and still getting runtime errors for
> the missing classes. In the end, I used the combination of jar plugin to
> build my jar and manifest file and dependency plugin to copy required
> dependencies to an appropriate location so I could start the app with java
> -jar.
>
> Thanks, cheers and keep up the good work,
> Kosta
>

Maybe an ANT task can do the assembly the way you like.



>
> kostabanderas wrote:
>>
>> Thanks for the reply.
>>
>> I did create the spring.schemas, spring.handlers files but I believe that
>> the assembly plugin overwrites them. When I change the names of the files
>> they appear regularly in the generated META-INF folder but when I name
>> them properly, they get overwriten...
>>
>> I took a look at the file you've suggested. Basically, you're suggesting I
>> should drop the assembly plugin and use the shade plugin instead? I'll
>> give it a try and let you know how it turned out.
>>
>> Thanks,
>> Kosta
>>
>>
>> willem.jiang wrote:
>>>
>>> Hi,
>>>
>>> You can take a look at this pom.xml[1]. If you go through the
>>> camel-spring-osgi module, you will find most of thing that you want to
>>> know.
>>>
>>> You need to create spring.schemas, spring.handlers file yourself, to
>>> includes the schemas and handlers those you wrap into a big jar.
>>>
>>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/pom.xml
>>>
>>>
>>> Willem
>>>
>>>
>>> kostabanderas wrote:
>>>> Hi all,
>>>>
>>>> For my first post here, first of all, big respect to all developers
>>>> working
>>>> on Camel projects.
>>>>
>>>> I'm having the same problem but I can't seem to deal with it in the way
>>>> described above. It is the same handler that is stated missing.
>>>>
>>>> I'm also using maven and assembly plugin. I checked the "fat jar"
>>>> created by
>>>> this plugin and it does have
>>>> (spring.schemas and spring.handlers) files in the META-INF dir (without
>>>> my
>>>> intervention) but they don't declare this specific schema/handler. I
>>>> tried
>>>> modifying the assembly descriptor but it didn't work out. I'm completely
>>>> new
>>>> to these concepts so there's a big chance that I'm doing something wrong
>>>> but
>>>> what confuses me are those existing (spring.schemas and spring.handlers)
>>>> files. I tried adding spring-integration jar to my classpath and those
>>>> schema/handler got inserted in the two files above but this one is still
>>>> causing me problems and I can't seem to start my app with the java -jar
>>>> command.
>>>> Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the
>>>> root of
>>>> the "fat jar".
>>>>
>>>> I checked my classpath and the pom file contains everything I believe is
>>>> needed. More specific, it does contain camel-spring (2.2.0) jar which I
>>>> believe holds this handler.
>>>>
>>>> I'm using java 1.6.0_17. and Camel 2.2.0.
>>>>
>>>> Thanks and please let me know if there's anything more I can provide to
>>>> help
>>>> you help me solve this problem :)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Ian de Beer wrote:
>>>>> Hi
>>>>> Thanks to all - it works with the two files (spring.schemas and
>>>>> spring.handlers) added to my META-INF
>>>>> Regards
>>>>> Ian
>>>>>
>>>>>
>>>>> willem.jiang wrote:
>>>>>> Can you check your "fat-jar" if it contains the file
>>>>>> /META-INF/spring.handles and /META-INF/spring.schemas like these files
>>>>>> [1]
>>>>>>
>>>>>> If not , you need to update your assembly plugin is configuration to
>>>>>> contain upper files.
>>>>>>
>>>>>> [1]
>>>>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>>>>>>
>>>>>> Willem
>>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27944334.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by kostabanderas <ko...@gmail.com>.
Had no luck with assembly plugin. I tried the shade plugin but gave up on it
after adding a number of dependencies and still getting runtime errors for
the missing classes. In the end, I used the combination of jar plugin to
build my jar and manifest file and dependency plugin to copy required
dependencies to an appropriate location so I could start the app with java
-jar.

Thanks, cheers and keep up the good work,
Kosta


kostabanderas wrote:
> 
> Thanks for the reply.
> 
> I did create the spring.schemas, spring.handlers files but I believe that
> the assembly plugin overwrites them. When I change the names of the files
> they appear regularly in the generated META-INF folder but when I name
> them properly, they get overwriten...
> 
> I took a look at the file you've suggested. Basically, you're suggesting I
> should drop the assembly plugin and use the shade plugin instead? I'll
> give it a try and let you know how it turned out.
> 
> Thanks,
> Kosta
> 
> 
> willem.jiang wrote:
>> 
>> Hi,
>> 
>> You can take a look at this pom.xml[1]. If you go through the 
>> camel-spring-osgi module, you will find most of thing that you want to
>> know.
>> 
>> You need to create spring.schemas, spring.handlers file yourself, to 
>> includes the schemas and handlers those you wrap into a big jar.
>> 
>> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/pom.xml
>> 
>> 
>> Willem
>> 
>> 
>> kostabanderas wrote:
>>> Hi all,
>>> 
>>> For my first post here, first of all, big respect to all developers
>>> working
>>> on Camel projects.
>>> 
>>> I'm having the same problem but I can't seem to deal with it in the way
>>> described above. It is the same handler that is stated missing.
>>> 
>>> I'm also using maven and assembly plugin. I checked the "fat jar"
>>> created by
>>> this plugin and it does have
>>> (spring.schemas and spring.handlers) files in the META-INF dir (without
>>> my
>>> intervention) but they don't declare this specific schema/handler. I
>>> tried
>>> modifying the assembly descriptor but it didn't work out. I'm completely
>>> new
>>> to these concepts so there's a big chance that I'm doing something wrong
>>> but
>>> what confuses me are those existing (spring.schemas and spring.handlers) 
>>> files. I tried adding spring-integration jar to my classpath and those
>>> schema/handler got inserted in the two files above but this one is still
>>> causing me problems and I can't seem to start my app with the java -jar
>>> command.
>>> Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the
>>> root of
>>> the "fat jar". 
>>> 
>>> I checked my classpath and the pom file contains everything I believe is
>>> needed. More specific, it does contain camel-spring (2.2.0) jar which I
>>> believe holds this handler.
>>> 
>>> I'm using java 1.6.0_17. and Camel 2.2.0.
>>> 
>>> Thanks and please let me know if there's anything more I can provide to
>>> help
>>> you help me solve this problem :)
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Ian de Beer wrote:
>>>> Hi
>>>> Thanks to all - it works with the two files (spring.schemas and
>>>> spring.handlers) added to my META-INF
>>>> Regards
>>>> Ian
>>>>
>>>>
>>>> willem.jiang wrote:
>>>>> Can you check your "fat-jar" if it contains the file 
>>>>> /META-INF/spring.handles and /META-INF/spring.schemas like these files
>>>>> [1]
>>>>>
>>>>> If not , you need to update your assembly plugin is configuration to 
>>>>> contain upper files.
>>>>>
>>>>> [1] 
>>>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>>>>>
>>>>> Willem
>>>>>
>>>>
>>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27944334.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by kostabanderas <ko...@gmail.com>.
Thanks for the reply.

I did create the spring.schemas, spring.handlers files but I believe that
the assembly plugin overwrites them. When I change the names of the files
they appear regularly in the generated META-INF folder but when I name them
properly, they get overwriten...

I took a look at the file you've suggested. Basically, you're suggesting I
should drop the assembly plugin and use the shade plugin instead? I'll give
it a try and let you know how it turned out.

Thanks,
Kosta


willem.jiang wrote:
> 
> Hi,
> 
> You can take a look at this pom.xml[1]. If you go through the 
> camel-spring-osgi module, you will find most of thing that you want to
> know.
> 
> You need to create spring.schemas, spring.handlers file yourself, to 
> includes the schemas and handlers those you wrap into a big jar.
> 
> [1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/pom.xml
> 
> 
> Willem
> 
> 
> kostabanderas wrote:
>> Hi all,
>> 
>> For my first post here, first of all, big respect to all developers
>> working
>> on Camel projects.
>> 
>> I'm having the same problem but I can't seem to deal with it in the way
>> described above. It is the same handler that is stated missing.
>> 
>> I'm also using maven and assembly plugin. I checked the "fat jar" created
>> by
>> this plugin and it does have
>> (spring.schemas and spring.handlers) files in the META-INF dir (without
>> my
>> intervention) but they don't declare this specific schema/handler. I
>> tried
>> modifying the assembly descriptor but it didn't work out. I'm completely
>> new
>> to these concepts so there's a big chance that I'm doing something wrong
>> but
>> what confuses me are those existing (spring.schemas and spring.handlers) 
>> files. I tried adding spring-integration jar to my classpath and those
>> schema/handler got inserted in the two files above but this one is still
>> causing me problems and I can't seem to start my app with the java -jar
>> command.
>> Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the root
>> of
>> the "fat jar". 
>> 
>> I checked my classpath and the pom file contains everything I believe is
>> needed. More specific, it does contain camel-spring (2.2.0) jar which I
>> believe holds this handler.
>> 
>> I'm using java 1.6.0_17. and Camel 2.2.0.
>> 
>> Thanks and please let me know if there's anything more I can provide to
>> help
>> you help me solve this problem :)
>> 
>> 
>> 
>> 
>> 
>> 
>> Ian de Beer wrote:
>>> Hi
>>> Thanks to all - it works with the two files (spring.schemas and
>>> spring.handlers) added to my META-INF
>>> Regards
>>> Ian
>>>
>>>
>>> willem.jiang wrote:
>>>> Can you check your "fat-jar" if it contains the file 
>>>> /META-INF/spring.handles and /META-INF/spring.schemas like these files
>>>> [1]
>>>>
>>>> If not , you need to update your assembly plugin is configuration to 
>>>> contain upper files.
>>>>
>>>> [1] 
>>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>>>>
>>>> Willem
>>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27918471.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can take a look at this pom.xml[1]. If you go through the 
camel-spring-osgi module, you will find most of thing that you want to know.

You need to create spring.schemas, spring.handlers file yourself, to 
includes the schemas and handlers those you wrap into a big jar.

[1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/pom.xml


Willem


kostabanderas wrote:
> Hi all,
> 
> For my first post here, first of all, big respect to all developers working
> on Camel projects.
> 
> I'm having the same problem but I can't seem to deal with it in the way
> described above. It is the same handler that is stated missing.
> 
> I'm also using maven and assembly plugin. I checked the "fat jar" created by
> this plugin and it does have
> (spring.schemas and spring.handlers) files in the META-INF dir (without my
> intervention) but they don't declare this specific schema/handler. I tried
> modifying the assembly descriptor but it didn't work out. I'm completely new
> to these concepts so there's a big chance that I'm doing something wrong but
> what confuses me are those existing (spring.schemas and spring.handlers) 
> files. I tried adding spring-integration jar to my classpath and those
> schema/handler got inserted in the two files above but this one is still
> causing me problems and I can't seem to start my app with the java -jar
> command.
> Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the root of
> the "fat jar". 
> 
> I checked my classpath and the pom file contains everything I believe is
> needed. More specific, it does contain camel-spring (2.2.0) jar which I
> believe holds this handler.
> 
> I'm using java 1.6.0_17. and Camel 2.2.0.
> 
> Thanks and please let me know if there's anything more I can provide to help
> you help me solve this problem :)
> 
> 
> 
> 
> 
> 
> Ian de Beer wrote:
>> Hi
>> Thanks to all - it works with the two files (spring.schemas and
>> spring.handlers) added to my META-INF
>> Regards
>> Ian
>>
>>
>> willem.jiang wrote:
>>> Can you check your "fat-jar" if it contains the file 
>>> /META-INF/spring.handles and /META-INF/spring.schemas like these files
>>> [1]
>>>
>>> If not , you need to update your assembly plugin is configuration to 
>>> contain upper files.
>>>
>>> [1] 
>>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>>>
>>> Willem
>>>
>>
> 


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by kostabanderas <ko...@gmail.com>.
Hi all,

For my first post here, first of all, big respect to all developers working
on Camel projects.

I'm having the same problem but I can't seem to deal with it in the way
described above. It is the same handler that is stated missing.

I'm also using maven and assembly plugin. I checked the "fat jar" created by
this plugin and it does have
(spring.schemas and spring.handlers) files in the META-INF dir (without my
intervention) but they don't declare this specific schema/handler. I tried
modifying the assembly descriptor but it didn't work out. I'm completely new
to these concepts so there's a big chance that I'm doing something wrong but
what confuses me are those existing (spring.schemas and spring.handlers) 
files. I tried adding spring-integration jar to my classpath and those
schema/handler got inserted in the two files above but this one is still
causing me problems and I can't seem to start my app with the java -jar
command.
Furthermore, camel-spring-v2.2.xsd and camel-spring.xsd exist in the root of
the "fat jar". 

I checked my classpath and the pom file contains everything I believe is
needed. More specific, it does contain camel-spring (2.2.0) jar which I
believe holds this handler.

I'm using java 1.6.0_17. and Camel 2.2.0.

Thanks and please let me know if there's anything more I can provide to help
you help me solve this problem :)






Ian de Beer wrote:
> 
> Hi
> Thanks to all - it works with the two files (spring.schemas and
> spring.handlers) added to my META-INF
> Regards
> Ian
> 
> 
> willem.jiang wrote:
>> 
>> Can you check your "fat-jar" if it contains the file 
>> /META-INF/spring.handles and /META-INF/spring.schemas like these files
>> [1]
>> 
>> If not , you need to update your assembly plugin is configuration to 
>> contain upper files.
>> 
>> [1] 
>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
>> 
>> Willem
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p27917397.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Ian de Beer <ia...@zenaptix.com>.
Hi
Thanks to all - it works with the two files (spring.schemas and
spring.handlers) added to my META-INF
Regards
Ian


willem.jiang wrote:
> 
> Can you check your "fat-jar" if it contains the file 
> /META-INF/spring.handles and /META-INF/spring.schemas like these files [1]
> 
> If not , you need to update your assembly plugin is configuration to 
> contain upper files.
> 
> [1] 
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF
> 
> Willem
> 

-- 
View this message in context: http://old.nabble.com/The-dreaded%3A-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-tp26388081p26390429.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The dreaded: Unable to locate Spring NamespaceHandler for XML schema

Posted by Willem Jiang <wi...@gmail.com>.
Can you check your "fat-jar" if it contains the file 
/META-INF/spring.handles and /META-INF/spring.schemas like these files [1]

If not , you need to update your assembly plugin is configuration to 
contain upper files.

[1] 
https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-osgi/src/main/resources/META-INF

Willem

Ian de Beer wrote:
> Hi 
> Ever since I have started using the 2.1-SNAPSHOT, I get the attached
> exception. The same code worked fine with 2.0.0 and it still works fine when
> I compile and run in Intellij IDE. However when I create a "fat-jar" with
> mvn assembly:assembly and run from a terminal, it fails. I have no option ,
> but to use the latest SNAPSHOT as it includes RSS component fixes - very
> frustrating.
> 
> The camel-context.xml reads:
> <?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     
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>           http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
> 
>   <camel:camelContext id="camel">
>     <camel:routeBuilder ref="routeBuilder"/>
>   </camel:camelContext>
>   
>   <bean name="routeBuilder"
> class="com.zenaptix.contentServer.ContentManagerRouteBuilder">
>   ...
>   </bean>
> ...
> <beans>
> 
> Exception in thread "main"
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> schema namespace [http://camel.apache.org/schema/spring]
> Offending resource: class path resource [META-INF/spring/camel-context.xml]
> 
> 	at
> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1294)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
> 	at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
> 	at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
> 	at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
> 	at com.zenaptix.contentServer.Launcher.start(Launcher.java:53)
> 	at com.zenaptix.contentServer.Launcher.main(Launcher.java:107)
>