Error trying to deploy war

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error trying to deploy war

raheem
Hi,
I used the camel-archetype-web archetype to generate a war.  I generated the projec, built it and deployed.  When deploying to a karaf-2.2.9 with camel 2.10.2, I get the following exception:
 Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is org.springframework.beans.FatalBeanException: Class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface

I only have one version of spring installed and I do not have camel-osgi installed.  Here is a partial listing:
karaf@root> list -t 1 | grep pring
   ID   State         Blueprint      Spring    Level  Name
[  12] [Active     ] [Created     ] [       ] [   28] Apache Karaf :: Deployer :: Spring (2.2.9)
[  51] [Active     ] [            ] [       ] [   30] Spring Core (3.0.7.RELEASE)
[  52] [Active     ] [            ] [       ] [   30] Spring ASM (3.0.7.RELEASE)
[  53] [Active     ] [            ] [       ] [   30] Spring Expression Language (3.0.7.RELEASE)
[  54] [Active     ] [            ] [       ] [   30] Spring Beans (3.0.7.RELEASE)
[  55] [Active     ] [            ] [       ] [   30] Spring AOP (3.0.7.RELEASE)
[  56] [Active     ] [            ] [       ] [   30] Spring Context (3.0.7.RELEASE)
[  57] [Active     ] [            ] [       ] [   30] Spring Context Support (3.0.7.RELEASE)
[  67] [Active     ] [            ] [       ] [   30] spring-osgi-io (1.2.1)
[  68] [Active     ] [            ] [       ] [   30] spring-osgi-core (1.2.1)
[  69] [Active     ] [            ] [       ] [   30] spring-osgi-extender (1.2.1)
[  70] [Active     ] [            ] [       ] [   30] spring-osgi-annotation (1.2.1)
[  71] [Active     ] [            ] [       ] [   30] Spring Transaction (3.0.7.RELEASE)
[  73] [Active     ] [            ] [       ] [   50] camel-spring (2.10.2)
[ 104] [Active     ] [            ] [       ] [   30] Spring Web (3.0.7.RELEASE)
[ 105] [Active     ] [            ] [       ] [   30] Spring Web Servlet (3.0.7.RELEASE)
[ 107] [Active     ] [            ] [       ] [   30] Spring JMS (3.0.7.RELEASE)
[ 286] [Active     ] [            ] [       ] [   80] Spring JDBC (3.0.7.RELEASE)
karaf@root> list -t 1 | grep camel
[  64] [Active     ] [            ] [       ] [   50] camel-core (2.10.2)
[  65] [Active     ] [Created     ] [       ] [   50] camel-karaf-commands (2.10.2)
[  73] [Active     ] [            ] [       ] [   50] camel-spring (2.10.2)
[  74] [Active     ] [Created     ] [       ] [   50] camel-blueprint (2.10.2)
[  75] [Active     ] [            ] [       ] [   50] camel-context (2.10.2)
[  81] [Active     ] [            ] [       ] [   50] camel-quartz (2.10.2)
[ 108] [Active     ] [            ] [       ] [   50] camel-jms (2.10.2)
[ 167] [Active     ] [            ] [       ] [   50] camel-cxf-transport (2.10.2)
[ 168] [Active     ] [Created     ] [       ] [   50] camel-cxf (2.10.2)
[ 184] [Active     ] [            ] [       ] [   50] camel-http (2.10.2)
[ 185] [Active     ] [            ] [       ] [   50] camel-jetty (2.10.2)
[ 188] [Active     ] [            ] [       ] [   50] camel-ftp (2.10.2)
[ 191] [Active     ] [            ] [       ] [   50] camel-ssh (2.10.2)
[ 242] [Active     ] [            ] [       ] [   50] activemq-camel (5.7.0)

Thanks!
Raheem
Reply | Threaded
Open this post in threaded view
|

Re: Error trying to deploy war

raheem
And here is the actual applicationContext.xml:
<?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.xsd
       http://camel.apache.org/schema/spring
       http://camel.apache.org/schema/spring/camel-spring.xsd">

   
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route id="timer-to-console">
            <from uri="timer://foo?fixedRate=true&amp;period=10s"/>
            <transform>
               <simple>Hello Web Application, how are you?</simple>
            </transform>
            <to uri="stream:out"/>
        </route>
    </camelContext>

</beans>
Reply | Threaded
Open this post in threaded view
|

Re: Error trying to deploy war

Claus Ibsen-2
In reply to this post by raheem
On Sun, Dec 16, 2012 at 3:25 AM, raheem <[hidden email]> wrote:

