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.

209181 (2) [Avatar] Offline
#1
I am using this config
Mule ESB and Integration Platform *
* Version: 3.6.0 Build: ed775fdb *
* MuleSoft, Inc. *
* For more information go to *
* http://www.mulesoft.com/mule-esb-enterprise *
* *
* Server started: 27/02/15 16:07 *
* JDK: 1.7.0_71 (mixed mode) *
* OS: Mac OS X (10.10.2, x86_64) *
* Host: MBP-de-Nicolas (192.168.2.24)




INFO 2015-02-27 16:07:39,763 [[product_registration].HTTP_Listener_Configuration.worker.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.jms.transformers.ObjectToJMSMessage
INFO 2015-02-27 16:07:39,764 [[product_registration].HTTP_Listener_Configuration.worker.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.jms.transformers.ObjectToJMSMessage
WARN 2015-02-27 16:07:39,765 [[product_registration].HTTP_Listener_Configuration.worker.01] com.mulesoft.mule.transport.jms.EeJmsMessageDispatcher: Starting patched JmsMessageReceiver
INFO 2015-02-27 16:07:39,766 [[product_registration].HTTP_Listener_Configuration.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Active_MQ1.dispatcher.1460166564'. Object is: EeJmsMessageDispatcher
INFO 2015-02-27 16:07:39,769 [[product_registration].HTTP_Listener_Configuration.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Active_MQ1.dispatcher.1460166564'. Object is: EeJmsMessageDispatcher
WARN 2015-02-27 16:07:39,803 [[product_registration].HTTP_Listener_Configuration.worker.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
INFO 2015-02-27 16:07:39,815 [[product_registration].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor:
org.mule.DefaultMuleMessage
{
id=5f0ba9a0-be92-11e4-94dd-eacfcf4ede93
payload=java.lang.String
correlationId=<not set>
correlationGroup=-1
correlationSeq=-1
encoding=UTF-8
exceptionPayload=<not set>

Message properties:
INVOCATION scoped properties:
INBOUND scoped properties:
accept=*/*
content-length=51
content-type=application/json
host=localhost:8084
http.listener.path=/products/
http.method=POST
http.query.params=org.mule.module.http.internal.ParameterMap@0
http.query.string=
http.remote.address=/127.0.0.1:54462
http.request.path=/products
http.request.uri=/products
http.scheme=http
http.uri.params=org.mule.module.http.internal.ParameterMap@0
http.version=HTTP/1.1
user-agent=curl/7.37.1
OUTBOUND scoped properties:
Content-Type=text/plain;charset=UTF-8
MULE_ENCODING=UTF-8
SESSION scoped properties:
}

I tried with the activemq version you specify as well as the 5.11.1
David Dossot (233) [Avatar] Offline
#2
The book has been written and tested with Mule 3.4.0 Community Edition so it is possible that changes in subsequent versions of Mule break the provided examples. Moreover you are using the Enterprise Edition of 3.6.0, which uses
com.mulesoft.mule.transport.jms.EeJmsMessageDispatcher
, i.e. a different dispatcher than the one from the Community Edition. That's also another important difference. Since you are an enterprise user, you may want to contact MuleSoft's professional support directly.

This said, I do not see any error in the log entries you are sharing here... so I'm not really sure why you're saying it's not working.
209181 (2) [Avatar] Offline
#3
Hi,
Thanks for your response. It does not work as no message is in the queue but I forgot to put that info in the post, sorry.
So there is a difference between the anypoint ide and ce ?
I am donwloading the community version ce 1.3, is that the good one ? http://www.mulesoft.org/all-mule-studio-downloads

Merci
Nicolas
David Dossot (233) [Avatar] Offline
#4
De rien smilie

What matters here is not the version of Studio but the Mule runtime you are using when executing your application.

I'm curious though, you don't see exceptions in the logs, so it should be working. I'd like to find out why it's not working for you.

Questions:

  • 1. I notice there's an output from org.mule.api.processor.LoggerMessageProcessor. There's not <logger /> in the original config from the book. Did you modify the flow to add the logger? Did you change anything else?

    2. How do you check that there's a message in the queue?
  • 369368 (4) [Avatar] Offline
    #5
    Chapter 1 Sending to JMS queue not working Using Mule 3.6.1 and Anypoint studio 5.2.1?
    First of all, thank you for your book. I purchased you first edition and loved it.

    I am working through your first chapter. I am able to follow your methodology up to the testing of the Mule ESB and the JMS. I have been able to post a message using the Advance Rest Client for Chrome with no problem. I can see the message posted in ActiveMQ. The only change I have accomplished is the port to 8081.

    When I run the FunctionalTestCase,the test is throwing an exception:

    org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "start" on object: org.mule.module.http.internal.listener.DefaultHttpListenerConfig@1c69d3c
    	at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:248)
    	at org.mule.lifecycle.RegistryLifecycleManager$RegistryLifecycleCallback.onTransition(RegistryLifecycleManager.java:273)
    	at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:152)
    	at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:123)
    	at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:76)
    	at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:136)
    	at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:91)
    	at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:87)
    	at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:69)
    	at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:61)
    	at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:278)
    	at org.mule.tck.junit4.AbstractMuleContextTestCase.startMuleContext(AbstractMuleContextTestCase.java:188)
    	at org.mule.tck.junit4.AbstractMuleContextTestCase.setUpMuleContext(AbstractMuleContextTestCase.java:149)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    	at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
    Caused by: org.mule.api.DefaultMuleException: Address already in use: bind (java.net.BindException)
    	at org.mule.module.http.internal.listener.DefaultHttpListenerConfig.start(DefaultHttpListenerConfig.java:273)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:606)
    	at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237)
    	... 23 more
    Caused by: java.net.BindException: Address already in use: bind
    	at sun.nio.ch.Net.bind0(Native Method)
    	at sun.nio.ch.Net.bind(Net.java:444)
    	at sun.nio.ch.Net.bind(Net.java:436)
    	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    	at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:132)
    	at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:88)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:236)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:216)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:207)
    	at org.mule.module.http.internal.listener.grizzly.GrizzlyServer.start(GrizzlyServer.java:41)
    	at org.mule.module.http.internal.listener.DefaultHttpListenerConfig.start(DefaultHttpListenerConfig.java:269)
    	... 28 more
    
    



    Any suggestions?

    David Dossot (233) [Avatar] Offline
    #6
    Chapter 1 Sending to JMS queue not working Using Mule 3.6.1 and Anypoint studio 5.2.1?
    Caused by: java.net.BindException: Address already in use: bind
    


    You're trying to bind an HTTP Server to an address that is already in use. Stop the server that is occupying the address then try again.
    369368 (4) [Avatar] Offline
    #7
    Duh. Okay. I have stopped the server. I left one message on the queue. When I run the test, I get a response back but the test fails in comparison. This was the one message I left on the queue. ActiveMQ reflects there are two messages. When I clean the message queue all together and rerun the test, the test fails because the payload is identified as a String "NullPayload".

    org.junit.ComparisonFailure: expected:<{["name":"Widget",  "price":9.99,  "weight":1.0,  "sku":"abcd-12345"]}> but was:<{[NullPayload]}>
    	at org.junit.Assert.assertEquals(Assert.java:115)
    	at org.junit.Assert.assertEquals(Assert.java:144)
    	at product_registration.ProductRegistrationFunctionalTestCase.testCanRegisterProducts(ProductRegistrationFunctionalTestCase.java:37)
    


    Line 37 of the test is:

    		assertEquals(productAsJson, result.getPayloadAsString());	
    


    What should happen is the test should fail on the assertFalse statement. This is how I changed it:

    assertFalse(result.getPayloadAsString().equalsIgnoreCase("{NullPayload}"));
    



    I am still not able to get a message from the queue. I thought it was the client so I created a DefaultLocalMuleClient and wrapped the payload in a MuleMessage. I got the same results.

    Suggestions?


    David Dossot (233) [Avatar] Offline
    #8
    Sorry, I don't know why this is not working for you. Try asking on StackOverflow, providing your config, Mule version, etc...
    369368 (4) [Avatar] Offline
    #9
    thank you!
    441301 (4) [Avatar] Offline
    #10
    Same here, I am not getting any error but message isn't input to JMS and end up assert fail due to difference between expected and actual. Have you resolved the issue?