[JDEV] Message sent is blank

Cunningham, Steven Steven.Cunningham at LibertyMutual.com
Tue Aug 19 14:22:38 CDT 2003


Where exactly does this output go?
I recompiled muse for just jabber, and with compile-with-logging
enabled. (Also edited the log4j.properties file, and I believe it's
right.)

log4j:

# Default Logging is DEBUG, thus enabling all messages to be logged
log4j.rootLogger=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
# Conversion pattern: Priority [Category] Message
log4j.appender.console.layout.ConversionPattern=%-5p [%c] - %m%n
# Conversion pattern: Date Priority [Category] Message
#log4j.appender.console.layout.ConversionPattern=%d %-5p [%c] - %m%n
#------------------Jabber Module---------------------------#
#-- logs all incoming parsed messages under DEBUG
 log4j.logger.jabber/msg/incoming=DEBUG
#-- logs all outgoing parsed messages under DEBUG
 log4j.logger.jabber/msg/outgoing=DEBUG
#-- logs all incoming raw packets under DEBUG
 log4j.logger.jabber/packet/incoming=DEBUG
#-- logs all outgoing raw packets under DEBUG
 log4j.logger.jabber/packet/outgoing=DEBUG

Also, JAJC has the option of viewing the xml transmitted. Here's what it
sends:

<message xmlns='jabber:client' type='chat' id='id_10033'
to='to at site.com' from='from at site.com/Home'><thread
xmlns='jabber:client'>id_10034</thread></message>

Here's what I send to setHTMLBody():

Test<br /><b>TEST!</b> Test Test <span style="font-size: 10px;
font-family: 'Verdana,Arial,sans-seriff';">Test!</span>

Steven Cunningham
Aspiring J-Developer


-----Original Message-----
From: Chris Chen [mailto:ckchris at idream.net] 
Sent: Monday, August 18, 2003 1:34 PM
To: jdev at jabber.org
Subject: Re: [JDEV] Message sent is blank


Try reading the README file of the Muse package distribution.  Inside,
it will tell you how to enable debugging inside muse.  Simply compile
the debugging into muse and then you will be able to see the incoming
and outgoing XML messages outputted (You will need to configure
log4j.properties file as well).

Then you can see if the message is sending the proper XML data.

Thanks,
Chris

----- Original Message ----- 
From: "Cunningham, Steven" <Steven.Cunningham at LibertyMutual.com>
To: <jdev at jabber.org>
Sent: Monday, August 18, 2003 6:12 AM
Subject: [JDEV] Message sent is blank


> I've been trying to get a jabber message to accept xhtml formatting, 
> but without much luck. The message is sent all right, but it shows 
> nothing in the message (Shows who sent it, but then the message itself

> is blank.)
>
> Here's the code that sends it (java)
>
> String message = "<span style='font-size:large'>OMG, i'm </span><span 
> style='color:green'>green</span> with <em>envy</em>!"; 
> JabberChatMessage msg = new 
> JabberChatMessage(JabberChatMessage.TYPE_CHAT);
> msg.setTo(jabTo);
> msg.setHTMLBody(message);
> msg.setSynchronized(false);
> jabberSession.sendMessage(msg);
> System.out.println("--- Jabber messages sent successfully!\n");
>
> When I included the <html> and <body> tags, I got the 
> SendMessageFailedException popped up.
> SendMessageFailedException.getLocalizedMessage() returns this: The 
> element "html" could not be added as a child of "message": The element

> already has an existing parent (the document root)
>
> Steven Cunningham
> Aspiring J-Developer _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>

_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev



More information about the JDev mailing list