The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

ukari (7) [Avatar] Offline
#1
Tutorial unclear on page 23 of the MEAP v14 of Mule In Action. Specifically - ...after posting "some JSON" using tool such as curl or Rest Console to localhost:8080/products.... .

product_registration.xml:

<?xml version="1.0" encoding="UTF-8"?>

<mule omit rest of headers>>
<jms:activemq-connector name="Active_MQ" specification="1.1" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/>
<flow name="product_registrationFlow1" doc:name="product_registrationFlow1">
<http:inbound-endpoint exchange-pattern="one-way" host="localhost" port="8082" path="products" doc:name="HTTP"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<logger message="We received a message: #[payload]" level="INFO" doc:name="Logger"/>
<jms:outbound-endpoint queue="products" connector-ref="Active_MQ" doc:name="JMS"/>
</flow>
</mule>

Console tab within Mule Studio:
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@17072b90.
log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@17072b90 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader sun.misc.Launcher$AppClassLoader@17072b90.
log4j: Using URL [jar:file:/C:/MuleStudio/plugins/org.mule.tooling.server.3.4.1.ee_3.4.1.201308021927/mule/tooling/tooling-support-3.4.1.jar!/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL jar:file:/C:/MuleStudio/plugins/org.mule.tooling.server.3.4.1.ee_3.4.1.201308021927/mule/tooling/tooling-support-3.4.1.jar!/log4j.properties
log4j: Parsing for [root] with value=[INFO, console].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "console".
log4j: Parsing layout options for "console".
log4j: Setting property [conversionPattern] to [%-5p %d [%t] %c: %m%n].
log4j: End of parsing for "console".
log4j: Parsed "console" options.
log4j: Parsing for [com.mycompany] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category com.mycompany set to DEBUG
log4j: Handling log4j.additivity.com.mycompany=[null]
log4j: Parsing for [org.springframework.beans.factory] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org.springframework.beans.factory set to WARN
log4j: Handling log4j.additivity.org.springframework.beans.factory=[null]
log4j: Parsing for [org.apache] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org.apache set to WARN
log4j: Handling log4j.additivity.org.apache=[null]
log4j: Parsing for [Tracking] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category Tracking set to WARN
log4j: Handling log4j.additivity.Tracking=[null]
log4j: Parsing for [org.jetel] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org.jetel set to WARN
log4j: Handling log4j.additivity.org.jetel=[null]
log4j: Parsing for [org.mule] with value=[INFO].
log4j: Level token is [INFO].
log4j: Category org.mule set to INFO
log4j: Handling log4j.additivity.org.mule=[null]
log4j: Parsing for [com.mulesoft] with value=[INFO].
log4j: Level token is [INFO].
log4j: Category com.mulesoft set to INFO
log4j: Handling log4j.additivity.com.mulesoft=[null]
log4j: Parsing for [org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog] with value=[ERROR].
log4j: Level token is [ERROR].
log4j: Category org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog set to ERROR
log4j: Handling log4j.additivity.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=[null]
log4j: Finished configuring.
Deploying application: product_registration
Reading plugins from: C:/MuleStudio/plugins/org.mule.tooling.server.3.4.1.ee_3.4.1.201308021927/mule/plugins
INFO 2013-12-30 11:42:24,355 [main] com.mulesoft.mule.plugin.manager.MulePluginManager: Registering plugin: anypoint-plugin-3.0.1
INFO 2013-12-30 11:42:24,373 [main] com.mulesoft.mule.plugin.manager.MulePluginManager: Registering plugin: mule-plugin-debugger-3.4.1
INFO 2013-12-30 11:42:24,418 [main] com.mulesoft.habitat.agent.AnypointAgentUtils: Anypoint Service Registry Agent is DISABLED. Property anypoint.agent.token is missing or empty.
INFO 2013-12-30 11:42:24,428 [main] org.mule.module.launcher.application.DefaultMuleApplication:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ New app 'product_registration' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2013-12-30 11:42:24,510 [main] org.mule.module.launcher.MuleApplicationClassLoader: [product_registration] Loading the following jars:
=============================
file:/C:/Users/ukari/MuleStudio/workspace/.mule/apps/product_registration/lib/activemq-all-5.9.0.jar
=============================

INFO 2013-12-30 11:42:24,513 [main] org.mule.module.launcher.application.DefaultMuleApplication:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Initializing app 'product_registration' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2013-12-30 11:42:24,719 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising RegistryBroker
INFO 2013-12-30 11:42:24,832 [main] org.mule.config.spring.MuleApplicationContext: Refreshing org.mule.config.spring.MuleApplicationContext@23f23303: startup date [Mon Dec 30 11:42:24 HST 2013]; root of context hierarchy
INFO 2013-12-30 11:42:26,513 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising model: _muleSystemModel
INFO 2013-12-30 11:42:26,571 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: Active_MQ
WARN 2013-12-30 11:42:26,622 [main] org.springframework.beans.GenericTypeAwarePropertyDescriptor: Invalid JavaBean property 'port' being accessed! Ambiguous write methods found next to actually used [public void org.mule.endpoint.URIBuilder.setPort(java.lang.String)]: [public void org.mule.endpoint.URIBuilder.setPort(int)]
INFO 2013-12-30 11:42:26,690 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: connector.http.mule.default
INFO 2013-12-30 11:42:26,740 [main] org.mule.construct.FlowConstructLifecycleManager: Initialising flow: product_registrationFlow1
INFO 2013-12-30 11:42:26,740 [main] org.mule.exception.DefaultMessagingExceptionStrategy: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@2cda5a9b
INFO 2013-12-30 11:42:26,754 [main] org.mule.processor.SedaStageLifecycleManager: Initialising service: product_registrationFlow1.stage1
INFO 2013-12-30 11:42:26,769 [main] org.mule.config.builders.AutoConfigurationBuilder: Configured Mule using "org.mule.config.spring.SpringXmlConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='C:UsersukariMuleStudioworkspace.muleappsproduct_registrationproduct_registration.xml'}]"
INFO 2013-12-30 11:42:26,769 [main] org.mule.config.builders.AutoConfigurationBuilder: Configured Mule using "org.mule.config.builders.AutoConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='C:UsersukariMuleStudioworkspace.muleappsproduct_registrationproduct_registration.xml'}]"
INFO 2013-12-30 11:42:26,769 [main] org.mule.module.launcher.application.DefaultMuleApplication: Monitoring for hot-deployment: C:UsersukariMuleStudioworkspace.muleappsproduct_registrationproduct_registration.xml
INFO 2013-12-30 11:42:26,771 [main] org.mule.module.launcher.application.DefaultMuleApplication:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Starting app 'product_registration' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2013-12-30 11:42:26,773 [main] org.mule.util.queue.TransactionalQueueManager: Starting ResourceManager
INFO 2013-12-30 11:42:26,784 [main] org.mule.util.queue.TransactionalQueueManager: Started ResourceManager
INFO 2013-12-30 11:42:26,787 [main] org.mule.transport.http.HttpConnector: Connected: HttpConnector
{
name=connector.http.mule.default
lifecycle=initialise
this=3382236d
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}

INFO 2013-12-30 11:42:26,787 [main] org.mule.transport.http.HttpConnector: Starting: HttpConnector
{
name=connector.http.mule.default
lifecycle=initialise
this=3382236d
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}

INFO 2013-12-30 11:42:26,787 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: connector.http.mule.default
INFO 2013-12-30 11:42:27,099 [main] org.mule.transport.jms.activemq.ActiveMQJmsConnector: Connected: ActiveMQJmsConnector
{
name=Active_MQ
lifecycle=initialise
this=33b1594e
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[jms]
serviceOverrides=<none>
}

INFO 2013-12-30 11:42:27,099 [main] org.mule.transport.jms.activemq.ActiveMQJmsConnector: Starting: ActiveMQJmsConnector
{
name=Active_MQ
lifecycle=initialise
this=33b1594e
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[jms]
serviceOverrides=<none>
}

INFO 2013-12-30 11:42:27,099 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: Active_MQ
INFO 2013-12-30 11:42:27,127 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting model: _muleSystemModel
INFO 2013-12-30 11:42:27,128 [main] org.mule.construct.FlowConstructLifecycleManager: Starting flow: product_registrationFlow1
INFO 2013-12-30 11:42:27,129 [main] org.mule.processor.SedaStageLifecycleManager: Starting service: product_registrationFlow1.stage1
INFO 2013-12-30 11:42:27,134 [main] org.mule.transport.http.HttpConnector: Registering listener: product_registrationFlow1 on endpointUri: http://localhost:8082/products
INFO 2013-12-30 11:42:27,138 [main] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse
INFO 2013-12-30 11:42:27,150 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'null'. Object is: HttpMessageReceiver
INFO 2013-12-30 11:42:27,152 [main] org.mule.transport.http.HttpMessageReceiver: Connecting clusterizable message receiver
INFO 2013-12-30 11:42:27,158 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'null'. Object is: HttpMessageReceiver
INFO 2013-12-30 11:42:27,158 [main] org.mule.transport.http.HttpMessageReceiver: Starting clusterizable message receiver
INFO 2013-12-30 11:42:27,164 [main] org.mule.module.launcher.application.DefaultMuleApplication: Reload interval: 3000
INFO 2013-12-30 11:42:27,165 [main] org.mule.module.management.agent.WrapperManagerAgent: This JVM hasn't been launched by the wrapper, the agent will not run.
INFO 2013-12-30 11:42:27,177 [main] org.mule.module.management.agent.JmxAgent: Attempting to register service with name: Mule.product_registration:type=Endpoint,service="product_registrationFlow1",connector=connector.http.mule.default,name="endpoint.http.localhost.8082.products"
INFO 2013-12-30 11:42:27,177 [main] org.mule.module.management.agent.JmxAgent: Registered Endpoint Service with name: Mule.product_registration:type=Endpoint,service="product_registrationFlow1",connector=connector.http.mule.default,name="endpoint.http.localhost.8082.products"
INFO 2013-12-30 11:42:27,178 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.product_registration:type=Connector,name="connector.http.mule.default.1"
INFO 2013-12-30 11:42:27,178 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.product_registration:type=Connector,name="Active.MQ"
INFO 2013-12-30 11:42:27,180 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: product_registration *
* OS encoding: Cp1252, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2013-12-30 11:42:27,182 [main] org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'product_registration' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ukari (7) [Avatar] Offline
#2
Re: Product Registration - Demo/Tutorial in First Chapter - curl / REST console
Answering my own question (Windows 64-bit environment)

Step 1. Download REST client CURL from
http://www.confusedbycode.com/curl/#downloads
Step 2: Install on your PC
Step 3: From command line type:

curl -X POST -H "Content-Type: application/json" -d "{"name":"Widget","price":9.99,"weight":1.0,"sku": "abcd-12345"}" http://localhost:8082/products

Should see the following in Mule Studio Console:
INFO 2013-12-30 11:43:58,968 [[product_registration].product_registrationFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: We received a message: {"name":"Widget","price":9.99,"weight":1.0,"sku": "abcd-12345"}
INFO 2013-12-30 11:43:58,983 [[product_registration].Active_MQ.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.jms.transformers.ObjectToJMSMessage
INFO 2013-12-30 11:43:58,983 [[product_registration].Active_MQ.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.jms.transformers.ObjectToJMSMessage
WARN 2013-12-30 11:43:58,983 [[product_registration].Active_MQ.dispatcher.01] com.mulesoft.mule.transport.jms.EeJmsMessageDispatcher: Starting patched JmsMessageReceiver
INFO 2013-12-30 11:43:58,983 [[product_registration].Active_MQ.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Active_MQ.dispatcher.1994520511'. Object is: EeJmsMessageDispatcher
INFO 2013-12-30 11:43:58,984 [[product_registration].Active_MQ.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Active_MQ.dispatcher.1994520511'. Object is: EeJmsMessageDispatcher
WARN 2013-12-30 11:43:59,020 [[product_registration].Active_MQ.dispatcher.01] org.mule.transport.jms.JmsMessageUtils: Header: Content-Type is not compliant with JMS specification (sec. 3.5.1, 3.8.1.1). It will cause problems in your and other applications. Please update your application code to correct this. Mule renamed it to Content_Type