Gateway-http in fabric8 doesn't work
Environment
- Red Hat JBoss Fuse
- 6.1.0
Issue
- Tried to use the
HTTP gatewayinfabric8onJBoss Fuse 6.1, but it didn’t work. - There are several exceptions during the startup .
- Following steps were followed :
- Start JBoss Fuse 6.1.
- Execute fabric:create.
- Create a child node with the profile
example-quickstarts-rest. - Able to access the REST-service directly http://localhost:8182/cxf/crm/customerservice/customers/123.
- Create another child node with the profile
gateway-http. - There are several exceptions during the startup.
- Cannot access the REST-service via the gateway http://localhost:9000/cxf/crm/customerservice/customers/123.
Resolution
- Download p2 patch for https://access.redhat.com/jbossnetwork/restricted/softwareDetail.html?softwareId=31873&product=jboss.fuse&version=6.1.0&downloadType=patches.
fabric:create
fabric:version-create 1.1
container-upgrade 1.1
container-create-child root TestA
container-upgrade 1.1 TestA
container-add-profile TestA example-quickstarts-rest
container-create-child root TestB
container-upgrade 1.1 TestB
patch-apply --all-versions file:///<Path to patch folder>/jboss-fuse-6.1.0.redhat-379-p2.zip
<!--wait for a while till container reloads itself-->
profile-edit -p io.fabric8.gateway.http/port=9800 gateway-http 1.1
container-add-profile TestB gateway-http
Root Cause
- There is bug reported https://issues.jboss.org/browse/ENTESB-1464 which is fixed in patch p2.
- Port conflicts between rest example and
gateway-http.
Diagnostic Steps
fabric:create
container-create-child root TestContainerA
container-add-profile TestContainerA example-quickstarts-rest
container-create-child root TestContainerB
container-add-profile TestContainerB gateway-http
- http://localhost:9000/cxf/crm/customerservice/customers/123 url doesn't respond.
- logs at location ${jboss.home}/instances/TestContainerB/data/log display following error:
ERROR | agent-1-thread-1 | gateway-fabric | ? ? | 97 - io.fabric8.gateway-fabric - 1.0.0.redhat-379 | [io.fabric8.gateway.http.mapping(85)] The activate method has thrown an exception
io.fabric8.api.scr.InvalidComponentException: Reference not available
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
