Search code examples
javahibernateweb-servicescxfjbossfuse

FUSE hibernate with CXF


I was able to develop two applications (One application used Hibernate and other application used CXF web service followed by this tutorial) separately and deploy to the FUSE 6.3.0 with out any issue.

But my problem arises when I try to install hibernate in FUSE where FUSE has already installed CXF application which I developed. I try to execute following command to install hibernate.

fabric:profile-edit --bundle mvn:org.hibernate/hibernate-core/4.2.22.Final-redhat-1 jboss-fuse-full

If I do not have CXF application installed in the FUSE then no exception thrown from FUSE but when I have CXF application deployed in FUSE it gives following exception.

    Exception in thread "SpringOsgiExtenderThread-2" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route cxf: Route(cxf)[[From[cxf:bean:serviceEndpoint]] -> [RecipientLis... because of Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
            at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
            at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:138)
            at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:340)
            at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
            at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
            at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
            at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
            at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route cxf: Route(cxf)[[From[cxf:bean:serviceEndpoint]] -> [RecipientLis... because of Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
            at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:201)
            at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:974)
            at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3301)
            at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3024)
            at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
            at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2854)
            at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2850)
            at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2873)
            at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2850)
            at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
            at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2819)
            at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:275)
            at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:136)
            ... 10 more
    Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:serviceEndpoint due to: No component found with scheme: cxf
            at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:594)
            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)
            ... 22 more

Does any one experienced this kind of issue before and able to resolve it. Please be kind enough to share your experience to resolve this issue.


Solution

  • I also had same kind of issue when I try to install CXF with ActiveMQ.I was able to resolve it by uninstalling the already installed CXF project and then install the ActiveMQ.

    Make sure that you have installed the required dependencies for the Hibernate correctly. After verifying that you have installed required dependencies you can reinstall application/

    So in your case, you can first uninstall CXF project first and then install Hibernate(Note that you may required to install all the dependencies required).Then retry to install the CXF project.

    You can use following command to uninstall existing project

    uninstall <processID> eg-: uninstall 418