I was trying to work with Java Client API. I tried to understand SmartFoxJChat. I am using Smart Fox Server2. When I run this example as a Java Applet it used to say Failed to connect.
I found in Smart Fox Client File that it tries to connect on port 9339. So I changed the config file for server so that it listens on port 9339. Earlier it was using port 9933.
Now it runs but the connection gets lost after sometime and in console it writes as:
log4j:WARN No appenders could be found for logger (org.apache.mina.filter.executor.ExecutorFilter). log4j:WARN Please initialize the log4j system properly.
19 May, 2011 10:58:47 AM it.gotoandplay.smartfoxclient.SmartFoxClient debugMessage
INFO: [Sending]: <msg t ='sys'><body action='verChk' r='0'><ver v='158' /></body></msg>
19 May, 2011 10:58:47 AM it.gotoandplay.smartfoxclient.SmartFoxClient debugMessage
INFO: [ RECEIVED ]: <?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- This is a master-policy file. site-control can be all,none,master-only -->
<site-control permitted-cross-domain-policies="all"/>
<!-- Instead of setting to-ports="*", administrators can use ranges and commas -->
<!-- This will allow access to ports 123, 456, 457, and 458 -->
<allow-access-from domain="*" to-ports="9933" />
</cross-domain-policy>
, (len: 487)
19 May, 2011 10:58:47 AM it.gotoandplay.smartfoxclient.SmartFoxClient debugMessage
SEVERE: Error parsing XML string: Nested Exception
Nested Exception
at net.n3.nanoxml.StdXMLParser.parse(StdXMLParser.java:208)
at it.gotoandplay.smartfoxclient.SmartFoxClient.xmlReceived(SmartFoxClient.java:4279)
at it.gotoandplay.smartfoxclient.SmartFoxClient.handleMessage(SmartFoxClient.java:4590)
at it.gotoandplay.smartfoxclient.SmartFoxClient.onData(SmartFoxClient.java:4573)
at it.gotoandplay.utils.net.xmlsocket.XMLSocket.fireDataEvent(XMLSocket.java:132)
at it.gotoandplay.utils.net.xmlsocket.XMLSocketClientHandler.messageReceived(XMLSocketClientHandler.java:31)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:636)
*** Nested Exception:
java.io.FileNotFoundException: /xml/dtds/cross-domain-policy.dtd (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at java.io.FileInputStream.<init>(FileInputStream.java:96)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:87)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:178)
at java.net.URL.openStream(URL.java:1029)
at net.n3.nanoxml.StdXMLReader.openStream(StdXMLReader.java:493)
at net.n3.nanoxml.StdXMLParser.processDocType(StdXMLParser.java:432)
at net.n3.nanoxml.StdXMLParser.processSpecialTag(StdXMLParser.java:349)
at net.n3.nanoxml.StdXMLParser.scanSomeTag(StdXMLParser.java:285)
at net.n3.nanoxml.StdXMLParser.scanData(StdXMLParser.java:232)
at net.n3.nanoxml.StdXMLParser.parse(StdXMLParser.java:203)
at it.gotoandplay.smartfoxclient.SmartFoxClient.xmlReceived(SmartFoxClient.java:4279)
at it.gotoandplay.smartfoxclient.SmartFoxClient.handleMessage(SmartFoxClient.java:4590)
at it.gotoandplay.smartfoxclient.SmartFoxClient.onData(SmartFoxClient.java:4573)
at it.gotoandplay.utils.net.xmlsocket.XMLSocket.fireDataEvent(XMLSocket.java:132)
at it.gotoandplay.utils.net.xmlsocket.XMLSocketClientHandler.messageReceived(XMLSocketClientHandler.java:31)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:636)
What should I do now?
SmartFoxJChat Connection Lost After sometime
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
This looks like you are trying to connect to a SFS2x with a SFS1 client.
The client API is not compatible with the new server
/Thomas
The client API is not compatible with the new server
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
Is Java API for SFS2x available
Hi,
I am keen to know if java API for SFS2 is available or not?
Thanks.
Prashant
I am keen to know if java API for SFS2 is available or not?
Thanks.
Prashant
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
Hi Prashant,
Yes it is - thats what this forum part is all about! So go ahead and play around with it to your hearts content
/Thomas
Yes it is - thats what this forum part is all about! So go ahead and play around with it to your hearts content
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 28 guests