PDA

View Full Version : Searching Java library to develop a component


Yougouff
05-27-2008, 05:25 PM
Hi,

I would like to develop an XMPP component with a java library. My server is ejabberd.

I tried:
- smack but it is only for clients (not components) and
- Yaja! but the last release is old (2003) and there is a bug in the dom4j library (used by Yaja!). I can't create an XMPP packet and I can't expect a fix, these two projects are down.

Hi,

Maybe I'm expecting too much from Dom4j, but this code
generates invalid XML code:

Document document=DocumentHelper.createDocument();
Element root = document.addElement( "root" );
Element author1 = root.addElement( "test" )
.addCDATA( "Some ]]> Text" );
System.out.println(document.asXML());

Output given:

<?xml version="1.0" encoding="UTF-8"?>
<root><test><![CDATA[Some ]]> Text]]></test></root>

I would have expected, at least, an error when adding
the CDATA, or some kind of escaping to avoid the wrong
output.

Thanks anyway for the great soft!


I need some help to find a java library which helps me to develop my XMPP component.
I heard something about Whack library but I can't find the website.

Thanks for your help.
Yougouff


EDIT: Finally, I deleted the bad code and sent the packet.

String stanza_string = stanza.asXML();
stanza_string = stanza_string.replace("<![CDATA[", "");
stanza_string = stanza_string.replace("]]>", "");
getSession().write( stanza_string );


I found whack repository but there is no documentation with it.
https://svn.igniterealtime.org/svn/repos/whack/

adyxtry
09-12-2008, 08:10 AM
I use jcore.jar n jdom.jar to develop any component in jabber server. U can get it if u have jabber XCP source.