Coder Social home page Coder Social logo

carloscharz / fcmxmppserverv2 Goto Github PK

View Code? Open in Web Editor NEW
47.0 10.0 33.0 123 KB

XMPP Connection Server for FCM using the latest version of the Smack library (4.3.4) + Connection Draining Implementation

Java 100.00%
xmpp smack upgrade xmpp-connection fcm smack-library java firebase-cloud-messaging

fcmxmppserverv2's Introduction

XMPP Connection Server for FCM (Upgrade from Smack 3.x to 4.x) + Connection Draining Implementation

This is an upgrade of my last FCM XMPP Connection Server application. Now, this project uses the latest version at this time of the Smack library (4.3.4). I just added the connection draining implementation to this project. If you had some problems check my troubleshooting section!

The new version has introduced new terminology, deprecated some older methods and enriched the library in general. The problem started when there is a no working example out there using the new version to build a XMPP CCS for FCM. In summary, the API changes from the 3.x to the 4.x version are:

  1. XMPPConnection is now an interface. Use either AbstractXMPPConnection or one of its subclasses (XMPPTCPConnection).
  2. XMPPConnection.addPacketListener is deprecated: use either addAsyncPacketListener or addSyncPacketListener.
  3. Packet became a deprecated interface. Use the new Stanza class.
  4. The Packet Extension term is now Extension Element.
  5. Some methods of ConnectionListener that belongs to the reconnection were moved to ReconnectionListener.

For more information you must read the following documentation:

ADDITIONAL USEFUL LINKS

New Smack libraries

How to start the server

Just because it is the same project as my prior solution, the way to start the server is exactly the same. You can read my how to start the server.

Troubleshooting

This is a simple java code. You can integrate with just spring or spring in a container (Tomcat for example). In any case you need to take into account these issues:

  1. If using a simple java application, keep the application alive listening messages. This problem occurs when you use a simple java code as a daemon in linux (that's why I put the while true workaround).

  2. If using a java server (with spring boot at least), close the XMPP connection when the server goes down. This problem occurs when even if you shutdown the server the XMPP connection is still open and handling incoming messages. I do not know yet if this is a spring boot problem. The thing is like we are wrapping the XMPP CCS Server into a HTTP interface just to treat it as a normal server. My workaround was putting the disconnection in the spring preDestroy. @PreDestroy public void springPreDestroy() { //ccsConnection.disconnect(); }

  3. Reconnection when connection draining. The reconnection should be handled to connect again to the FCM using the same parameters with a backoff strategy. Smack can handle the automatic reconnection if you enable it but if the connection will be closed from the FCM side you should call your reconnection method when FCM sends connection draining control message or connection draining error message.

  4. Handle properly the new connection creation. If you handle differently the connection draining or use the reconnect. Always make sure that when you create a new connection the old one is completely closed gracefully to avoid phantom connections!

About me

I am Carlos Becerra - MSc. Softwware & Systems. You can contact me via:

Thanks

To tell the truth. I was really worried looking for the right solution. Finally, I made a list of useful links (apart from the above documentation links).

Any improvement or comment about the project is always welcome! As well as others shared their code publicly I want to share mine! Thanks!

License

Copyright 2020 Carlos Becerra

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

fcmxmppserverv2's People

Contributors

carloscharz avatar kicktipp avatar py4x3g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fcmxmppserverv2's Issues

Connection refused

ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:735]

Can you tell me what happened?

java.net.SocketException: Permission denied: connection to (10, [2607:f8b0:4001:c06::bc]:5236,6) denied due to policy

I am trying to implement FCM xammp server in my google cloud module(endpoint) which i latter deploy it to appengine but am getting the error below when try to call css.connect().

CcsClient ccs = CcsClient.prepareClient(Utils.FCM_ID,Utils.FCM_KEY,false); 
  try {
      ccs.connect();
      JSONObject jsonObject = new JSONObject();
      jsonObject.put("to",clientId);
      jsonObject.put("message_id",345609);
      jsonObject.put("priority","high");
      JSONObject data = new JSONObject();
      data.put("success",false);
      jsonObject.put("data",data);
      ccs.send(jsonObject.toString());
    } catch (XMPPException | SmackException | IOException e) {
      e.printStackTrace();
    }

Error is

The following addresses failed: 'fcm-xmpp.googleapis.com:5236' failed because java.net.SocketException: Permission denied: connection to (10, [2607:f8b0:4001:c06::bc]:5236,6) denied due to policy

xml parser error

Hi,

When connect to FCM server, I got the following exception stack trace when call connect. I've search the error on the internet but didn't find useful information.

org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not \u15 (position: START_DOCUMENT seen \u15... @1:1) at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1519) at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395) at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1244) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:994) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:1010) at java.lang.Thread.run(Thread.java:748)

