Component Exception
I am attempting a tutorial from the book 'MULE_ESB_COOKBOOK' by packt publishing and I have posted this question in another forum too. In the first chapter, there is a 'Deploying your first Hello World application on the Mule server' exercise which I am trying out. The expected output is Hello/(The value I enter as part of the url)
However when I run the application, I am getting the following error in the browser when I enter this: http://localhost:9081. The error message is as follow: "Component that caused exception is: DefaultJavaComponent{helloworldFlow.component.1468192631}. Message payload is of type: NullPayload"
The XML file is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
</mule>
The Greeting.java file is as follows:
package com.org;
public class Greeting {
public String sayHi(String str)
{
return "Hello " +str;
}
}
I am not sure why I am getting this error. Hope someone can help, thanks.
java mule esb
add a comment |
I am attempting a tutorial from the book 'MULE_ESB_COOKBOOK' by packt publishing and I have posted this question in another forum too. In the first chapter, there is a 'Deploying your first Hello World application on the Mule server' exercise which I am trying out. The expected output is Hello/(The value I enter as part of the url)
However when I run the application, I am getting the following error in the browser when I enter this: http://localhost:9081. The error message is as follow: "Component that caused exception is: DefaultJavaComponent{helloworldFlow.component.1468192631}. Message payload is of type: NullPayload"
The XML file is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
</mule>
The Greeting.java file is as follows:
package com.org;
public class Greeting {
public String sayHi(String str)
{
return "Hello " +str;
}
}
I am not sure why I am getting this error. Hope someone can help, thanks.
java mule esb
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07
add a comment |
I am attempting a tutorial from the book 'MULE_ESB_COOKBOOK' by packt publishing and I have posted this question in another forum too. In the first chapter, there is a 'Deploying your first Hello World application on the Mule server' exercise which I am trying out. The expected output is Hello/(The value I enter as part of the url)
However when I run the application, I am getting the following error in the browser when I enter this: http://localhost:9081. The error message is as follow: "Component that caused exception is: DefaultJavaComponent{helloworldFlow.component.1468192631}. Message payload is of type: NullPayload"
The XML file is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
</mule>
The Greeting.java file is as follows:
package com.org;
public class Greeting {
public String sayHi(String str)
{
return "Hello " +str;
}
}
I am not sure why I am getting this error. Hope someone can help, thanks.
java mule esb
I am attempting a tutorial from the book 'MULE_ESB_COOKBOOK' by packt publishing and I have posted this question in another forum too. In the first chapter, there is a 'Deploying your first Hello World application on the Mule server' exercise which I am trying out. The expected output is Hello/(The value I enter as part of the url)
However when I run the application, I am getting the following error in the browser when I enter this: http://localhost:9081. The error message is as follow: "Component that caused exception is: DefaultJavaComponent{helloworldFlow.component.1468192631}. Message payload is of type: NullPayload"
The XML file is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
</mule>
The Greeting.java file is as follows:
package com.org;
public class Greeting {
public String sayHi(String str)
{
return "Hello " +str;
}
}
I am not sure why I am getting this error. Hope someone can help, thanks.
java mule esb
java mule esb
edited Nov 21 '18 at 19:42
utechtzs
30619
30619
asked Nov 21 '18 at 18:25
javapersonjavaperson
297
297
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07
add a comment |
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07
add a comment |
2 Answers
2
active
oldest
votes
This is expected because you are not passing any input to your Java class.
Try setting some input using set-payload component before java class component:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="Anirban" doc:name="Set Payload"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
add a comment |
You Java class is wrong. To invoke a Java class in Mule 3.x it has to implement the Mule org.mule.api.lifecycle.Callable interface. See the example at https://docs.mulesoft.com/mule-runtime/3.9/java-component-reference#basic-hello-world-java-component-class
I'm guessing the complete error in the log points to the correct issue.
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418381%2fcomponent-exception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is expected because you are not passing any input to your Java class.
Try setting some input using set-payload component before java class component:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="Anirban" doc:name="Set Payload"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
add a comment |
This is expected because you are not passing any input to your Java class.
Try setting some input using set-payload component before java class component:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="Anirban" doc:name="Set Payload"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
add a comment |
This is expected because you are not passing any input to your Java class.
Try setting some input using set-payload component before java class component:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="Anirban" doc:name="Set Payload"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
This is expected because you are not passing any input to your Java class.
Try setting some input using set-payload component before java class component:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9081" doc:name="HTTP Listener Configuration"/>
<flow name="helloworldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="Anirban" doc:name="Set Payload"/>
<component class="com.org.Greeting" doc:name="Java"/>
</flow>
answered Nov 21 '18 at 18:47
Anirban Sen ChowdharyAnirban Sen Chowdhary
6,24842867
6,24842867
add a comment |
add a comment |
You Java class is wrong. To invoke a Java class in Mule 3.x it has to implement the Mule org.mule.api.lifecycle.Callable interface. See the example at https://docs.mulesoft.com/mule-runtime/3.9/java-component-reference#basic-hello-world-java-component-class
I'm guessing the complete error in the log points to the correct issue.
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
add a comment |
You Java class is wrong. To invoke a Java class in Mule 3.x it has to implement the Mule org.mule.api.lifecycle.Callable interface. See the example at https://docs.mulesoft.com/mule-runtime/3.9/java-component-reference#basic-hello-world-java-component-class
I'm guessing the complete error in the log points to the correct issue.
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
add a comment |
You Java class is wrong. To invoke a Java class in Mule 3.x it has to implement the Mule org.mule.api.lifecycle.Callable interface. See the example at https://docs.mulesoft.com/mule-runtime/3.9/java-component-reference#basic-hello-world-java-component-class
I'm guessing the complete error in the log points to the correct issue.
You Java class is wrong. To invoke a Java class in Mule 3.x it has to implement the Mule org.mule.api.lifecycle.Callable interface. See the example at https://docs.mulesoft.com/mule-runtime/3.9/java-component-reference#basic-hello-world-java-component-class
I'm guessing the complete error in the log points to the correct issue.
answered Nov 22 '18 at 1:48
Alejandro DobniewskiAlejandro Dobniewski
885713
885713
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
add a comment |
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
That is not correct.. Why should he implement callable when mule 3.x can access the java method by setting the input payload? Yes there can be a issue in method resolver exception incase of multiple java method (can be resolved by method resolver in that case),but since it's only single method it will easily be picked and will display response. This is a valid java class. He can invoke this java class in different ways. The way he is doing now and adding input payload and also using spring beans with invoke component. He doesn't require callable interface.
– Anirban Sen Chowdhary
Nov 22 '18 at 11:48
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418381%2fcomponent-exception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'd ask for more of the tutorial, but it's dangerous posting published material on SO. This book is also from 2013, so I'm curious as to which AnypointStudio and Mule Runtime you're using.
– utechtzs
Nov 21 '18 at 19:07