> Hi,
> I used the camel-archetype-web archetype to generate a war.  I generated the
> projec, built it and deployed.  When deploying to a karaf-2.2.9 with camel
> 2.10.2, I get the following exception:
>  Unexpected exception parsing XML document from ServletContext resource
> [/WEB-INF/applicationContext.xml]; nested exception is
> org.springframework.beans.FatalBeanException: Class
> [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace
> [http://camel.apache.org/schema/spring] does not implement the
> [org.springframework.beans.factory.xml.NamespaceHandler] interface
>

How do you deploy the WAR to Karaf ?

Do you copy the .war to deploy directory, or install using the shell?
If using the shell you need to use the war url handler

The Karaf documentation about this is vauge
http://karaf.apache.org/manual/2.2.9/users-guide/web-applications.html

There is a better doc here about the war url handler
http://fusesource.com/docs/esbent/7.0/esb_deploy_osgi/UrlHandlers-War.html





> I only have one version of spring installed and I do not have camel-osgi
> installed.  Here is a partial listing:
> karaf@root> list -t 1 | grep pring
>    ID   State         Blueprint      Spring    Level  Name
> [  12] [Active     ] [Created     ] [       ] [   28] Apache Karaf ::
> Deployer :: Spring (2.2.9)
> [  51] [Active     ] [            ] [       ] [   30] Spring Core
> (3.0.7.RELEASE)
> [  52] [Active     ] [            ] [       ] [   30] Spring ASM
> (3.0.7.RELEASE)
> [  53] [Active     ] [            ] [       ] [   30] Spring Expression
> Language (3.0.7.RELEASE)
> [  54] [Active     ] [            ] [       ] [   30] Spring Beans
> (3.0.7.RELEASE)
> [  55] [Active     ] [            ] [       ] [   30] Spring AOP
> (3.0.7.RELEASE)
> [  56] [Active     ] [            ] [       ] [   30] Spring Context
> (3.0.7.RELEASE)
> [  57] [Active     ] [            ] [       ] [   30] Spring Context Support
> (3.0.7.RELEASE)
> [  67] [Active     ] [            ] [       ] [   30] spring-osgi-io (1.2.1)
> [  68] [Active     ] [            ] [       ] [   30] spring-osgi-core
> (1.2.1)
> [  69] [Active     ] [            ] [       ] [   30] spring-osgi-extender
> (1.2.1)
> [  70] [Active     ] [            ] [       ] [   30] spring-osgi-annotation
> (1.2.1)
> [  71] [Active     ] [            ] [       ] [   30] Spring Transaction
> (3.0.7.RELEASE)
> [  73] [Active     ] [            ] [       ] [   50] camel-spring (2.10.2)
> [ 104] [Active     ] [            ] [       ] [   30] Spring Web
> (3.0.7.RELEASE)
> [ 105] [Active     ] [            ] [       ] [   30] Spring Web Servlet
> (3.0.7.RELEASE)
> [ 107] [Active     ] [            ] [       ] [   30] Spring JMS
> (3.0.7.RELEASE)
> [ 286] [Active     ] [            ] [       ] [   80] Spring JDBC
> (3.0.7.RELEASE)
> karaf@root> list -t 1 | grep camel
> [  64] [Active     ] [            ] [       ] [   50] camel-core (2.10.2)
> [  65] [Active     ] [Created     ] [       ] [   50] camel-karaf-commands
> (2.10.2)
> [  73] [Active     ] [            ] [       ] [   50] camel-spring (2.10.2)
> [  74] [Active     ] [Created     ] [       ] [   50] camel-blueprint
> (2.10.2)
> [  75] [Active     ] [            ] [       ] [   50] camel-context (2.10.2)
> [  81] [Active     ] [            ] [       ] [   50] camel-quartz (2.10.2)
> [ 108] [Active     ] [            ] [       ] [   50] camel-jms (2.10.2)
> [ 167] [Active     ] [            ] [       ] [   50] camel-cxf-transport
> (2.10.2)
> [ 168] [Active     ] [Created     ] [       ] [   50] camel-cxf (2.10.2)
> [ 184] [Active     ] [            ] [       ] [   50] camel-http (2.10.2)
> [ 185] [Active     ] [            ] [       ] [   50] camel-jetty (2.10.2)
> [ 188] [Active     ] [            ] [       ] [   50] camel-ftp (2.10.2)
> [ 191] [Active     ] [            ] [       ] [   50] camel-ssh (2.10.2)
> [ 242] [Active     ] [            ] [       ] [   50] activemq-camel (5.7.0)
>
> Thanks!
> Raheem
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Error-trying-to-deploy-war-tp5724157.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Error trying to deploy war

raheem
Thanks Claus.  I was using the hot deploy mechanism.  I tried using the handler per you recommendation, here is what I did:
karaf@root> install -s war:file:///opt/karaf/stratus/lib/web-0.0.1-SNAPSHOT.war

Unfortunately I got the same error.  Any other thoughts or info I can provide that may help?

Thanks again!
Raheem

Reply | Threaded
Open this post in threaded view
|

Re: Error trying to deploy war

Claus Ibsen-2
On Mon, Dec 17, 2012 at 3:14 AM, raheem <[hidden email]> wrote:
> Thanks Claus.  I was using the hot deploy mechanism.  I tried using the
> handler per you recommendation, here is what I did:
> karaf@root> install -s
> war:file:///opt/karaf/stratus/lib/web-0.0.1-SNAPSHOT.war
>
> Unfortunately I got the same error.  Any other thoughts or info I can
> provide that may help?
>

What JARs do you have in your WAR file in the WEB-INF/lib directory?
If you have Spring JARs there maybe try to exclude them from the JAR
so Karaf can use the ones that comes with Karaf.



> Thanks again!
> Raheem
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Error-trying-to-deploy-war-tp5724157p5724186.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen