You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sriraman Gopalan <sr...@gmail.com> on 2015/08/08 11:30:15 UTC
camel cxfrs blueprint namespace issue
Dear All,
I am trying out a simple jaxrs service with camel 2.16-SNAPSHOT / cxf 3.1.2
and karaf 4.0.0. I am running into a problem while deploying a camel cxfrs
blueprint into karaf. The blueprint definition is as follows:
<blueprint default-activation="lazy"
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf-blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<cxf:rsServer id="adapterServicesRestEndpoint"
address="/pgadmin/services/rest/"
serviceClass="org.example.rest.impl.PGAdminRestImpl"
loggingFeatureEnabled="true">
<cxf:providers>
<ref component-id="jsonProvider" />
</cxf:providers>
<cxf:extensionMappings>
<entry key="json" value="application/json" />
</cxf:extensionMappings>
</cxf:rsServer>
<camel:camelContext xmlns="http://camel.apache.org/schema/blueprint">
<camel:package>
org.example.rest.routes
</camel:package>
</camel:camelContext>
<bean id="jsonProvider"
class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
<reference id="pgAdminRestApi"
interface="org.example.services.rest.api.PGAdminRestApi" />
</blueprint>
Karaf Exception:
Status: GracePeriod
Blueprint
8/8/15 2:38 PM
Missing dependencies:
(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/cxf))
The cxf namespace looks okay to me:
xmlns:cxf="http://camel.apache.org/schema/cxf"
The actual location of the xsd file also looks okay:
http://camel.apache.org/schema/cxf/camel-cxf-blueprint.xsd
However, I doubt the CxfNamespaceHandler is trying to pick up the xsd from
the wrong
location:
public URL getSchemaLocation(String s) {
return
getClass().getClassLoader().getResource("schema/blueprint/camel-cxf.xsd");
}
It should have been:
public URL getSchemaLocation(String s) {
return
getClass().getClassLoader().getResource("schema/cxf/camel-cxf-blueprint.xsd");
}
Also, the namespace registration looks wrong in this file:
trunk
<https://github.com/apache/camel/blob/master/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml>
The namespace registration is pointing to
<service-properties>
<entry key="osgi.service.blueprint.namespace"
value="http://camel.apache.org/schema/blueprint/cxf"/>
</service-properties>
whereas it should have been:
<service-properties>
<entry key="osgi.service.blueprint.namespace"
value="http://camel.apache.org/schema/cxf"/>
</service-properties>
I will try to apply the above changes to confirm if my assumptions are
right. Will update shortly.
best regards
Sriraman.
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxfrs-blueprint-namespace-issue-tp5770453.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel cxfrs blueprint namespace issue
Posted by Sriraman Gopalan <sr...@gmail.com>.
Dear All,
Apologies for the confusion.
It was my problem. The xmlns declaration in my blueprint was wrong. The
fixed blueprint header is this:
<blueprint default-activation="lazy"
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint/cxf
http://camel.apache.org/schema/cxf/camel-cxf-blueprint.xsd
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
...
</blueprint>
best regards
Sriraman.
--
View this message in context: http://camel.465427.n5.nabble.com/camel-cxfrs-blueprint-namespace-issue-tp5770453p5770464.html
Sent from the Camel - Users mailing list archive at Nabble.com.