I've also traced the code at mxParser.parseProlog, it does try to skip some unicodes but \u15.

It seems that FCM response a character \u15 which can't be parsed. I am not sure is it because my wrong configuration or it's a bug?

My Configuration is as below:
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() .setXmppDomain(FcmSettings.FCM_SERVER_CONNECTION) .setHost(FcmSettings.FCM_SERVER) .setPort(FcmSettings.FCM_PORT_DEVELOPMENT) .setSecurityMode(SecurityMode.ifpossible) .addEnabledSaslMechanism("PLAIN") .setEnabledSSLProtocols(enabledSSL) .setConnectTimeout((int) FcmSettings.timeout_milisecond) .setUsernameAndPassword(sasl_auth, FcmSettings.FCM_AuthKey) .setSendPresence(false) .build();

Regards,
David

Integration With Ejabberd ( Any XMPP Server)

Currently, I am using Ejabberd Server and Smack library on the client-side( Android Application). When TCP connection closed by android platform due to Network changes or services killed by OS, I am trying to reconnect. Reconnection is happening most of the time.

But in recent released android OS, they have added DOZE mode to restrict apps to run in the background when the device is locked. When the device lost connection with Ejabberd server, the user will be treated as offline. Then I am sending FCM notification through Ejbberd offline hook. I created one API service, where inputs will be coming from Ejabberd offline hook. The same inputs passed to FCM REST API. When I receive the FCM notification on the device, I am connecting to Ejabberd server in the background. But Some android devices(Newer devices) not allowing me to connect to the XMPP server in the background.

I would like to know will this library help me to resolve my issue.

I would be thankful for your suggestions and guidance.

TLS initialization

Hi. Do you know how handshake a secure connection?
I get this error when I tried do set config.setSecurityMode(SecurityMode.required);
Exception in thread "main" org.jivesoftware.smack.SmackException$SecurityRequiredByClientException: SSL/TLS required by client but not supported by server

I know that Firebase do not support STARTTLS extension. So how to do it in the other way?

how to run the server in debug mode with jar

Hi Carlos,

The xmpp server project only produces jar file. Shall I specify EntryPoint.java as main class in my pom.xml to launch the xmpp server for my development? Thanks

-Himanshu

INTERNAL SERVER ERROR

Hi,

I am using this setup in my spring boot server. It is saying user logged in successfully, but I am getting INTERNAL SERVER ERROR ( NACK ).

PFA the Logs -

