FAQ Database Discussion Community


Initialization exception “NoClassDefFoundError: javax.naming.directory.InitialDirContext” when using Smack 4.1 on Android

android,exception,xmpp,smack
I am trying to use Smack for my project. I have previously used aSmack in some of my earlier projects which worked really well. However Smack is giving me weird exceptions. Here's my initialization code looks like - public void init(String username, String password) throws IOException, XMPPException, SmackException { mConnection...

How do I get the CDATA from a [Smack XMPP API] MultiUserChat Message?

xmpp,smack,cdata
Smack's debugging console messages show me a full message including the message detail in the CDATA I'm looking for: 11:45:05 AM RECV (0): < 11:45:05 AM RECV (0): message to="[email protected]/Smack" type="groupchat" from="[email protected]/roomname-abc"><body>ABCD issues valid 2015-06-05T15:45:00Z</body><html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml">ABCD issues valid 2015-06-05T15:45:00Z</body></html> <x xmlns="roomname-abc"...

Cannot connect to local XMPP server using aSmack

android,xmpp,smack,asmack
I am trying connect to a local XMPP server (Vysper) from an Android App using this code: // ... ConnectionConfiguration connectionConfig = new ConnectionConfiguration("192.168.1.107", 5222); // load file from "Pictures" directory from Internal Memory File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); file.mkdirs(); connectionConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.required); System.setProperty("javax.net.ssl.trustStore", file + "/clientkeystore"); Log.i("Info",...

Retrieving last items from XMPP PubSub Node with Smack always returns only a single item

java,xmpp,publish-subscribe,smack
I'm using the latest Smack (4.1) for my Android application. When retrieving persistent items from a node, does it only return the latest published items for each user? Right now, when I try to call getItems, I seem to only get the latest published event from each user. I would...

How to implement message read status like whatsapp blue tick mark?

