Hostname escaping characters. Bug in ExternalComponent connection?

Hi all

I am trying to develop a simple external component but I got stuck with what I suppose is a connection problem. I have a code looking like this:

public class Main {
    public static void main(String[] args)
    {
        ExternalComponentManager mgr = new ExternalComponentManager("myHost-ubuntu", 5276);
        mgr.setSecretKey("mysub", "123456");         try
        {
            mgr.addComponent("simpleservice", new ServiceComponent());
        }
        catch (ComponentException e)
        {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "main", e);
            System.exit(-1);
        }         while (true) {
            try {
                Thread.sleep(10000);
            } catch (Exception e) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "main", e);
            }
        }
    }
}

And I receive an error:

SEVERE: main

org.xmpp.component.ComponentException: org.xmlpull.v1.XmlPullParserException: expected start tag name and not / (position: START_DOCUMENT seen </… @1:2)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:248)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:211)

at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentM anager.java:191)

at external.component.Main.main(Main.java:21)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Caused by: org.xmlpull.v1.XmlPullParserException: expected start tag name and not / (position: START_DOCUMENT seen </… @1:2)

at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1475)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)

at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)

at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:186)

… 8 more

I suppose that the problem is with my host name as connection might not escape the ‘-’ in my hostname. How can I change a hostname? Or maybe the problem is somewhere else? I tried to manually change my computer hostname by running in terminal “hosname newHostname” command and then restart setup for openfire server but that would not do the trick.

I don’t care if I could loose any data right now as I have nothing relevant connected to the server.

Use the IP address. Anyhow this should change nothing.

Oh… That’s true. The exception is still being thrown but using localhost instead of myHost-ubuntu still works. Any idea where the problem might be? I am using whack version compiled from sources… not the downloadable jar

Whack is from 2008 and there is no active development any more. If it’s a bug you will likely need to fix it on your own. Try to enable auditing on the Openfire server so see which packets are sent / received.

Maybe, or maybe not, a XEP was modified and the needed code change made it into Openfire but not in Whack.