android & Smack

by Micka » Wed, 25 Jun 2008 00:07:38 GMT


Sponsored Links
 Hi,

i make a program on Android with the librairy smack.


It's work when i want to connect the server, easy !


but when i want t get the ServiceDiscoveryItem , i've a crash
system ... :


Uncaught handler: thread Main exiting due to uncaught exception

java.lang.RuntimeException: Unable to start activity
ComponentInfo{test.msn/test.msn.msn}: java.lang.ClassCastException:
Lorg/jivesoftware/smack/PacketReader$4;

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1758)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1770)

at android.app.ActivityThread.access$1500(ActivityThread.java:99)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
1271)
at android.os.Handler.dispatchMessage(Handler.java:80)
at android.os.Looper.loop(Looper.java:91)

at android.app.ActivityThread.main(ActivityThread.java:3052)

at java.lang.reflect.Method.invokeNative(Native Method)

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

at android.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1547)

at android.os.ZygoteInit.main(ZygoteInit.java:1445)

at android.dalvik.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: Lorg/jivesoftware/smack/
PacketReader$4;

at
org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryManager.java:
462)
at
org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryManager.java:
426)

at test.msn.msn.onCreate(msn.java:39)

at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
847)

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1728)

... 11 more


i didn't unserstand!


that is my code to test the connection :

XMPPConnection connexion;

ConnectionConfiguration connConfig = new ConnectionConfiguration(
"xx.xxx.net", 5222);
connexion = new XMPPConnection(connConfig);

try{
connexion.connect();
connexion.login("micka", "micka");
}catch (XMPPException e){

}

ServiceDiscoveryManager serviceDiscoveryManager = new
ServiceDiscoveryManager(
connexion);
try {
serviceDiscoveryManager.discoverItems(connexion.getHost());

// return serviceDiscoveryManager.discoverItems(entityId);
} catch (XMPPException e) {
Log.e("msn","Can't get discovery items for entityId: "+
" : " + e);

} catch(NullPointerException e){

}

the probleme is in the discoveryintems function :(

can you help me ? please !

thank you very much !

--~--~---------~--~----~------------~-------~--~----~



android & Smack

by Micka » Fri, 27 Jun 2008 01:28:38 GMT


  discovered that the error is here :



smack 3.0.4 :



smack/XMPPConnection.java




if (isFirstInitialization) {
// Notify listeners that a new connection has been established
for (ConnectionCreationListener listener :
connectionEstablishedListeners) {
listener.connectionCreated(this); <== in this line

}
}







can you explain me, what i can do ?



On 24 juin, 17:49, Micka <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. What "/dev/omap_csmi_tty1" of reference-ril.c is?

Would somebody please tell me what "/dev/omap_csmi_tty1" is?

According to reference-ril.c for RIL_REQUEST_SETUP_DEFAULT_PDP, it
seems "/dev/omap_csmi_tty1" is passed as follows via
RIL_onRequestComplete() after complete the necessary procedure for PDP
Context activation.

#define PPP_TTY_PATH "/dev/omap_csmi_tty1"
 ................. abbr  .................
static void requestSetupDefaultPDP(void *data, size_t datalen,
RIL_Token t)
{
    const char *apn;
    char *cmd;
    int err;
    ATResponse *p_response = NULL;
    char *response[2] = { "1", PPP_TTY_PATH };
 ................. abbr  .................
    RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof
(response));

And according to PdpConnection.java, it seems above "response" is
handled as follows.

    public void handleMessage(Message msg) {
        AsyncResult ar;
        switch (msg.what) {
            case EVENT_SETUP_PDP_DONE:
 ................. abbr  .................
                    } else {
                        String[] response = ((String[]) ar.result);
                        cid = Integer.parseInt(response[0]);
                        if (response.length > 2) {
                            interfaceName = response[1];
                            ipAddress = response[2];
                            String prefix = "net." + interfaceName +
".";
                            gatewayAddress = SystemProperties.get
(prefix + "gw");
                            dnsServers[0] = SystemProperties.get
(prefix + "dns1");
                            dnsServers[1] = SystemProperties.get
(prefix + "dns2");
                            if (DBG) {
                                log("interface=" + interfaceName + "
ipAddress=" + ipAddress
                                    + " gateway=" + gatewayAddress + "
DNS1=" + dnsServers[0]
                                    + " DNS2=" + dnsServers[1]);
                            }

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Error about building adb for windows

Hi all,

I got headache of adb building.

Under cygwin, when i run make_windows_sdk.sh, it always say "No rule
to make target 'adb' ".
Should i make sdk under cygwin first and then run sh?

Appreciate to your help.

Best Regards
Allen
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. porting android to omap3 evm

4. Adding jpg into content resolver

5. libdvm.so linking error ?

6. Users can't alter expired card details on-phone

7. Problem when initing root file systems