I would like to configure WSO2 Api Manager to send basic auth header inside an in sequence. Everything was working great until I started configuring secure vault to store the credentials.
I am using dockerized version of Api Manager ( https://github.com/wso2/docker-apim/tree/v2.1.0/docker-compose/pattern-2 )
I've tried to add new vault entry in repository/conf/security/cipher-text.properties file but after running sh bin/ciphertool.sh -Dconfigure I received an exception:
Exception in thread "main" org.wso2.ciphertool.exception.CipherToolException: XPath value for secret alias 'ApiManager.BasicAuth.password' cannot be found.
at org.wso2.ciphertool.CipherTool.loadXpathValuesAndPasswordDetails(CipherTool.java:174)
at org.wso2.ciphertool.CipherTool.main(CipherTool.java:56)
Does it mean I have to specify xPath to the sequence file I want to use it in?
Aside from that I wanted to check if any of the existing passwords that are located inside vault file (repository/conf/security/cipher-text.properties) can be used in my sequence so I've used a value:
<property name="X-SomeHeader" expression="wso2:vault-lookup('UserManager.AdminUser.Password')" scope="transport" type="STRING" description="" />
When I try to run an API with this sequence I receive this exception:
api-manager_1 | [2017-05-25 10:12:04,949] ERROR - SynapseXPath Evaluation of the XPath expression wso2:vault-lookup('UserManager.AdminUser.Password') resulted in an error
api-manager_1 | org.jaxen.FunctionCallException
api-manager_1 | at org.wso2.carbon.mediation.security.vault.xpath.VaultLookupFunction.call(VaultLookupFunction.java:85)
api-manager_1 | at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:181)
api-manager_1 | at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
api-manager_1 | at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:677)
api-manager_1 | at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:216)
api-manager_1 | at org.jaxen.BaseXPath.evaluate(BaseXPath.java:175)
api-manager_1 | at org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:297)
api-manager_1 | at org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:346)
api-manager_1 | at org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:108)
api-manager_1 | at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
api-manager_1 | at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
api-manager_1 | at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
api-manager_1 | at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:67)
api-manager_1 | at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleRequest(APIManagerExtensionHandler.java:78)
api-manager_1 | at org.apache.synapse.rest.API.process(API.java:325)
api-manager_1 | at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90)
api-manager_1 | at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69)
api-manager_1 | at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304)
api-manager_1 | at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:78)
api-manager_1 | at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
api-manager_1 | at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:325)
api-manager_1 | at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158)
api-manager_1 | at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
api-manager_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
api-manager_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
api-manager_1 | at java.lang.Thread.run(Thread.java:745)
api-manager_1 | Caused by: java.lang.NullPointerException
api-manager_1 | at org.wso2.carbon.mediation.security.vault.SecureVaultLookupHandlerImpl.vaultLookup(SecureVaultLookupHandlerImpl.java:166)
api-manager_1 | at org.wso2.carbon.mediation.security.vault.SecureVaultLookupHandlerImpl.evaluate(SecureVaultLookupHandlerImpl.java:153)
api-manager_1 | at org.wso2.carbon.mediation.security.vault.xpath.VaultLookupFunction.call(VaultLookupFunction.java:82)
api-manager_1 | ... 25 more
Can someone guide me what am I doing wrong? Thank you in advance.
Exception in thread "main" org.wso2.ciphertool.exception.CipherToolException: XPath value for secret alias 'ApiManager.BasicAuth.password' cannot be found.
at org.wso2.ciphertool.CipherTool.loadXpathValuesAndPasswordDetails(CipherTool.java:174)
at org.wso2.ciphertool.CipherTool.main(CipherTool.java:56)
implies that your cipher-tool.properties file contains an xpath that does not match the one inside the file you specified.
It has to be this way: {alias}={path}{xpath}, so if you take the following:
SalesforcePasswords.SalesforceApi.ClientId=tmp/app-config/SalesforcePasswords.xml//SalesforceApi/ClientId
{alias} is SalesforcePasswords.SalesforceApi.ClientId
{path} is tmp/app-config/SalesforcePasswords.xml
{xpath} is //SalesforceApi/ClientId
not sure what is causing your second exception
Related
there are two existing IoT agents in our application, one is iotagent-ul(over HTTP), another is lwm2m-iotagent(over HTTP). Recently in order to integrate new sensors, I need to add a new iotagent-json(over MQTT). After bringing up the system, there is some strange error log as I pasted at the end:
(1) iotagent-ul is over HTTP, IOTA_DEFAULT_TRANSPORT is not defined in iotagent-ul, just use the default value HTTP, but iotagent-ul always complains that "Couldn't connect with MQTT broker" and "Error: Callback was already called", why will iotagent-ul try to connect MQTT broker?
(2) iotagent-json is defined with IOTA_DEFAULT_TRANSPORT=MQTT, but it also reports a error for IOTAJSON.AMQP.Binding, should I just ignore it?
These containers can run up, but an endless error log is thrown out in the console. BTW, before adding the new iotagent-json, these two previous iotagent-ul and lwm2m-iotagent can work properly.
Could you help me view the error info and the IoT agents definition in yml? Any comments are appreciated, thank you very much.
1 The services defined in docker-compose.yml file:
# IoT Agents ##################################################################
iot-agent-ul:
image: fiware/iotagent-ul
hostname: iot-agent-ul
container_name: fiware-iot-agent-ul
depends_on:
- mongo-db
networks:
- default
expose:
- "4041"
- "7896"
ports:
- "4041:4041"
- "7896:7896"
environment:
- "IOTA_CB_HOST=orion" # name of the context broker to update context
- "IOTA_CB_PORT=1026" # port the context broker listens on to update context
- "IOTA_CB_NGSI_VERSION=v2" # NGSI version to use
- "IOTA_NORTH_PORT=4041" # port for devices provisioning
- "IOTA_REGISTRY_TYPE=mongodb" #Whether to hold IoT device info in memory or in a database
- "IOTA_LOG_LEVEL=ERROR" #The log level of the IoT Agent
- "IOTA_TIMESTAMP=true" # whether to include or not the timestamp
- "IOTA_MONGO_HOST=mongo-db" # The host name of MongoDB
- "IOTA_MONGO_PORT=27017" # The port mongoDB is listening on
- "IOTA_MONGO_DB=iotagentul" # The name of the database used in mongoDB
- "IOTA_HTTP_PORT=7896" # The port used for device traffic over HTTP
- "IOTA_PROVIDER_URL=http://iot-agent-ul:4041" # URL of the agent
- "IOTA_AUTOCAST=true" # autocasting of values into NGSI standard
iot-agent-lwm2m:
image: hopu/lwm2m-iotagent:observe-and-read
hostname: iot-agent-lwm2m
container_name: fiware-iot-agent-lwm2m
expose:
- "4042"
- "5683"
ports:
- "4042:4042"
- "5683:5683/udp"
environment:
- "IOTA_CB_HOST=orion" # name of the context broker to update context
- "IOTA_CB_PORT=1026" # port the context broker listens on to update context
- "IOTA_NORTH_PORT=4042" # port for devices provisioning
- "IOTA_REGISTRY_TYPE=mongodb" # whether to hold IoT device info in memory or in a database
- "IOTA_LOG_LEVEL=ERROR" #The log level of the IoT Agent
- "IOTA_TIMESTAMP=true" # whether to include or not the timestamp
- "IOTA_MONGO_HOST=mongo-db" # The host name of MongoDB
- "IOTA_MONGO_PORT=27017" # The port mongoDB is listening on
- "IOTA_MONGO_DB=iotagentlwm2m" # The name of the database used in mongoDB
- "IOTA_HTTP_PORT=5683" # The port used for device traffic over HTTP
- "IOTA_PROVIDER_URL=http://iot-agent-lwm2m:4042" # URL of the agent
- "IOTA_AUTOCAST=true" # autocasting of values into NGSI standard
volumes:
- "./iota-lwm2m/config.js:/opt/iota-lwm2m/config.js"
- "./iota-lwm2m/omaRegistry.json:/opt/iota-lwm2m/omaRegistry.json"
- "./iota-lwm2m/omaInverseRegistry.json:/opt/iota-lwm2m/omaInverseRegistry.json"
restart: on-failure
depends_on:
- mongo-db
- orion
networks:
- default
iot-agent-json:
image: fiware/iotagent-json:latest
hostname: iot-agent-json
container_name: fiware-iot-agent-json
depends_on:
- mongo-db
- mosquitto
expose:
- "4043"
- "7896" # No traffic,7896 is the http listening port for sensors
ports:
- "4043:4043"
- "7898:7898" # No traffic
environment:
- "IOTA_CB_HOST=orion" # name of the context broker to update context
- "IOTA_CB_PORT=1026" # port the context broker listens on to update context
- "IOTA_NORTH_PORT=4043" # port for devices provisioning
- "IOTA_REGISTRY_TYPE=mongodb" # Whether to hold IoT device info in memory or in a database
- "IOTA_LOG_LEVEL=DEBUG" # The log level of the IoT Agent
- "IOTA_TIMESTAMP=true" # whether to include or not the timestamp
- "IOTA_CB_NGSI_VERSION=v2" # NGSI version to use
- "IOTA_AUTOCAST=true" # autocasting of values into NGSI standard
- "IOTA_MONGO_HOST=mongo-db" # The host name of MongoDB
- "IOTA_MONGO_PORT=27017" # The port mongoDB is listening on
- "IOTA_MONGO_DB=iotagentjson" # The name of the database used in mongoDB
- "IOTA_HTTP_PORT=7898" # The port used for device traffic over HTTP
- "IOTA_PROVIDER_URL=http://iot-agent:4043" # URL of the agent
- "IOTA_DEFAULT_RESOURCE=/iot/json" # IOTA_PROVIDER_URL, the default path the IoT Agent uses listening for JSON measures over HTTP.
- "IOTA_MQTT_HOST=mosquitto" # MQTT broker service
- "IOTA_MQTT_PORT=1883" # MQTT service port
- "IOTA_DEFAULT_TRANSPORT=MQTT" # ---
- "IOTA_MQTT_USERNAME=myusername"
- "IOTA_MQTT_PASSWORD=mypassword"
networks:
- default
2 After docker containers start-up, some error log printed out:
fiware-iot-agent-ul | time=2022-08-23T09:19:32.404Z | lvl=ERROR | corr=650cc5a7-e0b0-406a-bb7d-84db422bb0e3 | trans=650cc5a7-e0b0-406a-bb7d-84db422bb0e3 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
fiware-iot-agent-ul | time=2022-08-23T09:19:32.405Z | lvl=FATAL | corr=650cc5a7-e0b0-406a-bb7d-84db422bb0e3 | trans=650cc5a7-e0b0-406a-bb7d-84db422bb0e3 | op=IoTAgentNGSI.ContextServer | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
fiware-iot-agent-ul | time=2022-08-23T09:19:32.409Z | lvl=ERROR | corr=n/a | trans=n/a | op=IoTAgentNGSI.DomainControl | from=n/a | srv=n/a | subsrv=n/a | msg=Error: Callback was already called.
fiware-iot-agent-ul | at /opt/iotaul/node_modules/async/dist/async.js:969:32
fiware-iot-agent-ul | at MqttClient.<anonymous> (/opt/iotaul/lib/bindings/MQTTBinding.js:375:17)
fiware-iot-agent-ul | at MqttClient.emit (node:events:539:35)
fiware-iot-agent-ul | at MqttClient.emit (node:domain:475:12)
fiware-iot-agent-ul | at Socket.streamErrorHandler (/opt/iotaul/node_modules/mqtt/lib/client.js:460:12)
fiware-iot-agent-ul | at Socket.emit (node:events:527:28)
fiware-iot-agent-ul | at Socket.emit (node:domain:475:12)
fiware-iot-agent-ul | at emitErrorNT (node:internal/streams/destroy:157:8)
fiware-iot-agent-ul | at emitErrorCloseNT (node:internal/streams/destroy:122:3)
fiware-iot-agent-ul | at processTicksAndRejections (node:internal/process/task_queues:83:21) {
fiware-iot-agent-ul | domainThrown: true
fiware-iot-agent-ul | } | comp=IoTAgent
fiware-iot-agent-ul | time=2022-08-23T09:19:33.425Z | lvl=FATAL | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
fiware-iot-agent-ul | time=2022-08-23T09:19:33.426Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: Callback was already called.
fiware-iot-agent-ul | at /opt/iotaul/node_modules/async/dist/async.js:969:32
fiware-iot-agent-ul | at MqttClient.<anonymous> (/opt/iotaul/lib/bindings/MQTTBinding.js:375:17)
fiware-iot-agent-ul | at MqttClient.emit (node:events:539:35)
fiware-iot-agent-ul | at MqttClient.emit (node:domain:475:12)
fiware-iot-agent-ul | at Socket.streamErrorHandler (/opt/iotaul/node_modules/mqtt/lib/client.js:460:12)
fiware-iot-agent-ul | at Socket.emit (node:events:527:28)
fiware-iot-agent-ul | at Socket.emit (node:domain:475:12)
fiware-iot-agent-ul | at emitErrorNT (node:internal/streams/destroy:157:8)
fiware-iot-agent-ul | at emitErrorCloseNT (node:internal/streams/destroy:122:3)
fiware-iot-agent-ul | at processTicksAndRejections (node:internal/process/task_queues:83:21) | comp=IoTAgent
fiware-iot-agent-json | time=2022-08-23T09:19:35.473Z | lvl=INFO | corr=76c65807-e6f8-4ed0-ab3c-ead581e9d6bd | trans=76c65807-e6f8-4ed0-ab3c-ead581e9d6bd | op=IOTAJSON.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connected | comp=IoTAgent
fiware-iot-agent-json | time=2022-08-23T09:19:35.486Z | lvl=ERROR | corr=76c65807-e6f8-4ed0-ab3c-ead581e9d6bd | trans=76c65807-e6f8-4ed0-ab3c-ead581e9d6bd | op=IOTAJSON.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
I'm final student who research and implement Openstack Victoria. When I configure Project: Octavia - Loadbalancer on multi-node - CentOS8, I have a issue. Seem like octavia.amphorae.drivers.haproxy.rest_api_driver couldn't connect to Amphora instance and port 9443 didn't run on my Network Node aka Octavia-API. In controller node, the amphora instance still running nornally. I follow https://www.server-world.info/en/note?os=CentOS_8&p=openstack_victoria4&f=11 to configure my lab. This is my cfg file below, pls help me to figure out. Regards!
I created lb_net in type vxlan and lb-secgroup, when i use command to create lb it still pending-create:
[root#controller ~(keystone)]# openstack loadbalancer --name lb01 --vip-subnet-id subnet1
[root#controller ~(keystone)]# openstack loadbalancer list
+--------------------------------------+------+----------------------------------+---------------+---------------------+------------------+----------+
| id | name | project_id | vip_address | provisioning_status | operating_status | provider |
+--------------------------------------+------+----------------------------------+---------------+---------------------+------------------+----------+
| 96c355b4-cc6e-4e7f-b393-8139602ae0e6 | lb01 | 16b44a414c0e4884a819f0de4e86fa28 | 172.16.10.98 | ERROR | OFFLINE | amphora |
| 10eaed08-9512-4362-b60e-f07351136909 | lb02 | 16b44a414c0e4884a819f0de4e86fa28 | 172.16.10.96 | ERROR | OFFLINE | amphora |
| 3543f208-2b6b-4c41-99d6-13d7056d9966 | lb03 | 16b44a414c0e4884a819f0de4e86fa28 | 172.16.10.32 | ERROR | OFFLINE | amphora |
| e6349a0c-c146-4d1e-abd9-39320ef482f0 | lb04 | 16b44a414c0e4884a819f0de4e86fa28 | 172.16.10.82 | ERROR | OFFLINE | amphora |
| 5f116527-d089-41ce-9491-b8f0fca32f79 | lb05 | 16b44a414c0e4884a819f0de4e86fa28 | 172.16.10.195 | PENDING_CREATE | OFFLINE | amphora |
+--------------------------------------+------+----------------------------------+---------------+---------------------+------------------+----------+
amphora running
[root#controller ~]# openstack server list --all
+--------------------------------------+----------------------------------------------+---------+--------------------------------------+---------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+----------------------------------------------+---------+--------------------------------------+---------+----------+
| 83e113e6-061e-4e41-8ef0-d6c42f80a35c | amphora-611f3678-fb15-428a-88ac-8d34ab6f61e1 | ACTIVE | lb-mgmt-net=172.16.1.208 | Amphora | amphora |
| 7770c395-a24c-49ee-aed1-b483fa0dea08 | CentOS_8 | SHUTOFF | int_net=172.16.10.139, 192.168.1.236 | CentOS8 | m1.small |
+--------------------------------------+----------------------------------------------+---------+--------------------------------------+---------+----------+
my octavia-worker log:
2021-05-07 01:34:52.401 41977 INFO octavia.controller.queue.v1.consumer [-] Starting consumer...
2021-05-07 01:34:52.416 41980 INFO octavia.controller.queue.v2.consumer [-] Starting V2 consumer...
2021-05-07 01:35:05.409 41977 INFO octavia.controller.queue.v1.endpoints [-] Creating load balancer '5f116527-d089-41ce-9491-b8f0fca32f79'...
2021-05-07 01:35:06.662 41977 INFO octavia.network.drivers.neutron.allowed_address_pairs [-] Port 7a0025b4-5ce6-4664-a451-caef1aac1ce3 already exists. Nothing to be done.
2021-05-07 01:35:07.416 41977 INFO octavia.controller.worker.v1.tasks.database_tasks [-] Created Amphora in DB with id 611f3678-fb15-428a-88ac-8d34ab6f61e1
2021-05-07 01:35:07.580 41977 INFO octavia.certificates.generator.local [-] Signing a certificate request using OpenSSL locally.
2021-05-07 01:35:07.581 41977 INFO octavia.certificates.generator.local [-] Using CA Certificate from config.
2021-05-07 01:35:07.581 41977 INFO octavia.certificates.generator.local [-] Using CA Private Key from config.
2021-05-07 01:35:07.581 41977 INFO octavia.certificates.generator.local [-] Using CA Private Key Passphrase from config.
2021-05-07 01:35:55.495 41977 WARNING octavia.amphorae.drivers.haproxy.rest_api_driver [-] Could not connect to instance. Retrying.: requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='172.16.1.208', port=9443): Max retries exceeded with url: // (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e74584f28>, 'Connection to 172.16.1.208 timed out. (connect timeout=10.0)'))
2021-05-07 01:36:10.516 41977 WARNING octavia.amphorae.drivers.haproxy.rest_api_driver [-] Could not connect to instance. Retrying.: requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='172.16.1.208', port=9443): Max retries exceeded with url: // (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e74584ef0>, 'Connection to 172.16.1.208 timed out. (connect timeout=10.0)'))
2021-05-07 01:36:25.531 41977 WARNING octavia.amphorae.drivers.haproxy.rest_api_driver [-] Could not connect to instance. Retrying.: requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='172.16.1.208', port=9443): Max retries exceeded with url: // (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e745913c8>, 'Connection to 172.16.1.208 timed out. (connect timeout=10.0)'))
2021-05-07 01:36:40.539 41977 WARNING octavia.amphorae.drivers.haproxy.rest_api_driver [-] Could not connect to instance. Retrying.: requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='172.16.1.208', port=9443): Max retries exceeded with url: // (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e74591358>, 'Connection to 172.16.1.208 timed out. (connect timeout=10.0)'))
2021-05-07 01:36:55.555 41977 WARNING octavia.amphorae.drivers.haproxy.rest_api_driver [-] Could not connect to instance. Retrying.: requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='172.16.1.208', port=9443): Max retries exceeded with url: // (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e745916a0>, 'Connection to 172.16.1.208 timed out. (connect timeout=10.0)'))
And I check port 9443, it didn't run
[root#controller ~]# netstat -ntlp | grep ":11211"
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 1048/memcached
tcp6 0 0 :::11211 :::* LISTEN 1048/memcached
[root#controller ~]# netstat -ntlp | grep ":9696"
tcp 0 0 0.0.0.0:9696 0.0.0.0:* LISTEN 1066/server.log
[root#controller ~]# netstat -ntlp | grep ":9443"
[root#controller ~]#
vim/etc/octavia/octavia.conf
[DEFAULT]
transport_url = rabbit://openstack:password#10.200.0.4
[api_settings]
bind_host = 10.200.0.41
bind_port = 9876
auth_strategy = keystone
api_base_uri = http://10.200.0.41:9876
[database]
connection = mysql+pymysql://octavia:password#10.200.0.4/octavia
[health_manager]
bind_ip = 0.0.0.0
bind_port = 5555
[keystone_authtoken]
www_authenticate_uri = http://10.200.0.4:5000
auth_url = http://10.200.0.4:5000
memcached_servers = 10.200.0.4:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = octavia
password = servicepassword
[certificates]
ca_private_key = /etc/octavia/certs/private/server_ca.key.pem
ca_certificate = /etc/octavia/certs/server_ca.cert.pem
server_certs_key_passphrase = insecure-key-do-not-use-this-key
ca_private_key_passphrase = not-secure-passphrase
[haproxy_amphora]
bind_host = 10.200.0.41
bind_port = 9443
server_ca = /etc/octavia/certs/server_ca-chain.cert.pem
client_cert = /etc/octavia/certs/private/client.cert-and-key.pem
[controller_worker]
client_ca = /etc/octavia/certs/client_ca.cert.pem
amp_image_tag = Amphora
# specify [flavor] ID for Amphora instance
amp_flavor_id = 100
# specify security group ID Amphora instance
amp_secgroup_list = b02c2f59-9fff-4428-accc-2bd9a7a337e5
# specify network ID to boot Amphora instance
amp_boot_network_list = e05c8fe4-9a6d-4192-b9b5-7d7a2ba11df8
network_driver = allowed_address_pairs_driver
compute_driver = compute_nova_driver
amphora_driver = amphora_haproxy_rest_driver
[oslo_messaging]
topic = octavia_prov
[service_auth]
auth_url = http://10.200.0.4:5000
memcached_servers = 10.200.0.4:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = octavia
password = servicepassword
I login user root on amphora-instance and check port 9443, it running well.
root#amphora-f36ed983-6d14-46a6-b686-8942379f2580:netstat -lntp | grep ":9443"
tcp 0 0 controller-ip:9443 0.0.0.0:* LISTEN 697/gunicorn: maste
And try netstat -plane | grep :"9443" on controller node (I don't know what command mean, I see it on other group)
[root#controller ~(keystone)]# netstat -plane | grep ":9443"
tcp 0 1 192.168.1.3:54416 172.16.1.100:9443 SYN_SENT 966 108134 2773/octavia-worker
In my octavia.cfg, I didn't use health_manager service so I set bind_host = 0.0.0.0 . In other hand, I ignore to create OCTAVIA_MGMT_PORT_IP (step 7-8) at octavia-configure-docs. Did I wrong with it ?.
Okay, my problem is fixed. The Octavia-api node can't connect to amphorae-instance because they do not match the same network type (node - LAN and amphorae - VXLAN). So, I create a bridge interface at a node to convert vxlan for lan can connect (You can read here at step 7: create a network).
Best regard!
I just deployed Alfresco community last version using Its official docker compose file. the content services fails to start. this is the related logs :
alfresco_1 | 2020-04-27 08:22:27,267 WARN [repo.admin.ConfigurationChecker] [localhost-startStop-1] The 'dir.root' property is set to a relative path './alf_data'. 'dir.root' should be overridden to point to a specific folder.
alfresco_1 | 2020-04-27 08:22:27,267 INFO [repo.admin.ConfigurationChecker] [localhost-startStop-1] The root data directory ('dir.root') is: ./alf_data
alfresco_1 | 2020-04-27 08:22:27,282 ERROR [repo.admin.ConfigurationChecker] [localhost-startStop-1] CONTENT INTEGRITY ERROR: System content not found in content store: 'store://2020/4/27/6/51/f4d50bf1-e33a-4d06-8c58-6d09ced6a4db.bin'
alfresco_1 | 2020-04-27 08:22:27,282 ERROR [repo.admin.ConfigurationChecker] [localhost-startStop-1] Ensure that the 'dir.root' property './alf_data' is pointing to the correct data location.
alfresco_1 | 2020-04-27 08:22:27,288 ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
alfresco_1 | org.alfresco.error.AlfrescoRuntimeException: 03270018 Ensure that the 'dir.root' property './alf_data' is pointing to the correct data location.
alfresco_1 | at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:212)
alfresco_1 | at org.alfresco.repo.admin.ConfigurationChecker.access$0(ConfigurationChecker.java:167)
alfresco_1 | at org.alfresco.repo.admin.ConfigurationChecker$1$1.doWork(ConfigurationChecker.java:155)
alfresco_1 | at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602)
alfresco_1 | at org.alfresco.repo.admin.ConfigurationChecker$1.execute(ConfigurationChecker.java:151)
alfresco_1 | at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
alfresco_1 | at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
alfresco_1 | at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.java:161)
alfresco_1 | at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
alfresco_1 | at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221)
alfresco_1 | at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186)
alfresco_1 | at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206)
alfresco_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
alfresco_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
alfresco_1 | at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
alfresco_1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
alfresco_1 | at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
alfresco_1 | at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
alfresco_1 | at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
alfresco_1 | at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
alfresco_1 | at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
alfresco_1 | at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
alfresco_1 | at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
alfresco_1 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
alfresco_1 | at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:129)
alfresco_1 | at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:150)
alfresco_1 | at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140)
alfresco_1 | at java.base/java.security.AccessController.doPrivileged(Native Method)
alfresco_1 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:717)
alfresco_1 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
alfresco_1 | at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
alfresco_1 | at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
alfresco_1 | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
alfresco_1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
alfresco_1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
alfresco_1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
alfresco_1 | at java.base/java.lang.Thread.run(Thread.java:834)
alfresco_1 | 27-Apr-2020 08:22:27.292 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
alfresco_1 | 27-Apr-2020 08:22:27.298 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/alfresco] startup failed due to previous errors
when I remove all docker volumes and start docker and deploy Alfresco it works fine, but after I stop the containers and re-run I get this error again.
what is the problem?
The controller version is 0.5.3-boron-sr3.I want to use the openflow-provider-config.When I config some features such as basic-timer-delay or maximum-timer-delay,error occurs.Can someone give me some help?
the location of api on dlux is YangUi---> openflow-provider-config
enter image description here
error on controller:
opendaylight-user#root>Exception in thread "Thread-115" io.netty.channel.unix.Errors$NativeIoException: bind() failed: Address already in use
at io.netty.channel.unix.Errors.newIOException(Errors.java:117)
at io.netty.channel.unix.Socket.bind(Socket.java:234)
at io.netty.channel.epoll.EpollServerSocketChannel.doBind(EpollServerSocketChannel.java:91)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:501)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1218)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481)
at io.netty.channel.ChannelDuplexHandler.bind(ChannelDuplexHandler.java:38)
at io.netty.handler.logging.LoggingHandler.bind(LoggingHandler.java:197)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:965)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:210)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:307)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-116" io.netty.channel.unix.Errors$NativeIoException: bind() failed: Address already in use
at io.netty.channel.unix.Errors.newIOException(Errors.java:117)
at io.netty.channel.unix.Socket.bind(Socket.java:234)
at io.netty.channel.epoll.EpollServerSocketChannel.doBind(EpollServerSocketChannel.java:91)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:501)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481)
at io.netty.channel.ChannelDuplexHandler.bind(ChannelDuplexHandler.java:38)
at io.netty.handler.logging.LoggingHandler.bind(LoggingHandler.java:197)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:965)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:210)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:307)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:748)
I think it may be because of MXbean.
log:
2018-06-25 02:40:32,061 | INFO | rint Extender: 1 | penFlowPluginProviderFactoryImpl | 283 - org.opendaylight.openflowplugin.impl - 0.3.3.Boron-SR3 | Initializing new OFP southbound.
2018-06-25 02:40:32,062 | WARN | rint Extender: 1 | OpenFlowPluginProviderImpl | 283 - org.opendaylight.openflowplugin.impl - 0.3.3.Boron-SR3 | Error registering MBean {}
javax.management.InstanceAlreadyExistsException: MXBean already registered with name org.opendaylight.openflowplugin.impl.statistics.ofpspecific:type=MessageIntelligenceAgencyMXBean
at com.sun.jmx.mbeanserver.MXBeanLookup.addReference(MXBeanLookup.java:151)[:1.8.0_161]
at com.sun.jmx.mbeanserver.MXBeanSupport.register(MXBeanSupport.java:160)[:1.8.0_161]
at com.sun.jmx.mbeanserver.MBeanSupport.preRegister2(MBeanSupport.java:173)[:1.8.0_161]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:930)[:1.8.0_161]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)[:1.8.0_161]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)[:1.8.0_161]
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)[:1.8.0_161]
at org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl.registerMXBean(OpenFlowPluginProviderImpl.java:348)
at org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl.initialize(OpenFlowPluginProviderImpl.java:246)
at org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderFactoryImpl.newInstance(OpenFlowPluginProviderFactoryImpl.java:72)
at Proxyab469c41_6f94_4025_a6cc_f1fbc7690302.newInstance(Unknown Source)
at Proxy593609e1_c872_4bfb_8045_8c5f6de0736b.newInstance(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_161]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromFactory(BeanRecipe.java:295)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:278)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:830)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[15:org.apache.aries.blueprint.core:1.6.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_161]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:285)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:252)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.ServiceRecipe.internalCreate(ServiceRecipe.java:149)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[15:org.apache.aries.blueprint.core:1.6.1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_161]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:186)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:724)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:411)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:276)[15:org.apache.aries.blueprint.core:1.6.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_161]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_161]
at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)[15:org.apache.aries.blueprint.core:1.6.1]
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[15:org.apache.aries.blueprint.core:1.6.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_161]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_161]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_161]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_161]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_161]
before you start the controller, check which ports you have running. ODL is going
to want to listen on a few, but most notably for your case would be 6633, 6653 (both
for openflow) and 8181 (for restconf). If any of those are already running, you'll
likely hit that bind() failed error.
I’ve created a simple maven project that demonstrates Spring MVC accepts a request and returns a JSON object.
Here’s the pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bg-SpringREST3.1</groupId>
<artifactId>RESTexample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.5</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.hibernate</groupId> -->
<!-- <artifactId>hibernate-validator</artifactId> -->
<!-- <version>4.3.0.Final</version> -->
<!-- </dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.13.v20130916</version> </plugin>
</plugins>
</build>
Here's the web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>JSON and XML RESTful web service example</display-name>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/application.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Here's the application context
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<mvc:annotation-driven />
<!-- Use the message-converters element to specify the orders of message converters -->
<!--
<mvc:annotation-driven>
<mvc:message-converters register-defaults="false">
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
<bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter" />
</mvc:message-converters>
</mvc:annotation-driven>
-->
<context:component-scan base-package="integration.apps" />
Here is my RESTController.java
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
#Controller
public class RESTController {
#RequestMapping("/users/{id}")
#ResponseBody
public User getUser(#PathVariable Long id, #RequestHeader("Accept") String acceptHeader) {
return new User(id, "John Doe");
}
}
And my User.java
public class User {
private Long id;
private String name;
public User() {
}
public User(Long id, String name) {
this.id = id;
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
As far as I’m aware, I’m not using any validation. When I package the project and run Jetty within Eclipse, I receive no errors and the response to
http://localhost:8080/users/5
is
{"id":5,"name":"John Doe"}
Now I deploy the application in Mule following these steps
Create the following folder structure under scr/main/app/webapps
Drop the war file to this location
The mule configuration is as follows
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty.xsd">
<jetty:connector name="jettyConnector">
<jetty:webapps directory="${app.home}/webapps" port="8083" />
</jetty:connector>
</mule>
Running dependency tree outside of Mule Anypoint studio. Note - I need to "mavenize" the mule project achieve this
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # RESTexample ---
[INFO] bg-SpringREST3.1:RESTexample:war:0.0.1-SNAPSHOT
[INFO] +- org.springframework:spring-web:jar:3.2.1.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.2.1.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.2.1.RELEASE:compile
[INFO] \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.5:compile
[INFO] \- org.codehaus.jackson:jackson-core-asl:jar:1.9.5:compile
Running dependency tree inside Mule Anypoint studio
[INFO] com.mycompany:springresttest:mule:1.0.0-SNAPSHOT
[INFO] +- org.mule:mule-core:jar:3.5.0:provided
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.0:provided
[INFO] | +- com.github.stephenc.eaio-uuid:uuid:jar:3.4.0:provided
[INFO] | | \- com.github.stephenc.eaio-grabbag:grabbag:jar:1.8.1:provided
[INFO] | +- commons-cli:commons-cli:jar:1.2:provided
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:provided
[INFO] | +- commons-io:commons-io:jar:1.4:provided
[INFO] | +- commons-lang:commons-lang:jar:2.4:provided
[INFO] | +- commons-pool:commons-pool:jar:1.6:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.1:provided
[INFO] | +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.6.1:provided
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.1:provided
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.6.1:provided
[INFO] | +- log4j:log4j:jar:1.2.16:provided
[INFO] | +- asm:asm:jar:3.1:provided
[INFO] | +- asm:asm-commons:jar:3.1:provided
[INFO] | | \- asm:asm-tree:jar:3.1:provided
[INFO] | +- org.mule.mvel:mule-mvel2:jar:2.1.9-MULE-003:provided
[INFO] | +- org.jgrapht:jgrapht-jdk1.5:jar:0.7.3:provided
[INFO] | +- org.mule.common:mule-common:jar:3.5.0:provided
[INFO] | | +- org.apache.xmlbeans:xmlbeans:jar:2.3.0:provided
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:provided
[INFO] | | \- org.antlr:antlr-runtime:jar:3.5:provided
[INFO] | | \- org.antlr:stringtemplate:jar:3.2.1:provided
[INFO] | \- com.google.guava:guava:jar:16.0.1:provided
[INFO] +- org.mule.modules:mule-module-spring-config:jar:3.5.0:provided
[INFO] | +- org.mule.modules:mule-module-annotations:jar:3.5.0:provided
[INFO] | | \- cglib:cglib-nodep:jar:2.2:provided
[INFO] | +- org.springframework:spring-context:jar:3.2.1.RELEASE:provided
[INFO] | | \- org.springframework:spring-expression:jar:3.2.1.RELEASE:provided
[INFO] | +- dom4j:dom4j:jar:1.6.1:provided
[INFO] | \- jaxen:jaxen:jar:1.1.1:provided
[INFO] +- org.mule.transports:mule-transport-file:jar:3.5.0:provided
[INFO] +- org.mule.transports:mule-transport-http:jar:3.5.0:provided
[INFO] | +- org.mule.transports:mule-transport-ssl:jar:3.5.0:provided
[INFO] | +- commons-codec:commons-codec:jar:1.3:provided
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:provided
[INFO] | +- tomcat:tomcat-util:jar:5.5.23:provided
[INFO] | | \- tomcat:tomcat-apr:jar:5.5.23:provided
[INFO] | +- org.samba.jcifs:jcifs:jar:1.3.3:provided
[INFO] | \- joda-time:joda-time:jar:1.6:provided
[INFO] +- org.mule.transports:mule-transport-jdbc:jar:3.5.0:provided
[INFO] | +- commons-dbutils:commons-dbutils:jar:1.2:provided
[INFO] | \- com.experlog:xapool:jar:1.5.0:provided
[INFO] +- org.mule.transports:mule-transport-jms:jar:3.5.0:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1:provided
[INFO] | \- org.springframework:spring-jms:jar:3.2.1.RELEASE:provided
[INFO] | \- org.springframework:spring-tx:jar:3.2.1.RELEASE:provided
[INFO] +- org.mule.transports:mule-transport-vm:jar:3.5.0:provided
[INFO] +- org.mule.modules:mule-module-client:jar:3.5.0:provided
[INFO] +- org.mule.modules:mule-module-cxf:jar:3.5.0:provided
[INFO] | +- org.apache.cxf:cxf-rt-core:jar:2.5.9:provided
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.5.9:provided
[INFO] | | | +- org.apache.neethi:neethi:jar:3.0.2:provided
[INFO] | | | \- wsdl4j:wsdl4j:jar:1.6.2:provided
[INFO] | | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.3:provided
[INFO] | +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.5.9:provided
[INFO] | | \- org.apache.cxf:cxf-rt-bindings-soap:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.5.9:provided
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:provided
[INFO] | | \- org.apache.cxf:cxf-rt-bindings-xml:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-databinding-aegis:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.5.9:provided
[INFO] | | \- com.sun.xml.bind:jaxb-xjc:jar:2.2.5.1:provided
[INFO] | +- org.apache.cxf:cxf-rt-databinding-jibx:jar:2.5.9:provided
[INFO] | | +- org.apache.cxf:cxf-tools-common:jar:2.5.9:provided
[INFO] | | +- org.jibx:jibx-run:jar:1.2.4.5:provided
[INFO] | | | \- xpp3:xpp3:jar:1.1.3.4.O:provided
[INFO] | | \- org.jibx:jibx-schema:jar:1.2.4.5:provided
[INFO] | | \- org.jibx:jibx-extras:jar:1.2.4.5:provided
[INFO] | | \- org.jdom:jdom:jar:1.1.3:provided
[INFO] | +- org.apache.cxf:cxf-rt-transports-local:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-ws-security:jar:2.5.9:provided
[INFO] | | +- org.apache.cxf:cxf-common-utilities:jar:2.5.9:provided
[INFO] | | \- org.apache.ws.security:wss4j:jar:1.6.9:provided
[INFO] | | +- org.apache.santuario:xmlsec:jar:1.5.3:provided
[INFO] | | \- org.opensaml:opensaml:jar:2.5.1-1:provided
[INFO] | | \- org.opensaml:openws:jar:1.4.2-1:provided
[INFO] | | \- org.opensaml:xmltooling:jar:1.3.2-1:provided
[INFO] | +- org.apache.cxf:cxf-rt-ws-rm:jar:2.5.9:provided
[INFO] | | \- org.apache.cxf:cxf-rt-management:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-ws-addr:jar:2.5.9:provided
[INFO] | +- org.apache.cxf:cxf-rt-transports-http:jar:2.5.9:provided
[INFO] | | +- org.apache.cxf:cxf-rt-transports-common:jar:2.5.9:provided
[INFO] | | \- org.springframework:spring-web:jar:3.0.6.RELEASE:provided
[INFO] | +- org.apache.cxf:cxf-wstx-msv-validation:jar:2.5.9:provided
[INFO] | | \- net.java.dev.msv:msv-core:jar:2011.1:provided
[INFO] | | +- com.sun.msv.datatype.xsd:xsdlib:jar:2010.1:provided
[INFO] | | +- isorelax:isorelax:jar:20030108:provided
[INFO] | | \- relaxngDatatype:relaxngDatatype:jar:20020414:provided
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3:provided
[INFO] | | \- javax.xml.soap:saaj-api:jar:1.3:provided
[INFO] | +- org.mule.modules:mule-module-spring-security:jar:3.5.0:provided
[INFO] | | +- org.mule.modules:mule-module-spring-extras:jar:3.5.0:provided
[INFO] | | | +- org.springframework:spring-jdbc:jar:3.2.1.RELEASE:provided
[INFO] | | | \- org.springframework:spring-context-support:jar:3.2.1.RELEASE:provided
[INFO] | | +- org.springframework.security:spring-security-core:jar:3.1.0.RELEASE:provided
[INFO] | | | \- org.springframework.security:spring-security-crypto:jar:3.1.0.RELEASE:provided
[INFO] | | +- org.springframework.security:spring-security-config:jar:3.1.0.RELEASE:provided
[INFO] | | +- org.springframework.security:spring-security-web:jar:3.1.0.RELEASE:provided
[INFO] | | +- org.springframework.security:spring-security-ldap:jar:3.1.0.RELEASE:provided
[INFO] | | | \- org.springframework.ldap:spring-ldap-core:jar:1.3.1.RELEASE:provided
[INFO] | | +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:provided
[INFO] | | \- org.aspectj:aspectjrt:jar:1.6.11:provided
[INFO] | +- org.mule.transports:mule-transport-tcp:jar:3.5.0:provided
[INFO] | +- net.sourceforge.saxon:saxon:jar:9.1.0.8:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-annotation_1.1_spec:jar:1.0.1:provided
[INFO] | +- org.springframework:spring-beans:jar:3.2.1.RELEASE:provided
[INFO] | +- org.springframework:spring-core:jar:3.2.1.RELEASE:provided
[INFO] | +- javax.mail:mail:jar:1.4.3:provided
[INFO] | +- javax.xml.ws:jaxws-api:jar:2.2.1:provided
[INFO] | | \- javax.jws:jsr181-api:jar:1.0-MR1:provided
[INFO] | \- org.apache.ant:ant:jar:1.7.0:provided
[INFO] | \- org.apache.ant:ant-launcher:jar:1.7.0:provided
[INFO] +- org.mule.modules:mule-module-management:jar:3.5.0:provided
[INFO] | +- mx4j:mx4j-jmx:jar:2.1.1:provided
[INFO] | +- mx4j:mx4j-impl:jar:2.1.1:provided
[INFO] | +- mx4j:mx4j-tools:jar:2.1.1:provided
[INFO] | +- mx4j:mx4j-remote:jar:2.1.1:provided
[INFO] | +- com.yourkit:yjp-controller-api-redist:jar:9.0.8:provided
[INFO] | \- tanukisoft:wrapper:jar:3.2.3:provided
[INFO] +- org.mule.modules:mule-module-scripting:jar:3.5.0:provided
[INFO] | +- org.springframework:spring-aop:jar:3.2.1.RELEASE:provided
[INFO] | | \- aopalliance:aopalliance:jar:1.0:provided
[INFO] | +- org.mule.modules:mule-module-builders:jar:3.5.0:provided
[INFO] | +- org.livetribe:livetribe-jsr223:jar:2.0.5:provided
[INFO] | \- org.codehaus.groovy:groovy-all:jar:1.8.6:provided
[INFO] +- org.mule.modules:mule-module-sxc:jar:3.5.0:provided
[INFO] | +- com.envoisolutions.sxc:sxc-xpath:jar:0.7.3:provided
[INFO] | +- com.envoisolutions.sxc:sxc-runtime:jar:0.7.3:provided
[INFO] | \- com.envoisolutions.sxc:sxc-core:jar:0.7.3:provided
[INFO] +- org.mule.modules:mule-module-xml:jar:3.5.0:provided
[INFO] | +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:provided
[INFO] | +- commons-jxpath:commons-jxpath:jar:1.3:provided
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.4.2:provided
[INFO] | | \- xmlpull:xmlpull:jar:1.1.3.1:provided
[INFO] | +- xpp3:xpp3_min:jar:1.1.3.4.O:provided
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.4:provided
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.1:provided
[INFO] | +- net.java.dev.stax-utils:stax-utils:jar:20080702:provided
[INFO] | +- net.sourceforge.saxon:saxon:jar:dom:9.1.0.8:provided
[INFO] | +- net.sourceforge.saxon:saxon:jar:xqj:9.1.0.8:provided
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.1.5:provided
[INFO] +- org.mule.tests:mule-tests-functional:jar:3.5.0:test
[INFO] | +- commons-net:commons-net:jar:2.0:test
[INFO] | +- org.apache.ftpserver:ftpserver-core:jar:1.0.2:test
[INFO] | | \- org.apache.mina:mina-core:jar:2.0.0-M6:test
[INFO] | +- org.apache.ftpserver:ftplet-api:jar:1.0.2:test
[INFO] | +- org.apache.sshd:sshd-core:jar:0.6.0:test
[INFO] | +- org.bouncycastle:bcprov-jdk16:jar:1.46:test
[INFO] | +- org.mule:mule-core:test-jar:tests:3.5.0:test
[INFO] | \- org.mockito:mockito-all:jar:1.9.0:test
[INFO] +- mockobjects:mockobjects-core:jar:0.09:test
[INFO] \- junit:junit:jar:4.9:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.1:test
Finally, the .classpath file for the project
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Now, when I run the mule application (Mule server 3.5.0 CE) I get the following error
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to find a default provider
Which is fine, if I uncomment the pom.xml entry on my rest project, I can run successfully in Mule.
So, my question, what is the difference between running the app in Eclipse with Jetty plugin and running in Mule again on Jetty.