mdarwin
mdarwin

Reputation: 2404

Wildfly won't play nicely with camel: IllegalArgumentException: Type is not a Component implementation

I'm trying to get apache camel running on wildfly 9.0.2.Final.

Using the guide here, I've downloaded a wildfly bundle WildFly-Camel 3.3.0 and patched my wildfly instance.

My route configuration uses netty-http, like this:

from("netty-http:http://localhost:8459/broker/router.jsp").convertBodyTo(String.class) 

So I have added camel-netty-http version 2.16.2 to my project.

However, when I start up, I get the following stack trace:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: netty-http://http://localhost:
8459/broker/router.jsp due to: Cannot auto create component: netty-http
        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:590)
        at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
        at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211)
        at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
        at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
        at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:69)
        at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1052)
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196)
        ... 39 more
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: netty-http
        at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:412)
        at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:388)
        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:560)
        ... 47 more
Caused by: java.lang.IllegalArgumentException: Type is not a Component implementation. Found: org.apache.camel.component.netty.http.NettyHttpComponent
        at org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:89)
        at org.wildfly.extension.camel.handler.ComponentResolverAssociationHandler$WildFlyComponentResolver.resolveComponent(ComponentResolverAssociationHandler.java:67)
        at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:401)
        ... 49 more

Looking at the camel source here, it seems this exception is thrown when the Component specified is not a org.apache.camel.Component:

if (Component.class.isAssignableFrom(type)) {
        return (Component) context.getInjector().newInstance(type);
    } else {
        throw new IllegalArgumentException("Type is not a Component implementation. Found: " + type.getName());
    }

But it clearly is a Component, and it's the correct version too.

What can I be doing wrong? Is it perhaps picking up the Component class with a different classloader than the one loading the NettyHttpComponent class?

Upvotes: 0

Views: 145

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55555

netty-http component is not supported by wildfly-camel. You should use the components they support listed here: https://wildflyext.gitbooks.io/wildfly-camel/content/components/index.html

Upvotes: 0

Related Questions