2018-07-13 13:50:53.103 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Initiating connection ...
2018-07-13 13:50:53.149 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Connecting to the server ...
2018-07-13 13:50:54.663 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : SASL PLAIN authentication enabled ? true
2018-07-13 13:50:54.663 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Is compression enabled ? false
2018-07-13 13:50:54.663 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Is the connection secure ? false
2018-07-13 13:50:55.177 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sent:
2018-07-13 13:50:55.426 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sent:
2018-07-13 13:50:55.674 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : User authenticated.
2018-07-13 13:50:55.674 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sending queued pending messages through the new connection.
2018-07-13 13:50:55.674 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Pending messages size: 0
2018-07-13 13:50:55.675 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Filtered pending messages size: 0
2018-07-13 13:50:55.675 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sending queued sync messages ...
2018-07-13 13:50:55.675 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sync messages size: 0
2018-07-13 13:50:55.675 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Filtered sync messages size: 0
2018-07-13 13:50:55.675 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : User logged in: [email protected]
2018-07-13 13:50:55.676 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sending downstream message.
2018-07-13 13:50:55.677 INFO 5619 --- [nio-9180-exec-4] i.n.notifications.xmpp.server.CcsClient : Sent: {"data":{"message":"This is a simple notification message"},"message_id":"m-20180713135055-06117d92-0b8d-4e6b-88ff-b140219dc2de","to":"dFLSdm7Y_fE:APA91bG-aTCA8hjdhaziYOpZmsuevUswyT5ywonAdRuP-MfMya5U_wJMAetfNkrJwTWckIQpC6pTgdpOBxuoCVf-qSgb7wGFP4ncU-umTHIajZNUyK5bIF5CmhnN5KdFd3Ve2nt7HYMsd9KpJwoKZRGBg19vIoPL8g"}
2018-07-13 13:50:55.930 INFO 5619 --- [Cached Executor] i.n.notifications.xmpp.server.CcsClient : Processing packet in thread Smack Cached Executor - 63
2018-07-13 13:50:55.930 INFO 5619 --- [Cached Executor] i.n.notifications.xmpp.server.CcsClient : Received: {"message_type":"nack","from":"dFLSdm7Y_fE:APA91bG-aTCA8hjdhaziYOpZmsuevUswyT5ywonAdRuP-MfMya5U_wJMAetfNkrJwTWckIQpC6pTgdpOBxuoCVf-qSgb7wGFP4ncU-umTHIajZNUyK5bIF5CmhnN5KdFd3Ve2nt7HYMsd9KpJwoKZRGBg19vIoPL8g","message_id":"m-20180713135055-06117d92-0b8d-4e6b-88ff-b140219dc2de","error":"INTERNAL_SERVER_ERROR","error_description":""}
2018-07-13 13:50:55.931 INFO 5619 --- [Cached Executor] i.n.notifications.xmpp.server.CcsClient : Server error: INTERNAL_SERVER_ERROR ->
2018-07-13 13:51:29.357 INFO 5619 --- [xecutor Service] i.n.notifications.xmpp.server.CcsClient : Sent:

Keep the main thread alive

You can this to keep the main thread alive:

        try {
            CountDownLatch latch = new CountDownLatch(1);
            latch.await();
        } catch (InterruptedException e) {
            logger.log(Level.SEVERE, "An error occurred while latch was waiting.", e);
        }

Spring Deployment

Hi,

I am trying to set up this project in spring boot. Have you figured out how to do this?
I am completely new to Spring and XMPP.

Great repo by the way. Thanks for it.

Regards
Robin

Exception class has interface as super class

I'm having difficulty attempting to add the GcmPacketExtension where I'm encountering this exception:

Exception in thread "main" java.lang.IncompatibleClassChangeError: class de.measite.minidns.cache.LRUCache has interface de.measite.minidns.DNSCache as super class
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at de.measite.minidns.AbstractDNSClient.<clinit>(AbstractDNSClient.java:40)
	at de.measite.minidns.hla.ResolverApi.<clinit>(ResolverApi.java:25)
	at org.jivesoftware.smack.util.dns.minidns.MiniDnsResolver.<clinit>(MiniDnsResolver.java:54)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.java:219)
	at org.jivesoftware.smack.SmackInitialization.parseClassesToLoad(SmackInitialization.java:199)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:169)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:154)
	at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:120)
	at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:97)
	at org.jivesoftware.smack.provider.ProviderManager.<clinit>(ProviderManager.java:122)
	at com.wedevol.xmpp.server.CcsClient.<init>(CcsClient.java:77)
	at com.wedevol.xmpp.server.CcsClient.<init>(CcsClient.java:69)
	at com.wedevol.xmpp.server.CcsClient.prepareClient(CcsClient.java:62)
	at com.wedevol.xmpp.EntryPoint.main(EntryPoint.java:35)

It's occurring here:

ProviderManager.addExtensionProvider(Util.FCM_ELEMENT_NAME, Util.FCM_NAMESPACE,
		new ExtensionElementProvider<GcmPacketExtension>() {
			@Override
			public GcmPacketExtension parse(XmlPullParser parser, int initialDepth)
					throws XmlPullParserException, IOException, SmackException {
				String json = parser.nextText();
				return new GcmPacketExtension(json);
			}
		});

