[Asterisk-java-users] DefaultManagerConnection constructor problems
Brought to you by:
srt
From: Alex M. <al...@go...> - 2005-02-28 21:36:18
|
There seems to be a problem with the constructor for the DefaultManagerConnection class. I've done as much debugging as I could on my end, and it seems to be a thread synchronization problem somewhere. Here's the exception that gets thrown: java.lang.NullPointerException at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:380) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:328) at net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultMana= gerConnection.java:316) at TestingAsterisk.testLogin(TestingAsterisk.java:64) at TestingAsterisk.<init>(TestingAsterisk.java:18) at TestingAsterisk.main(TestingAsterisk.java:86) TestingAsterisk is my test program. It is an exact copy of TestDefaultManagerConnection with a constructor and main() added. The problem occurs when trying to create a connection using something other than the default constructor with appropriate setter methods. Here's the exact code: dmc =3D new DefaultManagerConnection(); dmc.setUsername("user"); dmc.setPassword("password"); dmc.setHostname("hostname"); Doing this works just fine. Program executes, events come back, etc. However, if I try using this instead: dmc =3D new DefaultManagerConnection("hostname", 5038, "user", "password"); I've tested this about 5 times so far and I get consistent results each time. Just in case it matters, I'm using Eclipse 2.1 on a Linux system with the 1.5 JDK. Any ideas? --=20 Alex Malinovich Golden Technologies, Inc. (219) 462-7200 x 216 http://www.golden-tech.com |