[flexcoders] Re: problem with MessageService in custom ServiceAdapter

2008-04-11 Thread netdeep
Thanks, I added in the following code and it seems to work:

String clientID = UUIDUtils.createUUID();
 message = new AsyncMessage(); 
 message.setDestination("chan");
 message.setClientId(clientID);
 message.setMessageId(UUIDUtils.createUUID());
 message.setTimestamp(System.currentTimeMillis());


--- In flexcoders@yahoogroups.com, "Anthony DeBonis" <[EMAIL PROTECTED]> wrote:
>
> In our application we have have set the destination
> 
> messageChatConsumer = new Consumer();
> messageChatConsumer.destination=evacML.messageChatDestinationName;
>
> destination is set in the config files:
> C:\fds2\jrun4\servers\default\{YOUR APP}\WEB-INF\flex
> data-management-config.xml  or messaging-config.xml or... depending 
> on what your doing.
> 
> 
> --- In flexcoders@yahoogroups.com, "netdeep"  wrote:
> >
> > When I send messages from my flex app to my custom ServiceAdapter, 
> it receives them 
> > successfully in the invoke(Message msg) method.
> > 
> > However, when I push a message after launching the app manually as 
> a java app, I get the 
> > error:
> > 
> > MessageBroker failed to start: flex.messaging.MessageException: No 
> destination 'null' 
> > exists in service flex.messaging.services.MessageService
> > 
> > Here is the code that causes the crash:
> > 
> > public class ReportManager extends ServiceAdapter {
> > 
> > public void init() {
> > MessageService msgService = (MessageService)getDestination
> ().getService();
> > msgService.pushMessageToClients(message, true);  
> > }
> > 
> > }
> > 
> > So the statements in init() work fine when they are in invoke() but 
> fail when I use them this 
> > way.  Why would that be?
> >
>





[flexcoders] Re: problem with MessageService in custom ServiceAdapter

2008-04-11 Thread Anthony DeBonis
In our application we have have set the destination

messageChatConsumer = new Consumer();
messageChatConsumer.destination=evacML.messageChatDestinationName;
 
destination is set in the config files:
C:\fds2\jrun4\servers\default\{YOUR APP}\WEB-INF\flex
data-management-config.xml  or messaging-config.xml or... depending 
on what your doing.


--- In flexcoders@yahoogroups.com, "netdeep" <[EMAIL PROTECTED]> wrote:
>
> When I send messages from my flex app to my custom ServiceAdapter, 
it receives them 
> successfully in the invoke(Message msg) method.
> 
> However, when I push a message after launching the app manually as 
a java app, I get the 
> error:
> 
> MessageBroker failed to start: flex.messaging.MessageException: No 
destination 'null' 
> exists in service flex.messaging.services.MessageService
> 
> Here is the code that causes the crash:
> 
> public class ReportManager extends ServiceAdapter {
> 
> public void init() {
> MessageService msgService = (MessageService)getDestination
().getService();
> msgService.pushMessageToClients(message, true);
> }
> 
> }
> 
> So the statements in init() work fine when they are in invoke() but 
fail when I use them this 
> way.  Why would that be?
>