Should run with Java 7

  • pom.xml is missing compiler.target 1.7 therefore Eclipse is annoyed about @OverRide annotations for implemented methods (allowed since 1.6)
  • In CssClient Java8 lambdas are used. This project can easily run with 1.7 so it should in my opinion.

I will send you a PR

about fcm "delivery_receipt_requested" param

hello ,Thanks for your open source,I am using it now
But something went wrong recently,i send param “delivery_receipt_requested:true” to fcm,But fcm didn't acknowledge me . it Yes before,Can you help with some help ? thank you

Maven Repo?

I'm interested in using this library for a server application I'm developing and I was wondering if this was on any maven repository for me to integrate into my own maven project? Would make things a lot easier for me instead if having to download it my self. Thanks!

High CPU usage (99%) and thread count (20+)

Is anyone else having an issue with a high CPU and thread count that just appeared (yesterday evening.) This is happening on my localhost (macintosh) and my appserver (linux).

I pulled a heap dump, but I can't make sense of it. Is this just happening to me?

Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode):

"pool-5-thread-2" #22 prio=5 os_prio=31 tid=0x00007fd489ba7800 nid=0xd717 waiting on condition [0x0000700001bed000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000795d5b728> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"pool-5-thread-1" #21 prio=5 os_prio=31 tid=0x00007fd488b96800 nid=0xd50f waiting on condition [0x0000700001aea000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000795d5b728> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"FirebaseDatabaseWorker" #20 daemon prio=5 os_prio=31 tid=0x00007fd48a279800 nid=0xd30f waiting on condition [0x00007000019e7000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007958998b8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Smack-Single Threaded Executor 0 (0)" #19 daemon prio=5 os_prio=31 tid=0x00007fd489039000 nid=0xd107 waiting on condition [0x00007000018e4000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000740587fc0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Smack-Incoming Processor 0 (0)" #17 daemon prio=5 os_prio=31 tid=0x00007fd48a27a800 nid=0xcd0f waiting on condition [0x00007000016de000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000740588378> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Smack Packet Reader (0)" #15 daemon prio=5 os_prio=31 tid=0x00007fd48925c000 nid=0xcb03 runnable [0x00007000015da000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:150)
	at java.net.SocketInputStream.read(SocketInputStream.java:121)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:954)
	- locked <0x0000000740219b60> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:911)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	- locked <0x0000000740219c18> (a sun.security.ssl.AppInputStream)
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	- locked <0x000000074021bcb8> (a java.io.InputStreamReader)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.io.BufferedReader.read1(BufferedReader.java:212)
	at java.io.BufferedReader.read(BufferedReader.java:286)
	- locked <0x000000074021bcb8> (a java.io.InputStreamReader)
	at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:41)
	at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2992)
	at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
	at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1384)
	at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1177)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:956)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:971)
	at java.lang.Thread.run(Thread.java:745)

"Smack Packet Writer (0)" #14 daemon prio=5 os_prio=31 tid=0x00007fd489206800 nid=0xc90f waiting on condition [0x00007000014d8000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x000000074021d8d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown.take(ArrayBlockingQueueWithShutdown.java:289)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.nextStreamElement(XMPPTCPConnection.java:1312)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.writePackets(XMPPTCPConnection.java:1329)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.access$2900(XMPPTCPConnection.java:1192)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter$1.run(XMPPTCPConnection.java:1240)
	at java.lang.Thread.run(Thread.java:745)

