camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grzegorz Grzybek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-9183) java.lang.IllegalArgumentException: Unsupported namespaces: [http://camel.apache.org/schema/blueprint]
Date Thu, 14 Jan 2016 16:45:40 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-9183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15098358#comment-15098358
] 

Grzegorz Grzybek commented on CAMEL-9183:
-----------------------------------------

And I went even further ;)
I've extended one class:
{code:java}
public class BlueprintContextListener extends org.apache.aries.blueprint.web.BlueprintContextListener
{

    @Override
    protected NamespaceHandlerSet getNamespaceHandlerSet(ClassLoader tccl) {
        SimpleNamespaceHandlerSet handlerSet = new SimpleNamespaceHandlerSet();
        handlerSet.addNamespace(URI.create("http://camel.apache.org/schema/blueprint"),
                tccl.getResource("camel-blueprint.xsd"),
                new CamelNamespaceHandler());
        return handlerSet;
    }
}
{code}
and used:
{code:xml}
    <listener>
        <listener-class>org.apache.camel.example.servlet.tomcat.blueprintweb.BlueprintContextListener</listener-class>
    </listener>

    <context-param>
        <param-name>blueprintNamespaceHandlers</param-name>
        <param-value>org.apache.camel.blueprint.handler.CamelNamespaceHandler</param-value>
    </context-param>
{code}

it started working until:
{noformat}
java.lang.IllegalArgumentException: OSGi references are not supported
	at org.apache.aries.blueprint.container.NoOsgiRecipeBuilder.createRecipe(NoOsgiRecipeBuilder.java:72)
	at org.apache.aries.blueprint.container.NoOsgiRecipeBuilder.createRepository(NoOsgiRecipeBuilder.java:51)
	at org.apache.aries.blueprint.container.BlueprintContainerImpl.init(BlueprintContainerImpl.java:150)
	at org.apache.aries.blueprint.container.BlueprintContainerImpl.init(BlueprintContainerImpl.java:131)
	at org.apache.aries.blueprint.container.BlueprintContainerImpl.<init>(BlueprintContainerImpl.java:101)
	at org.apache.aries.blueprint.web.BlueprintContextListener.contextInitialized(BlueprintContextListener.java:88)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1648)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:463)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:413)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
	at sun.rmi.transport.Transport$2.run(Transport.java:202)
	at sun.rmi.transport.Transport$2.run(Transport.java:199)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:198)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
{noformat}
because there was automatic bean recipe registered: {{ReferenceMetadata[id='.camelBlueprint.componentResolver.properties',
activation=1, dependsOn=null, availability=1, interface='null', componentName='null', filter='(component=properties)',
referenceListeners=null, timeout=0, additonalInterfaces=[]]}} [here|https://github.com/apache/camel/blob/camel-2.15.3/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java#L715].

ergo: Camel's blueprint DSL can't be used outside of OSGi.

> java.lang.IllegalArgumentException: Unsupported namespaces: [http://camel.apache.org/schema/blueprint]
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-9183
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9183
>             Project: Camel
>          Issue Type: Bug
>          Components: examples
>    Affects Versions: 2.16.0
>            Reporter: Charles Moulliard
>            Assignee: Claus Ibsen
>             Fix For: 2.17.0
>
>
> Version used of Blueprint Web : 1.0
> I don't know if this example has ever work - https://github.com/apache/camel/blob/master/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml
but this is apparently not the longer case.
> When we start mvn jetty:run within the project, we get this error
> 2015-09-30 10:37:29.054:WARN:/:Failed to startup blueprint container. java.lang.IllegalArgumentException:
Unsupported namespaces: [http://camel.apache.org/schema/blueprint]
> java.lang.IllegalArgumentException: Unsupported namespaces: [http://camel.apache.org/schema/blueprint]
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.init(BlueprintContainerImpl.java:99)
> 	at org.apache.aries.blueprint.container.BlueprintContainerImpl.<init>(BlueprintContainerImpl.java:73)
> 	at org.apache.aries.blueprint.web.BlueprintContextListener.contextInitialized(BlueprintContextListener.java:86)
> Why, when the BlueprintContext is created, then it fails to load the camel namespace
handler
> We should upgrade to this version of Blueprint Web :
> https://github.com/apache/aries/blob/trunk/blueprint/blueprint-web/src/main/java/org/apache/aries/blueprint/web/BlueprintContextListener.java#L55-L56
> which allow to specify :
> blueprintNamespaceHandlers OR META-INF/blueprint.handlers
> and adapt the example to pass the blueprintNamespaceHandlers



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message