android,xmpp,smack,asmack
I am developing one application in that chatting is one module, for chatting i am using xmpp. when i am sending message i am getting that message delivery status using DeliveryReceiptManager. DeliveryReceiptManager.getInstanceFor(connection).enableAutoReceipts(); DeliveryReceiptManager.getInstanceFor(connection).addReceiptReceivedListener(new ReceiptReceivedListener() { @Override public void onReceiptReceived(String arg0, String arg1, String arg2) { Log.v("app", arg0 + ", "...

How can I upload user's profile picture to server when registering new user ?

android,xmpp,openfire,smack,asmack
I am developing an android app using XMPP (Openfire) . User can register new account from that app and they can set their profile picture in register form. I want to know how can I save that profile picture to Openfire server.

error in connect to xmpp(openfire) server using java

java,xmpp,openfire,smack
I am new to XMPP. For a whole day I am stuck in connecting to my XMPP server (Openfire version 3.9.3) from Java. I am using the Smack (version 4.0.7) library. Here is simple code... ConnectionConfiguration config =new ConnectionConfiguration("servername",5223); XMPPTCPConnection connection = new XMPPTCPConnection(config); // Connect to the server try...

xmppconnection error on smack 4.1.0 beta3

android,xmpp,smack
i'v test connection between eclipse with Smack 4.1.0 Beta3 and openfire in localhost, but got some error. XMPPTCPConnectionConfiguration conf =XMPPTCPConnectionConfiguration.builder() .setHost("127.0.0.1") .setPort(5222) .setCompressionEnabled(false) .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled) .build(); XMPPTCPConnection connection = new XMPPTCPConnection(conf); try { connection.connect(); connection.login("admin","admin"); } catch (SmackException | IOException | XMPPException e) { // TODO Auto-generated catch block...

SMACK and Google Hangouts - Listen for invitations

java,android,xmpp,smack
Does anyone know whether or not SMACK can listen for group hangout invitations? I have tried adding a listener MultiUserChat.addInvitationListener(...) I have tried joining a room manually and then in code tried: for (String room : MultiUserChat.getJoinedRooms(connection, connection.getUser())) { dLog(String.format("%s -> getJoinedRooms? %s", getUsername(), room)); } But I never see...

Samck 4.1 error while connecting to openfire server (org.jivesoftware.smack.sasl.SASLErrorException: SASLError using DIGEST-MD5: not-authorized)

android,chat,openfire,smack,asmack
public void connect(){ AsyncTask connectionThread = new AsyncTask(){ @Override protected Boolean doInBackground(Void... arg0){ boolean isConnected = false; StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder(); configBuilder.setUsernameAndPassword("ahsan", "vbase123"); configBuilder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);...

GCM XMPP Server using Smack 4.1.0

xmpp,android-gcm,server,smack
I'm trying to adapt the example provided here for Smack 4.1.0. and getting a little confused. Specifically I'm struggling to understand what the GcmPacketExtension should now extend, how the constructor should work and how the Providermanager.addExtensionProvider should be updated to tie in with it. I'm sure someone must have done...

Java XMPP clint with smack 4.1 NoClassDefFoundError:

eclipse,maven,gradle,build.gradle,smack
I am trying to write XMPP Clint using smack 4.1.1. I have added smack jar files into build path. I am using eclipse IDE to write the code. However, when I am trying to run application I get NoClassDefFoundErrors. I fixed some of these errors adding xpp3, jxmpp and minidns...

Smack 4.1 Android anonymous registration to Openfire

android,tcp,xmpp,openfire,smack
I want connect anonymously to openfire server with Android Smack 4.1 client and register the new user (username = "wq", password="wq") with AccountManager, and then disconnect and login as non-anonymous registered user. 3.1.1 Registration with a Server Special care must be taken when an unregistered entity interacts with a server...

Android Smack MessageEventManager not compiling

android,xmpp,openfire,smack,asmack
I am using smack API with openfire server to make an android app. I am trying to implement a MessageEventManager and MessageEventProvider to my app so it will tell me if the message was delivered or not though when i try to declare it a MessageEventManager, it is not compiling...

Typing Status Smack 4.1

android,xmpp,smack,asmack
Hey I am trying to get typing status when the other person starts writing even though it is returning an empty message with the state as a message but it is coming from proccessMessage method. Shouldn't it be returned in the stateChanged? I haven't enabled any PacketProvider though, Do i...

Create a group on openfire from an Android app

java,android,openfire,smack,asmack
I developed a chat application (Android platform, native Android development) using asmack library. Also I have a task to create from the application group in openfire server. I don't know how to do it. And also additional question: is it possible or not? ...

Smack throws “NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils”

java,android,smack
I got a problem with my app in which I want to create a simple XMPP client that connects to my server. I got the following problem when I'm starting the app (compilation runs through without problems), but my app closes instantly. java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils; at org.jivesoftware.smack.provider.ProviderManager.getKey(ProviderManager.java:314) at...

SASLError using PLAIN: not-authorized

android,xmpp,smack,asmack,saslerror
I am trying to shift my app from aSmack to Smack 4.1.1. However I am having trouble using the same server and login details in the case of Smack while on aSmack it is working excellently. Here's my old code of login in aSmack - void startConnect(boolean sslFlag) throws XMPPException,...

Compile java program on linux with external libraries

java,linux,compilation,smack
I am trying to compile a java file using SMACK for the XMPP libraries. In the folder of the java file i have included a Libs directory including all the *.jar files for SMACK but when i try javac filename i get this output: SmackCcsClient.java:6: error: package org.jivesoftware.smack does not...

File Transfer fails on Smack 4.1.0 beta-1

java,xmpp,openfire,smack
I am working on an application involving two Smack clients, one of which attempts to send a jar file to the other client. I am writing this as a part of a desktop application, not an Android application (thought I'd make that distinction since most Smack queries on StackOverflow are...

how to login with email adress using smack,openfire ,android?

android,xmpp,openfire,smack
i have a problem using smack api i'd like to allow the users to login using their email not username how to do it ?i'm using openfire,xmpp,smack API android

How can I add custom attribute (nick) in my XMPP message tag, in Smack 4.1

android,xmpp,smack
I want to add custom attribute (nick) in my XMPP chat message, like the following example <message from='*' to='*' id='123' nick='KASHIF' type='chat'><body>hello</body></message> I know, it is not recommended by XMPP but it is my requirement as this attribute(nick) is already implemented in the iOS version of the app i am...

Instantiate ConnectionConfiguration in Smack 4.1

android,xmpp,openfire,smack
I am implementing a chat feature in my android app. So I have installed an open fire server and Smack Client library and now I have written a code to connect with the server but I am getting an error which states that ConnectionConfiguration is an abstract class.So i cant...

Smack 4.1 Disable Auto Receipts

android,xmpp,smack
I have just switch to Smack 4.1 from depreciated asmack. Smack 4.1 is automatically sending receipts with wrong id attached which is causing exception in my case. Smack 4.1 is attaching 2 different id's with receipt Here is the chat message received RECV (0): <message from='***' to='***' xml:lang='en' id='65' kind='0'...

XMPP register new user

java,android,xmpp,smack
I am having lots of trouble with XMPP, I am new to it and all the examples that I have found already have an account with which they connect and then do things. My problem concerns new users. Someone who does not have an account needs to be able to...

ClassNotFoundException smack XMPPConnection

java,servlets,xmpp,android-gcm,smack
im following this documentation to achieve gcm upstream message. so far,i've created a servlet,and from that servlet im calling the SmackCcsClient. ConnectionConfiguration config = new ConnectionConfiguration(GCM_SERVER, GCM_PORT); config.setSecurityMode(SecurityMode.enabled); config.setReconnectionAllowed(true); config.setRosterLoadedAtLogin(false); config.setSendPresence(false); config.setSocketFactory(SSLSocketFactory.getDefault()); connection = new XMPPTCPConnection(config); connection.connect();...