"AppKit Thread" #11 daemon prio=5 os_prio=31 tid=0x00007fd489119800 nid=0xa0b runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Ctrl-Break" #9 daemon prio=5 os_prio=31 tid=0x00007fd489078800 nid=0x4d03 runnable [0x0000700001149000]
   java.lang.Thread.State: RUNNABLE
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:404)
	at java.net.ServerSocket.implAccept(ServerSocket.java:545)
	at java.net.ServerSocket.accept(ServerSocket.java:513)
	at com.intellij.rt.execution.application.AppMain$1.run(AppMain.java:79)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #8 daemon prio=9 os_prio=31 tid=0x00007fd48901f000 nid=0x4903 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fd48901c000 nid=0x4703 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fd489001000 nid=0x4503 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fd488844800 nid=0x4303 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fd489828800 nid=0x360f waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fd48a009800 nid=0x2e03 in Object.wait() [0x000070000092e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x000000074028ffb8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
	- locked <0x000000074028ffb8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fd489816800 nid=0x2c03 in Object.wait() [0x000070000082b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x0000000740224b48> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x0000000740224b48> (a java.lang.ref.Reference$Lock)

"main" #1 prio=5 os_prio=31 tid=0x00007fd488804000 nid=0x1003 runnable [0x0000700000182000]
   java.lang.Thread.State: RUNNABLE
	at com.wedevol.xmpp.EntryPoint.main(EntryPoint.java:56)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

"VM Thread" os_prio=31 tid=0x00007fd489813800 nid=0x2a03 runnable 

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fd48a003800 nid=0x2203 runnable 

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fd48880d800 nid=0x2403 runnable 

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fd488818800 nid=0x2603 runnable 

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fd488819000 nid=0x2803 runnable 

"VM Periodic Task Thread" os_prio=31 tid=0x00007fd488844000 nid=0x4b03 waiting on condition 

JNI global references: 1778

Heap
 PSYoungGen      total 38400K, used 16617K [0x0000000795580000, 0x000000079a080000, 0x00000007c0000000)
  eden space 33280K, 49% used [0x0000000795580000,0x00000007965ba418,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000799b80000,0x0000000799b80000,0x000000079a080000)
 ParOldGen       total 62976K, used 6983K [0x0000000740000000, 0x0000000743d80000, 0x0000000795580000)
  object space 62976K, 11% used [0x0000000740000000,0x00000007406d1fc8,0x0000000743d80000)
 Metaspace       used 22316K, capacity 22618K, committed 23040K, reserved 1069056K
  class space    used 2829K, capacity 2950K, committed 3072K, reserved 1048576K


[Question] Compiling on Ubuntu Terminal getting this error: “classpath error: ” Works on macOS but not on Ubuntu

I am a iOS developer but have to work on XMPP server. I use your Java library. Thank you for providing the library.
As there is Smack etc I compile a .jar with this command:

mvn clean compile assembly:single

After getting the xmpp-server-jar-with-dependencies.jar I move the .jar file to "~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/" folder. I start to compile the project like this:

java -cp xmpp-server-jar-with-dependencies.jar EntryPoint.java [ARGUMENTS]

In macOS it works. But in Ubuntu it does not work. In ubuntu I use these commands:

javac -cp ~/fcmxmppserverv2-master-2/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master-2/src/main/java/com/wedevol/xmpp/EntryPoint.java

java -cp ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint.java [ARGUMENTS]

Returns this error: "error: class found on application class path: com.wedevol.xmpp.EntryPoint"

If I compile without .java extension (command below), it returns this error:

Error: Could not find or load main class .root.fcmxmppserverv2-master.src.main.java.com.wedevol.xmpp.EntryPoint Caused by: java.lang.ClassNotFoundException: /root/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint

java ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/xmpp-server-jar-with-dependencies.jar ~/fcmxmppserverv2-master/src/main/java/com/wedevol/xmpp/EntryPoint

I searched the web about this but could not solve it. It has been days since I am stucked on this problem. Maybe the solution is very simple but I was not able to detect the problem. Please could you address the problem?

Thank you.

CONNECTION_DRAINING handling

How do you handle CONNECTION_DRAINING message?

I'm doing this:

private void handleConnectionDrainingFailure() {
        logger.log(Level.INFO, "FCM Connection is draining! Initiating reconnection ...");

        XMPPTCPConnection oldConnection = connection;
        oldConnection.disconnect();

        try {
            connect();
        } catch (XMPPException | SmackException | IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }

Exception In Initializer Error

Just wondering if any of you encountered this:

Caused by: java.lang.ExceptionInInitializerError: null
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.java:218)
	at org.jivesoftware.smack.SmackInitialization.parseClassesToLoad(SmackInitialization.java:198)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:168)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:153)
	at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:119)
	at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:96)
	at org.jivesoftware.smack.provider.ProviderManager.<clinit>(ProviderManager.java:121)
	at fcm.CcsClient.<init>(CcsClient.java:88)
	at fcm.CcsClient.<init>(CcsClient.java:78)
	at fcm.CcsClient.prepareClient(CcsClient.java:71)
	at fcm.XMPP.<init>(XMPP.java:26)
	... 18 common frames omitted
