[mule-user] Help needed: Getting exception while dispathing the event

0 views
Skip to first unread message

P Lavti

unread,
Jun 1, 2007, 4:56:05 AM6/1/07
to us...@mule.codehaus.org
Hi, I am new to the Mule ESB and evaluating it to use for my project. I have successfully deployed Mule as an .ear in JBoss 4.0.4 GA. Now I am trying to send an event programmatically. The code I have written in a servlet to send the event: MuleClient client = new MuleClient(); client.dispatch( "vm://test.mule", "Hello", null); The structure of the deploy directory is: + Jboss home/server/default/deploy |--- publisher.war |--- mule-ear-1.4.0.ear Structure of publisher.war is: + publisher.war |--- META-INF |--- MENIFEST.MF |--- WEB-INF |--- classes |--- com.publish.PublisherSevlet |--- com.publish.MsgPublisher |--- lib |--- mule-module-client-1.4.0.jar |--- mule-core-1.4.0.jar When I call the above code to send an even, I get following Exception: java.lang.NoClassDefFoundError org.mule.extras.client.MuleClient.init(MuleClient.java:222) org.mule.extras.client.MuleClient.(MuleClient.java:123) com.publish.MsgPublisher.publish(MsgPublisher.java:126) com.publish.PublisherSevlet.doPost(PublisherSevlet.java:40) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) I am not sure if I send an even from the jar, which is out of the Mule ear. But this is the requirement of my project. Please suggest me where am I wrong, and how can I send an even from a war file, which is out of the mule ear. Thanks in Advance!

View this message in context: Help needed: Getting exception while dispathing the event
Sent from the Mule - User mailing list archive at Nabble.com.

Marie Claire Rizzo

unread,
Jun 1, 2007, 9:38:08 AM6/1/07
to us...@mule.codehaus.org
Hi

Assuming that your ear file has classloader isolation then then the way
to allow your war deployment to use the Mule Classes would be to make
your war share the Mule classloader repository. You can do this by
assigning the war deployment to the same classloader repository as that
used by Mule.

Regards
Marie Rizzo

P Lavti wrote:
> Hi, I am new to the Mule ESB and evaluating it to use for my project.
> I have successfully deployed Mule as an .ear in JBoss 4.0.4 GA. Now I
> am trying to send an event programmatically. The code I have written
> in a servlet to send the event: MuleClient client = new MuleClient();
> client.dispatch( "vm://test.mule", "Hello", null); The structure of
> the deploy directory is: + Jboss home/server/default/deploy |---
> publisher.war |--- mule-ear-1.4.0.ear Structure of publisher.war is: +
> publisher.war |--- META-INF |--- MENIFEST.MF |--- WEB-INF |--- classes
> |--- com.publish.PublisherSevlet |--- com.publish.MsgPublisher |---
> lib |--- mule-module-client-1.4.0.jar |--- mule-core-1.4.0.jar When I
> call the above code to send an even, I get following Exception:
> java.lang.NoClassDefFoundError
> org.mule.extras.client.MuleClient.init(MuleClient.java:222)
> org.mule.extras.client.MuleClient.(MuleClient.java:123)
> com.publish.MsgPublisher.publish(MsgPublisher.java:126)
> com.publish.PublisherSevlet.doPost(PublisherSevlet.java:40)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> I am not sure if I send an even from the jar, which is out of the Mule
> ear. But this is the requirement of my project. Please suggest me
> where am I wrong, and how can I send an even from a war file, which is
> out of the mule ear. Thanks in Advance!

> ------------------------------------------------------------------------


> View this message in context: Help needed: Getting exception while
> dispathing the event

> <http://www.nabble.com/Help-needed%3A-Getting-exception-while-dispathing-the-event-tf3851145.html#a10909192>


> Sent from the Mule - User mailing list archive

> <http://www.nabble.com/Mule---User-f2727.html> at Nabble.com.

--

Marie Rizzo
Ricston Consulting
Tel: +356 21 334457
Fax: +356 21 334457
Skype: marie.rizzo


---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

P Lavti

unread,
Jun 3, 2007, 11:28:14 PM6/3/07
to us...@mule.codehaus.org

Thanks Marie.

I have resolved all the class loader issues and now I am trying to send the
events.


The code I have written in a servlet to send the event:

UMOEventContext context = RequestContext.getEventContext();
UMOEndpoint endpoint = new MuleEndpoint("vm://test.mule", false);
context.dispatchEvent(new MuleMessage("Hello"), endpoint);

