[jboss-user] [Messaging, JMS & JBossMQ] - Re: Using CsIL

markuskolp do-not-reply at jboss.com
Tue Feb 13 04:23:03 EST 2007


Hi, I'm using Jboss 4 and XIL2 and can't get your examples working.

I get a problem when trying to create a Connection-Object.

  | ...
  | Connection conn = factory.CreateConnection(auth);
  | // alternative: Connection conn = factory.CreateConnection();
  | // alternative: Connection conn = new Connection(auth, factory);
  | ...
  | 

The stacktrace says following:

  | Object reference not set to an instance of an object.
  | 
  | at tamalesoftware.messaging.Connection.Authenticate(AuthenticationRequest pAuthRequest)
  |    at tamalesoftware.messaging.Connection..ctor(AuthenticationRequest pAuth, ConnectionFactory pFactory)
  |    at tamalesoftware.messaging.ConnectionFactory.CreateConnection(AuthenticationRequest pAuth)
  |    at TryAndError.Form1.btnCSILsendMessage_Click(Object sender, EventArgs e) in c:\...\TryAndError\Form1.cs:line 211
  | 

I tried to use the keyword "new", but that doesn't work either.

Here is my complete listing:


  | private void btnCSILsendMessage_Click(object sender, EventArgs e)
  |         {
  |             try
  |             {
  |                 
  |                 ConnectionFactory factory = new ConnectionFactory();
  |                 factory.Config.ServerAddress = "10.252.103.201";
  |                 factory.Config.Port = 8094;
  |                 factory.Config.PingPeriod = 10;
  | 
  |                 //======================================================================
  | 
  |                 factory.Config.Username = "admin";
  |                 factory.Config.Password = "admin";
  |                 factory.Config.TcpNoDelay = false;
  |                 factory.Config.ServerILName = "tamalesoftware.messaging.csil.xil2.XIL2ServerIL";
  |                 factory.Config.ClientILServiceName = "tamalesoftware.messaging.csil.xil2.XIL2ClientILService";
  |                 factory.Config.Xil2blockwriterblocksize = 128;
  |                 factory.Config.Xil2blockwriterdelimiterchar = 0;
  |                 factory.Config.Xil2blockwriterpaddingchar = 32;
  |                 factory.Config.Usessl = false;
  | 
  |                 //======================================================================
  |                  
  |                 AuthenticationRequest auth = new AuthenticationRequest("admin", "admin");
  |                 //Connection conn = new Connection(auth, factory);
  |                 Connection conn = factory.CreateConnection(auth);
  |                 conn.Start();
  | 
  |                 Session session = new Session(conn, AcknowledgementTypes.AUTO_ACKNOWLEDGE);
  |                 Topic topic = conn.CreateTopic("topic/SMCTopic");
  |                 ITopicSubscriber subscribe = session.CreateSubscriber((ITopic)topic);
  |                 subscribe.Listen += new OnMessageEventHandler(doEvent);
  | 
  |                 ITopicPublisher publish = session.CreatePublisher((ITopic)topic);
  |                 TextMessage message = new TextMessage();
  |                 message.Text = "This is a test.";
  |                 publish.Send(message);
  |                 MessageBox.Show("message sent");
  |             
  |             }
  |             catch (Exception ex)
  |             {
  |                 MessageBox.Show(ex.Message);
  |                 MessageBox.Show(ex.StackTrace);
  |                 txtCSILMessage.Text = ex.Message + " " + ex.StackTrace;
  |             }
  | 
  | 
  |         }
  | 
  |         public void doEvent(object sender, OnMessageEventArgs args)
  |         {
  |           MessageBox.Show("--> " + args.Message);
  |         }
  | 

Any advice?

Thanks, Markus



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015675#4015675

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015675



More information about the jboss-user mailing list