Caused by: java.lang.NullPointerException: null
	at org.jivesoftware.smack.util.Objects.requireNonNull(Objects.java:23)
	at org.jivesoftware.smack.util.Objects.requireNonNull(Objects.java:29)
	at org.jivesoftware.smack.util.DNSUtil.setDNSResolver(DNSUtil.java:69)
	at org.jivesoftware.smack.util.dns.javax.JavaxResolver.setup(JavaxResolver.java:76)
	at org.jivesoftware.smack.util.dns.javax.JavaxResolver.<clinit>(JavaxResolver.java:61)
	... 31 common frames omitted

My code where this exception happens is on the first line of

ProviderManager.addExtensionProvider(FCM_ELEMENT_NAME.getValue(), FCM_NAMESPACE.getValue(), new ExtensionElementProvider<FcmPacketExtension>() {
            @Override
            public final FcmPacketExtension parse(XmlPullParser xmlPullParser, int i)
                    throws IOException, XmlPullParserException {
                String json = xmlPullParser.nextText();
                return new FcmPacketExtension(json);
            }
        });

I tried to pattern using the provided samples but I can't make it work in my project. :(

SmackException$NoResponseException

I started to get this. Any ideas?

/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -javaagent:/home/long1eu/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/171.3780.52/lib/idea_rt.jar=46371:/home/long1eu/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/171.3780.52/bin -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/icedtea-sound.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/management-agent.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/rt.jar:/home/long1eu/Desktop/fcmxmppserverv2-master/target/classes:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-java7/4.1.9/smack-java7-4.1.9.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-core/4.1.9/smack-core-4.1.9.jar:/home/long1eu/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar:/home/long1eu/.m2/repository/org/jxmpp/jxmpp-core/0.4.2/jxmpp-core-0.4.2.jar:/home/long1eu/.m2/repository/org/jxmpp/jxmpp-util-cache/0.4.2/jxmpp-util-cache-0.4.2.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-resolver-javax/4.1.9/smack-resolver-javax-4.1.9.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-sasl-javax/4.1.9/smack-sasl-javax-4.1.9.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-tcp/4.1.9/smack-tcp-4.1.9.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-extensions/4.1.9/smack-extensions-4.1.9.jar:/home/long1eu/.m2/repository/org/igniterealtime/smack/smack-im/4.1.9/smack-im-4.1.9.jar:/home/long1eu/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar com.wedevol.xmpp.EntryPoint
09:40:36 PM SENT (0): <stream:stream xmlns='jabber:client' to='FCM XMPP Client Connection Server' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
09:40:37 PM RECV (0): <stream:stream from="FCM XMPP Client Connection Server" id="8E67FC6D5490BA24" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
09:40:37 PM RECV (0): <stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-OAUTH2</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
09:40:37 PM SENT (0): <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>ADk1NTYxODM1OTYxOUBnY20uZ29vZ2xlYXBpcy5jb20AQUFBQTNuOUstVU06QVBBOTFiRllOVzlFMnYxRXNFS3FfbjBDaTlWOWZxaVRleU5aSkJsYjJEdk1yXzRJdVRLUjlTR2RPNTBiM01pelRTbng3VU0zNDU3NW1RaHNXQkRUaHFMVnRhaks1ZTkzRFliV1oyWURYTjZ1UFJfd01LV2lQbVh5SmZnUGx1SDhVd2dRdTZwSGl0UGQ=</auth>
09:40:37 PM RECV (0): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
09:40:37 PM SENT (0): <stream:stream xmlns='jabber:client' to='FCM XMPP Client Connection Server' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' id='8E67FC6D5490BA24' xml:lang='en'>
09:40:37 PM RECV (0): <stream:stream from="FCM XMPP Client Connection Server" id="CF195EA8A5FA80DC" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
09:40:37 PM RECV (0): <stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>
09:40:37 PM SENT (0): <iq id='4MHY9-3' type='set'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>Smack</resource></bind></iq>
Mar 16, 2017 9:40:37 PM com.wedevol.xmpp.server.CcsClient$4 processPacket
INFO: Sent: {}
09:40:37 PM RECV (0): <iq id="4MHY9-3" type="result"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>[email protected]/SmackE5840541</jid></bind></iq>
09:40:37 PM RECV (0):  
Mar 16, 2017 9:40:37 PM com.wedevol.xmpp.server.CcsClient$4 processPacket
INFO: Sent: {}
09:40:37 PM SENT (0): <iq id='4MHY9-5' type='set'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
09:40:37 PM RECV (0): <iq type="result" id="4MHY9-5"/>
09:40:37 PM User logged (0): [email protected]:5236/SmackE5840541
Mar 16, 2017 9:40:37 PM com.wedevol.xmpp.server.CcsClient$4 processPacket
INFO: Sent: {}
Mar 16, 2017 9:40:37 PM com.wedevol.xmpp.server.CcsClient$2 authenticated
INFO: User authenticated
Mar 16, 2017 9:40:37 PM com.wedevol.xmpp.server.CcsClient connect
INFO: Logged in: [email protected]
09:40:37 PM SENT (0): <iq id='4MHY9-7' type='get'><query xmlns='jabber:iq:roster'></query></iq>
09:40:37 PM XMPPConnection authenticated (0)
Mar 16, 2017 9:40:42 PM org.jivesoftware.smack.roster.Roster$3 processException
SEVERE: Exception reloading roster
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=4MHY9-7)), : fromFilter (OrFilter: (FromMatchesFilter (full): null, FromMatchesFilter (bare): [email protected], FromMatchesFilter (full): gcm.googleapis.com)).
	at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:106)
	at org.jivesoftware.smack.AbstractXMPPConnection$6.run(AbstractXMPPConnection.java:1448)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