It sends the events successfully as well. But the problem is, I’ll get the
message in logs “There is no manager instance locally available for this
client creating a new Manager, and the manager starts successfully”. And
After sending the event, it will give the message “No receiver for
endpointUri: vm://test.mule”. But I have one UMOComponent deployed in Mule
ear, listening to end-point vm://test.mule

My Question is why it can not use the same manager which is deployed thru
mule ear, why is a different manager started? And why it says No recriver
for enepoint URI, even though when there is one?

As I told earlier, I am using Mule integrated with JBoss and both the
servlet and Mule ear are deployed on same level i.e. jboss deploy folder. My
servlet is not bundled inside Mule ear but the reciever is bundled in Mule
ear. I suspects this is why I am not able to recieve events.

Here are the logs for the reference:

2007-06-01 17:08:08,028 INFO [STDOUT] 17:08:08,028 INFO [MsgPublisher]
Message to be published: Hello
2007-06-01 17:08:08,137 INFO [STDOUT] 17:08:08,137 INFO [MuleClient] There
is no manager instance locally available for this client, creating a new
Manager
2007-06-01 17:08:08,137 INFO [STDOUT] 17:08:08,137 INFO [MuleManager]
Creating new MuleManager instance
2007-06-01 17:08:08,932 INFO [STDOUT] 17:08:08,932 INFO [MuleClient]
Starting Mule Manager for this client
2007-06-01 17:08:09,010 INFO [STDOUT] 17:08:09,010 INFO [MuleManager]
Connectors have been initialised successfully
2007-06-01 17:08:09,010 INFO [STDOUT] 17:08:09,010 INFO [MuleManager]
Initialising agents...
2007-06-01 17:08:09,025 INFO [STDOUT] 17:08:09,025 INFO [MuleManager]
Agents Successfully Initialised
2007-06-01 17:08:09,025 INFO [STDOUT] 17:08:09,025 INFO
[DefaultComponentExceptionStrategy] Initialising exception listener:
org.mule.impl.DefaultComponentExceptionStrategy@e73236
2007-06-01 17:08:09,056 INFO [STDOUT] 17:08:09,056 INFO [MuleManager]
Server endpointUri is null, not registering Mule Admin agent
2007-06-01 17:08:09,056 INFO [STDOUT] 17:08:09,056 INFO
[TransactionalQueueManager] Starting ResourceManager
2007-06-01 17:08:09,072 INFO [STDOUT] 17:08:09,072 INFO
[TransactionalQueueManager] Started ResourceManager
2007-06-01 17:08:09,072 INFO [STDOUT] 17:08:09,072 INFO [MuleManager]
Connectors have been started successfully
2007-06-01 17:08:09,072 INFO [STDOUT] 17:08:09,072 INFO [MuleManager]
Starting agents...
2007-06-01 17:08:09,072 INFO [STDOUT] 17:08:09,072 INFO [MuleManager]
Agents Successfully Started
2007-06-01 17:08:09,103 INFO [STDOUT] 17:08:09,103 INFO [MuleManager]
**********************************************************************
* Mule ESB and Integration Platform version 1.4.0 *
* MuleSource, Inc. *
* For more information go to http://mule.mulesource.org *
* *
* Server started: Friday, June 1, 2007 5:08:08 PM IST *
* Server ID: 91f1831f-1034-11dc-8afd-bd37a717e740 *
* JDK: 1.5.0_06 (mixed mode) *
* OS: Windows XP - Service Pack 2 (5.1, x86) *
* Host: EC3-NOR-153490 (192.168.62.131) *
* *
* Agents Running: None *
**********************************************************************
2007-06-01 17:08:09,243 INFO [STDOUT] 17:08:09,243 INFO [VMConnector]
Initialising: VMConnector{this=2b7fc2, started=false, initialised=false,
name='connector.VM.0', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=false,
supportedProtocols=[vm], serviceOverrides=null}
2007-06-01 17:08:09,243 INFO [STDOUT] 17:08:09,243 INFO
[DefaultExceptionStrategy] Initialising exception listener:
org.mule.impl.DefaultExceptionStrategy@1d0bc85
2007-06-01 17:08:09,243 INFO [STDOUT] 17:08:09,243 INFO [VMConnector]
Starting: VMConnector{this=2b7fc2, started=false, initialised=true,
name='connector.VM.0', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=true,
supportedProtocols=[vm], serviceOverrides=null}
2007-06-01 17:08:09,275 INFO [STDOUT] 17:08:09,275 INFO [VMConnector]
Started: VMConnector{this=2b7fc2, started=true, initialised=true,
name='connector.VM.0', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=true,
supportedProtocols=[vm], serviceOverrides=null}
2007-06-01 17:08:09,275 INFO [STDOUT] 17:08:09,275 INFO [VMConnector]
Connected: VMConnector{this=2b7fc2, started=true, initialised=true,
name='connector.VM.0', disposed=false,
numberOfConcurrentTransactedReceivers=4,
createMultipleTransactedReceivers=true, connected=true,
supportedProtocols=[vm], serviceOverrides=null}
2007-06-01 17:08:09,353 INFO [STDOUT] 17:08:09,353 INFO
[VMMessageDispatcher] Connected: VMMessageDispatcher{this=eb3c84,
endpoint=vm://test.mule}
2007-06-01 17:08:09,353 INFO [STDOUT] 17:08:09,353 WARN
[VMMessageDispatcher] No receiver for endpointUri: vm://test.mule

--
View this message in context: http://www.nabble.com/Help-needed%3A-Senidng-and-Receiving-Events-tf3851145.html#a10943336
Sent from the Mule - User mailing list archive at Nabble.com.

Marie Claire Rizzo

unread,
Jun 4, 2007, 5:00:28 AM6/4/07
to us...@mule.codehaus.org
Hi

Have you tried using the MuleClient? Also, can you check whether your
instance of Mule is getting loaded? I.e. the one with the vm://test.mule
configured. Another thing to check is where you are putting your
configuration file and whether it's getting picked up.

Regards
Marie Rizzo

--

Marie Rizzo


Ricston Consulting
Tel: +356 21 334457
Fax: +356 21 334457
Skype: marie.rizzo

P Lavti

unread,
Jun 4, 2007, 5:22:32 AM6/4/07
to us...@mule.codehaus.org

Yes, I tried MuleClient as well, but that didn't work either :(

Mule Instance with vm://test.mule is also starting prperly.
My configuration file is in conf directory and I have modified the ra.xml as
well to pick the correct file.

When 1st time the Mule manager starts i.e. when i start the JBoss, config
file is loaded successfully, and in the logs it comes as
2007-06-04 14:33:05,253 INFO [org.mule.providers.vm.VMConnector]
Registering listener: ChitChatUMO on endpointUri: vm://test.mule
2007-06-04 14:33:05,253 INFO [org.mule.providers.vm.VMMessageReceiver]
Connected: VMMessageReceiver{this=17ad30a, receiverKey=test.mule,
endpoint=vm://test.mule}
2007-06-04 14:33:05,300 INFO [org.mule.impl.model.seda.SedaModel] Component
ChitChatUMO has been started successfully

This means the reciever is initialized properly.

Now when i send the event from the war file let's say using MuleClient, I am
not specifying any config file, and when i send the event, it says: No
manager instance locally available for this client, starting a new
manager...
And after sending the event, it says: No receiver for endpointUri:
vm://test.mule

Do I need to do some configuration in my war file as well for Mule client?
If yes then How should I do that as its not bundled in the Mule ear?

:,(:(
--
View this message in context: http://www.nabble.com/Help-needed%3A-Senidng-and-Receiving-Events-tf3851145.html#a10946341


Sent from the Mule - User mailing list archive at Nabble.com.

Marie Claire Rizzo

unread,
Jun 4, 2007, 6:56:39 AM6/4/07
to us...@mule.codehaus.org
Hi

The MuleClient will create an instance of the Mule Manager because it is
assumed that whenever you are using a Mule Client, the Mule Server is
remote. You don't have to worry about having a configuration file for
it. I have managed to use the MuleClient to call a service hosted on the
JBoss over http, axis and xfire transports. The problem with vm is that
it's assuming that the mule server is local, i.e. that the Mule Client
and the Mule Server are using the same mule configuration. If you switch
to another transport you should be able to make you servlet work.

Thanks and regards

P Lavti

unread,
Jun 4, 2007, 7:26:33 AM6/4/07
to us...@mule.codehaus.org

Thanks for your quick reply Marie.

In actual scenario I have to use http only, And I started with http before
using vm.
And I was getting below exception while loading the config file for event
reciever at JBoss startup

2007-06-04 16:39:54,966 INFO [org.mule.providers.http.HttpConnector]
Registering listener: ChitChatUMO on endpointUri: http://localhost:8080/
2007-06-04 16:39:55,013 WARN [org.jboss.system.ServiceController] Problem
starting service
jboss.jca:service=RARDeployment,name='mule-ear-1.4.0.ear#mule-jca-1.4.0-jboss.rar'
javax.resource.spi.ResourceAdapterInternalException: Failed to load
configurations: conf/hello-http-config.xml
at org.mule.ra.MuleResourceAdapter.start(MuleResourceAdapter.java:117)

I suspect that the URI is not correct since it tries registring to this
end-point before the JBoss completely starts. Please suggest which URI
should i give to use the http protocol.

My config file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration
XML V1.0//EN"

"http://mule.mulesource.org/dtds/mule-configuration.dtd">
<mule-configuration id="Mule_Hello_Sample_over_Http" version="1.0">
<description>
This example uses http as the transport.
</description>
<mule-environment-properties synchronous="true"/>
<transformers>
<transformer name="ChatStringToString"
className="org.mule.samples.hello.ChatStringToString"
returnClass="java.lang.String"/>
</transformers>
<global-endpoints>
<endpoint name="testMule" address="http://localhost:8080/"
responseTransformers="ChatStringToString"/>
</global-endpoints>
<interceptor-stack name="default">
<interceptor className="org.mule.interceptors.LoggingInterceptor"/>
<interceptor className="org.mule.interceptors.TimerInterceptor"/>
</interceptor-stack>
<model name="helloSample">
<mule-descriptor name="ChitChatUMO"
implementation="org.mule.samples.hello.ChitChatter">
<inbound-router>
<global-endpoint name="testMule"/>
</inbound-router>
<interceptor name="default"/>
</mule-descriptor>
</model>
</mule-configuration>

Thanks
P Lavti


Hi

--
View this message in context: http://www.nabble.com/Help-needed%3A-Senidng-and-Receiving-Events-tf3851145.html#a10947975


Sent from the Mule - User mailing list archive at Nabble.com.

Andrew Perepelytsya

unread,
Jun 4, 2007, 9:51:57 AM6/4/07
to us...@mule.codehaus.org
There are 2 problems (granted all other config problems resolved):
  1. The order of deployments. Applications should be started in a particular order. Use either dependencies or startup prefixes for deployment units.
  2. Use MuleClient.getRemoteDispatcher() to talk to the remote server. Note, you'll need to have an admin agent running on the remote server (and point to it). Then you can dispatch to the remote server's VM endpoint.
Andrew

Marie Claire Rizzo

unread,
Jun 4, 2007, 10:07:53 AM6/4/07
to us...@mule.codehaus.org
Hi

1.) If JBoss is running on port 8080 don't use that port on any of the
Mule endpoints. Mule expects to bind its endpoints to ports that aren't
being used. If the port is already being used, Mule will throw an exception.
2.) The ChitChat component accepts a ChatString. Please look at the
Hello Example, the http request configuration.

--

Marie Rizzo


Ricston Consulting
Tel: +356 21 334457
Fax: +356 21 334457
Skype: marie.rizzo

P Lavti

unread,
Jun 5, 2007, 4:39:40 AM6/5/07
to us...@mule.codehaus.org

Thanks Andrew & Marie.

I used MuleClient.getRemoteDispatcher() and an unsed for port for http
connection, It worked ^L^

But I am little bit confused with the concept of remote server. mule ear
and my war files are deployed on the same m/c under same JBoss, then why do
I need to dispatch the events remotely??

Also can you pls tell can where can i find more details about admin agent?
Can I write my own admin agent using different scheme say JMX and what are
the steps required for that??

Thanks
P Lavti


Andrew Perepelytsya wrote:
>
> There are 2 problems (granted all other config problems resolved):
>

> 1. The order of deployments. Applications should be started in a


> particular order. Use either dependencies or startup prefixes for
> deployment
> units.

> 2. Use MuleClient.getRemoteDispatcher() to talk to the remote server.


> Note, you'll need to have an admin agent running on the remote server
> (and
> point to it). Then you can dispatch to the remote server's VM endpoint.
>
> Andrew
>

--
View this message in context: http://www.nabble.com/Help-needed%3A-Senidng-and-Receiving-Events-tf3851145.html#a10965537

P Lavti

unread,
Jun 5, 2007, 7:06:06 AM6/5/07
to us...@mule.codehaus.org

One more information I need for event receiver. Can I setup the event
receiver programmatically, like we can send the events programmatically? The
receiver need to be asynchronous.

--------------------------------------------------------------------------------

Thanks Andrew & Marie.

Thanks
P Lavti


--
View this message in context: http://www.nabble.com/Help-needed%3A-Senidng-and-Receiving-Events-tf3851145.html#a10967294

Andrew Perepelytsya

unread,
Jun 6, 2007, 10:01:02 PM6/6/07
to us...@mule.codehaus.org
A remote call has to marshal and unmarshall data as a rule. It does not have to be a different VM even. In java one would have to do it to communicate between classloader domains sometimes. That is what's happening in your case.

I didn't quite get what you meant by a custom admin agent. This is an internal Mule component, perhaps if describe the intent...

Andrew
Reply all
Reply to author
Forward
0 new messages