No response received within reply timeout when i create a multiuserchat,but i can send message!

this is my code:

public class SmackTest {
private static AbstractXMPPConnection conn;
private static XMPPTCPConnectionConfiguration config;
private final static String USER_NAME = “root”;
private final static String USER_PASSWORD = “root”;
private final static String SERVICE_HOST = “localhost”;
private final static int SERVICE_PORT = 5222;
private final static String SERVICE_NAME = “flyjocker-pc-openfire-server”;

public void connect(){
try {
// SASLMechanism mechanism = new SASLDigestMD5Mechanism();
// SASLAuthentication.registerSASLMechanism(mechanism);
// SASLAuthentication.blacklistSASLMechanism(“SCRAM-SHA-1”);
// SASLAuthentication.unBlacklistSASLMechanism(“DIGEST-MD5”);

XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
builder.setSecurityMode(XMPPTCPConnectionConfiguration.SecurityMode.disabled);
builder.setHost(SERVICE_HOST);
builder.setPort(SERVICE_PORT);
builder.setUsernameAndPassword(USER_NAME, USER_PASSWORD);
builder.setDebuggerEnabled(true);
builder.setServiceName(SERVICE_NAME);
config = builder.build();
conn = new XMPPTCPConnection(config);
conn.connect();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
}

@Test
public void createRoom() {
try {
connect();
conn.login();
MultiUserChat multiUserChat = MultiUserChatManager.getInstanceFor(conn).getMultiUserChat(“demo@pinpoint.flyjocker-pc-openfire-server”);
multiUserChat.create(“demo”);
multiUserChat.sendConfigurationForm(new Form(DataForm.Type.submit));
conn.disconnect();
} catch (NoResponseException ex) {
ex.printStackTrace();
} catch (XMPPErrorException ex) {
ex.printStackTrace();
} catch (NotConnectedException ex) {
ex.printStackTrace();
} catch (SmackException ex) {
ex.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
}
}

public void sendMessage() {
try {
connect();
conn.login();
Chat chat = ChatManager.getInstanceFor(conn).createChat(“flyJocker@flyjocker-pc-openfire-server”, new ChatMessageListener() {
@Override
public void processMessage(Chat chat, Message message) {

}

});
chat.sendMessage(“Howdy!”);
conn.disconnect();
} catch (NotConnectedException e) {
e.printStackTrace();
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}

this is my error code

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: AndFilter: (FromMatchesFilter (full): sbroom@pinpoint.flyjocker-pc-openfire-server/sbroom, StanzaTypeFilter: org.jivesoftware.smack.packet.Presence).

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackExceptio n.java:106)

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackExceptio n.java:90)

at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:2 29)

at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:311)

at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:400)

at org.jivesoftware.smackx.muc.MultiUserChat.createOrJoin(MultiUserChat.java:376)

at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:354)

at SmackTest.createRoom(SmackTest.java:77)

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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.jav a:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java :15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java: 41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:2 0)

at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.j ava:79)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:7 1)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:4 9)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRefere nce.java:50)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunne r.java:467)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunne r.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.jav a:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.ja va:197)

This is the 3.10.0 version of the openfire error, for the 3.9.3 version is good

1 Like