# Does camel-events-support really support for Hippo CMS 12.x

**URL:** <https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [August 21, 2018, 2:09pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306 "2018-08-21T14:09:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonny](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tonny](https://community.bloomreach.com/u/tonny)\
**Post date:** [August 21, 2018, 2:09pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/1 "2018-08-21T14:09:12Z")

</div>

I’m working for the [camel-events-support](https://github.com/onehippo-forge/camel-events-support/tree/master), and its [release notes](https://onehippo-forge.github.io/camel-events-support/release-notes.html) states that the version 1.x supports for Hippo CMS 12.x. But when working with its demo project, I found the problem.

It is something related with `site` module which uses listener of `org.hippoecm.hst.site.container.HstContextLoaderListener` in `web.xml` to configure/initialize/destroy HST Container, and which does not exist in Hippo CMS 10.x. Thus, if I use the listener, I got the following error:

> [INFO] [talledLocalContainer] 21:06:28.177 [Thread-5] ERROR org.hippoecm.hst.site.container.DefaultHstSiteConfigurer - HstSiteConfigServlet: ComponentManager initialization failed.
> 
> [INFO] [talledLocalContainer] org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/org/hippoecm/hst/cmsrest/SpringComponentManager-cmsrest.xml]
> 
> [INFO] [talledLocalContainer] Offending resource: file [/Users/tonny/Documents/hippo-workspace/demo/target/tomcat8x/webapps/site/WEB-INF/classes/META-INF/hst-assembly/overrides/hst-cms-rest.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [org/hippoecm/hst/cmsrest/SpringComponentManager-cmsrest.xml]; nested exception is java.io.FileNotFoundException: class path resource [org/hippoecm/hst/cmsrest/SpringComponentManager-cmsrest.xml] cannot be opened because it does not exist

. However, if I remove the listener, the HST Container Services will not be initialized at all.

How can I handle the case please?

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 21, 2018, 2:52pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/2 "2018-08-21T14:52:15Z")

</div>

Hi Tony,

Unfortunately, the demo sub-project was not upgraded to be compliant with v12 yet. The parent root pom (demo/pom.xml) still inherits from 10.1.0. Sorry for that.

For now, you can create a demo project locally using hippo archetype for your testing and use the forge component somehow.  
There are 3 steps:

1. Instantiate Camel Context

You need to initialize spring web application context and camel Context. See the examples:

- [https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/cms/src/main/webapp/WEB-INF/web.xml#L108-L110](https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/cms/src/main/webapp/WEB-INF/web.xml#L108-L110)
- [https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/cms/src/main/webapp/WEB-INF/applicationContext.xml](https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/cms/src/main/webapp/WEB-INF/applicationContext.xml)
- [https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/cms/src/main/webapp/WEB-INF/camel/\*](https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/cms/src/main/webapp/WEB-INF/camel/*)

1. Use hippoevt: camel component

Follow [https://onehippo-forge.github.io/camel-events-support/component-hippoevent.html](https://onehippo-forge.github.io/camel-events-support/component-hippoevent.html) to install and use the hippo event support camel component provided by the forge module.  
See examples in [https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/cms/src/main/webapp/WEB-INF/camel/\*](https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/cms/src/main/webapp/WEB-INF/camel/*).

1. REST services invoked from the camel route in site

This was just an example in the demo/site:

- [https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/site/src/main/java/org/onehippo/forge/camel/demo/rest](https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/site/src/main/java/org/onehippo/forge/camel/demo/rest)

Your camel route doesn’t have to invoke a REST service, perhaps you can use JCR API or Workflow API or even Content EXIM API to create/update document. But at the moment, the demo includes REST APIs just for simplicity to be invoked from a camel route.

Feel free to let us know how it goes. Also feel free to create a JIRA tickets to improve its demo or documentation in [https://issues.onehippo.com/projects/HIPFORGE](https://issues.onehippo.com/projects/HIPFORGE). Pull requests are more than welcome, too.

Regards,

Woonsan

---

<div class="post-metadata">

**Author:** ![tonny](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tonny](https://community.bloomreach.com/u/tonny)\
**Post date:** [August 22, 2018, 4:04am UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/3 "2018-08-22T04:04:15Z")

</div>

Hi Woonsan,

Thanks a lot for your kind and rapid reply.

The 3 steps you mentioned is actually what I have done to create a camel route in Hippo CMS, and it really works fine. The following question is how to get the documents’ info, viz. get some subclasses of `BaseDocument`. The demo sample provides a way to use rest api in `site`, which, unfortunately, will cause some errors for version 12.x.

For your suggestion to use JCR API or Workflow API etc., I may get wrong knowledge but I’m afraid all this API should be in `site` module which is just the same module in where all `BaseDocument`'s subclasses exist. Thus, how can camel route in `cms` module call some API exist in `site` module?

Wish your further infomation.

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 22, 2018, 2:01pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/4 "2018-08-22T14:01:56Z")

</div>

Hi Tonny,

> [@tonny](#):
>
> The 3 steps you mentioned is actually what I have done to create a camel route in Hippo CMS, and it really works fine. The following question is how to get the documents’ info, viz. get some subclasses of `BaseDocument`. The demo sample provides a way to use rest api in `site`, which, unfortunately, will cause some errors for version 12.x.

I see. You want to take advantage of HST Content Beans.  
In that case, I think you can do the following:

- The original demo used HST Plain JAX-RS Services (the “rest api in `site`”) [1]. So, you can enable a plain JAX-RS service mount and copy/configure the REST services. So,
- Copy [https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/site/src/main/resources/META-INF/hst-assembly/overrides/custom-jaxrs-resources.xml](https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/site/src/main/resources/META-INF/hst-assembly/overrides/custom-jaxrs-resources.xml) into site/src/main/resources/META-INF/hst-assembly/overrides/.
- Copy all the REST api related Java classes under [https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/site/src/main/java/org/onehippo/forge/camel/demo/rest/](https://github.com/onehippo-forge/camel-events-support/tree/develop/demo/site/src/main/java/org/onehippo/forge/camel/demo/rest/). You may want to tweak some bean there for your project.
- Add restapi mount under the hst:root like [https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/bootstrap/configuration/src/main/resources/hst/hosts.xml#L33-L49](https://github.com/onehippo-forge/camel-events-support/blob/develop/demo/bootstrap/configuration/src/main/resources/hst/hosts.xml#L33-L49).
- Test the rest api with URL access.
- Integrate the rest api in your camel routes.

> [@tonny](#):
>
> For your suggestion to use JCR API or Workflow API etc., I may get wrong knowledge but I’m afraid all this API should be in `site` module which is just the same module in where all `BaseDocument`’s subclasses exist. Thus, how can camel route in `cms` module call some API exist in `site` module?

Indeed, if you don’t use the HST Content Beans like the old demo, you cannot take advantage of the bean mapping provided by HST-2 unfortunately.  
But there are pros and cons. Some pointers:

- Using HST Content Beans in `site` webapp, your camel route residing in `cms` webapp should always make local restapi calls.
- Even if it is more tedious by not using HST content beans, you can still achieve the integration by using, for example, Content EXIM library [2], to read/update content.

It could be about performance vs modifiability.

Regards,

Woonsan

[1] [RESTful API Support - Plain JAX-RS Services - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS](https://www.onehippo.org/library/concepts/rest/restful-api-support---plain-jax-rs-services.html)  
[2] [https://onehippo-forge.github.io/content-export-import/](https://onehippo-forge.github.io/content-export-import/)

---

<div class="post-metadata">

**Author:** ![tonny](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tonny](https://community.bloomreach.com/u/tonny)\
**Post date:** [August 22, 2018, 2:14pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/5 "2018-08-22T14:14:45Z")

</div>

Hi Woonsan,

Thanks a lot for your reply. Actually, I think the demo’s solution is just based on the architecture of Hippo CMS [(High Level Component Overview)](https://onehippo-prod.global.ssl.fastly.net/binaries/ninecolumn/content/gallery/connect/architecture/uml/why-hippo/open-platform-2.png), which shows the Authoring (viz. CMS) can access Delivery (viz. site) via REST API. I’ll let you know if it works according to your guide.

And for Content EXIM library, currently we only run a standalone application, so the local rest api call is just fine for my case.

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 22, 2018, 2:28pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/6 "2018-08-22T14:28:27Z")

</div>

> [@tonny](#):
>
> And for Content EXIM library, currently we only run a standalone application, so the local rest api call is just fine for my case.

I see. Sounds good.

Woonsan

---

<div class="post-metadata">

**Author:** ![tonny](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tonny](https://community.bloomreach.com/u/tonny)\
**Post date:** [August 23, 2018, 2:24am UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/7 "2018-08-23T02:24:36Z")

</div>

Hi Woonsan,

Thanks a lot for your help, and finally it works.

The problem of the demo for Hippo CMS 12.x is just something with how to add restful support in `site` module. It seems it has got some changes of the aspect, because there’s no folder named `bootstrap` in 12.x [(repo)](https://code.onehippo.org/cms-community/hippo-project-archetype/tree/hippo-project-archetype-12.4.0/src/main/resources/archetype-resources). Eo add restful support there’s an official guide as you mentioned. Actually, there’s a `hosts.yaml` file located in `repository-data/application/src/main/resources/hcm-config/hst` which may be have the same function as `hosts.xml` because I just modified this file and it works.

I’m afraid this is the only point should be changed for the demo to upgrade to Hippo CMS 12.x.

Thanks a lot for your kind help again!

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 23, 2018, 1:49pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/8 "2018-08-23T13:49:24Z")

</div>

> [@tonny](#):
>
> The problem of the demo for Hippo CMS 12.x is just something with how to add restful support in `site` module. It seems it has got some changes of the aspect, because there’s no folder named `bootstrap` in 12.x [(repo)](https://code.onehippo.org/cms-community/hippo-project-archetype/tree/hippo-project-archetype-12.4.0/src/main/resources/archetype-resources). Eo add restful support there’s an official guide as you mentioned. Actually, there’s a `hosts.yaml` file located in `repository-data/application/src/main/resources/hcm-config/hst` which may be have the same function as `hosts.xml` because I just modified this file and it works.

Right. It was changed to repository-data/ from bootstrap/ and .yaml’s from .xml’s. 🙂

> [@tonny](#):
>
> I’m afraid this is the only point should be changed for the demo to upgrade to Hippo CMS 12.x.
> 
> Thanks a lot for your kind help again!

Thank YOU very much for reporting and solving the problem together!  
I’ve filed a ticket here to fix the demo in the end:

- [https://issues.onehippo.com/browse/HIPFORGE-190](https://issues.onehippo.com/browse/HIPFORGE-190)

By the nature of ‘forge’, we depend on internal/external voluntary efforts for The Community. So, it would take some time to fix it. I volunteer to fix it with the knowledge found here soon.

Cheers,

Woonsan

---

<div class="post-metadata">

**Author:** ![tonny](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tonny](https://community.bloomreach.com/u/tonny)\
**Post date:** [August 23, 2018, 3:09pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/9 "2018-08-23T15:09:22Z")

</div>

Hi Woonsan,

I am also glad to provide any info. if needed to fix the issue.

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [August 24, 2018, 2:21pm UTC](https://community.bloomreach.com/t/does-camel-events-support-really-support-for-hippo-cms-12-x/306/10 "2018-08-24T14:21:49Z")

</div>

I’ve fixed the demo in develop branch. It’s now on 12.4.0. After building the module first (snapshot version for now), the demo project can be built and running like the documentation described.  
I’ve tested with solr only, but I guess it should work with elasticsearch and ActiveMQ as well because it’s really dependent on very generic integration APIs only with those.  
Please feel free to test if anybody is interested in.  
I’ll probably cut a new release, v1.2.0, next week.

Cheers,

Woonsan
