JClaim with JOscar problem

19 views
Skip to first unread message

Mihai Dumitrache

unread,
Oct 14, 2008, 12:37:22 PM10/14/08
to joscar discussion
Hello,
I am trying to build an AIM client with JClaim. First a message for
dev guys: please put somewhere javadoc or some sort of nice and simple
documentation. Anyway here i go:

My main method is here:

MessageSupport conn = new OscarConnection();
conn.assignGroupFactory(new GroupImplFactory());
conn.assignContactFactory(new ContactImplFactory());
conn.setUserName("aim user");
conn.setPassword("aim password");
try {
conn.addEventListener(new BotEventHandler());
conn.connect();
} catch (Exception e) {
System.out.println("Failed to create required pieces.
Shutting down.");
e.printStackTrace();
return; // No point waiting if connection isn't available
}
while (true) { // Simplified version of "stick around" wait
GeneralUtils.sleep(60*60*1000);
}

Note: I have declared all the other listeners and classes just like in
the example from javaWorld.
Actually the thing is that, on runtime i get this:
Exception in thread "main" java.lang.NoClassDefFoundError: net/
kano/joscar/LiveWritable
at IM.main(IM.java:152)
Caused by: java.lang.ClassNotFoundException:
net.kano.joscar.LiveWritable
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

and i really do not know what LiveWritable is, and where to find this
class. How can i fix this problem ? and connect to aim servers, chat
and all the other things ?

----
Second thing: I saw that in com.itbs.aimcer.commune are some
subclasses: jaim for example. I thought that this is another way to
connect to aim, but i get other exception: NoClassDefFound:
JAimEventListener. I have searched the tree for this class and no
class was found.

Please help me.
Thanks

Keith Lea

unread,
Oct 14, 2008, 3:42:27 PM10/14/08
to joscar-...@googlegroups.com
I haven't used jclaim but it looks like you're simply missing one of the joscar jars in your classpath.

Alex Rass

unread,
Oct 14, 2008, 9:46:04 PM10/14/08
to joscar-...@googlegroups.com
Mihail,

Go and read through the documentation section in the jclaim project.
It will really help you.

- Alex.

mmdumi

unread,
Oct 15, 2008, 1:38:58 AM10/15/08
to joscar-...@googlegroups.com
There is no real documentation. Sry
--
Dumitrache Mihai - Marian
http://www.takemyview.com/blog

Alex Rass

unread,
Oct 15, 2008, 2:32:04 AM10/15/08
to joscar-...@googlegroups.com

What about this?

 

https://sourceforge.net/docman/?group_id=160697

 

Is this not “real documentation”?

 


mmdumi

unread,
Oct 15, 2008, 2:56:22 PM10/15/08
to joscar-...@googlegroups.com
As i said "there is no real documentation". If the guys from sun would create such a documentation it will be like "hello, this is what we can do, so, try to read all of our .java files and maybe you will understand what java is".

I have used a lot of apis and until now everyone got at least javadoc and lot of code examples, where "code examples" = build-in clients for msn let's say.
At the end: thanks for your time, but i'm not satisfied.

Alex Rass

unread,
Oct 15, 2008, 11:11:55 PM10/15/08
to joscar-...@googlegroups.com

Misha,

You are being ridiculous.

 

1)       There is an ENTIRE client in java. (You want source – there it is).

2)       There is a javaworld article with diagrams AND code examples in the docs section (I gave you a link earlier)

3)       There are a ton of other related docs in the documentation section (link earlier)

4)       There is Javadoc for the entire tree. Download the source tree and I believe it’s the typical “ant javadoc” command.

5)       This is an open source project – you want something better – SUBMIT it.

 

Don’t bitch – contribute.

 


From: joscar-...@googlegroups.com [mailto:joscar-...@googlegroups.com] On Behalf Of mmdumi
Sent: Wednesday, October 15, 2008 2:56 PM
To: joscar-...@googlegroups.com
Subject: [joscar-discuss] Re: JClaim with JOscar problem

 

As i said "there is no real documentation". If the guys from sun would create such a documentation it will be like "hello, this is what we can do, so, try to read all of our .java files and maybe you will understand what java is".

Alex Rass

unread,
Oct 16, 2008, 11:19:30 AM10/16/08
to joscar-...@googlegroups.com

I am consistently seeing this problem where joscar doesn’t notice that it’s disconnected/gone offline.

 

I can send messages fine, but people never receive them.

 

I am guessing AIM changed the way the idle is checked. Maybe someone could look into it?  A bunch of my users are reporting same problem.

 

This is a BIG problem for us. Can’t use the protocol like this.

 

 

ICQ:

ICQ has a similar problem.

 

Alex Rass

unread,
Oct 17, 2008, 11:46:58 AM10/17/08
to joscar-...@googlegroups.com

Found out more details:

People who are using this lib (through JClaim) found out that their company’s firewall kills connections after 1h of inactivity.

So that means we don’t have ANY heartbeats on (some) sockets?

Can someone look into it please? This is a big problem. Every other client works just fine for them (other implementations).

 

This should be SO simple…

Just let the connection sit there and see what client sends to server over the course of an hour. Then do same ourselves.

 


From: joscar-...@googlegroups.com [mailto:joscar-...@googlegroups.com] On Behalf Of Alex Rass


Sent: Thursday, October 16, 2008 11:20 AM
To: joscar-...@googlegroups.com

Keith Lea

unread,
Oct 17, 2008, 1:19:02 PM10/17/08
to joscar-...@googlegroups.com
I remember experimenting with this. The official clients send FLAP packet with type 0x5 - and the server sends one back. It appears to be a ping. However, when I tried making joscar send it, the server would disconnect me instantly upon sending the packet.

Alex Rass

unread,
Oct 17, 2008, 3:45:39 PM10/17/08
to joscar-...@googlegroups.com

There’s a KeepaliveSender class which does *try* to send heatbeats (Flap(5)) to keep alive. But it doesn’t do what it’s supposed to for some reason.

Maybe there’s no guarantee that if it comes back empty there’s a logout callback initiated?

 

I named the thread so I can track them easier. There are about 3 of these per connection.

And running a debugger tells me that it does work (send flap packets).

 


From: joscar-...@googlegroups.com [mailto:joscar-...@googlegroups.com] On Behalf Of Keith Lea


Sent: Friday, October 17, 2008 1:19 PM
To: joscar-...@googlegroups.com

Keith Lea

unread,
Oct 17, 2008, 4:05:27 PM10/17/08
to joscar-...@googlegroups.com
"doesn't do what it's supposed to"? If you mean it doesn't listen for a response, that might be true. So - I guess the AIM server doesn't disconnect for that anymore? that's a good sign. does it send responses?

Alex Rass

unread,
Oct 17, 2008, 6:07:52 PM10/17/08
to joscar-...@googlegroups.com

Yeah, I put a break point on it, so the sendFlap call does happen.

Perhaps we should see if anything comes back, so it’s a full heartbeat and not just a keepalive?

Keith Lea

unread,
Oct 17, 2008, 9:22:29 PM10/17/08
to joscar-...@googlegroups.com
yes - maybe some packet sniffing would determine whether a response is seen or not. or you could find where it would be handled in joscar code and add a breakpt.

Alex Rass

unread,
Oct 18, 2008, 2:20:54 PM10/18/08
to joscar-...@googlegroups.com

Ok, will do.

In the mean time:

Is there more than 1 socket used?

Cause then we’ll need a heartbeat on each one. Right now it’s only added to OscarConection.

Reply all
Reply to author
Forward
0 new messages