javax.naming.directory.InitialDirContext is a restricted class

I keep getting this error, but only when I deploy to server. When I run the main function all works well:

java.lang.NoClassDefFoundError: javax.naming.directory.InitialDirContext is a restricted class. Please see the Google  App Engine developer's guide for more details.
	at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:50)
	at org.jivesoftware.smack.util.dns.javax.JavaxResolver.<clinit>(JavaxResolver.java:50)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.jivesoftware.smack.SmackInitialization.loadSmackClass(SmackInitialization.java:213)
	at org.jivesoftware.smack.SmackInitialization.parseClassesToLoad(SmackInitialization.java:193)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:163)
	at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:148)
	at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:116)
	at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:96)
	at org.jivesoftware.smack.provider.ProviderManager.<clinit>(ProviderManager.java:121)
	at eu.long1.jwnotes.backend.server.CcsClient.<init>(CcsClient.java:62)
	at eu.long1.jwnotes.backend.server.CcsClient.<init>(CcsClient.java:53)
	at eu.long1.jwnotes.backend.server.CcsClient.prepareClient(CcsClient.java:83)
	at eu.long1.jwnotes.backend.server.GCMContextListener.contextInitialized(GCMContextListener.java:26)
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
	at org.mortbay.jetty.Server.doStart(Server.java:224)
	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
	at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:268)
	at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)
	at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
	at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)
	at com.google.appengine.tools.development.Modules.startup(Modules.java:105)
	at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:262)
	at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:45)
	at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:217)
	at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:215)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:215)
	at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:349)
	at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:47)
	at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:222)
	at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:213)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

SaslErrorException on trying to run the server

Hi, i cloned your server and tried running it in netbeans. However i am getting the following exception:
org.jivesoftware.smack.sasl.SASLErrorException: SASLError using PLAIN: not-authorized at org.jivesoftware.smack.SASLAuthentication.authenticationFailed(SASLAuthentication.java:290) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1082) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:980) at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:996) at java.lang.Thread.run(Thread.java:745)

I am using the project_id and web api key i found from the Firebase console of the app. Please help me figure out the solution to this.
thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.