Using CsIL
jboss2005_01 Jan 19, 2006 11:25 AMMoved from original topic found at:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=61886&postdays=0&postorder=asc&start=10
Hi,
Great that you responded in such a fast way. It would be nice if everybody answered that fast on different forums :-). I tried the code you provided as an example but I must do something wrong since I'm getting strange error messages from .NET. I provided the stacktrace together with my example below. Any suggestion what I am doing wrong? I followed the installation instruction provided with the installation and tried using a clean JBoss install. I am using Visual Studio .NET 2003 (.NET 1.1 thus) and JBoss 4.0.2 bound to JDK 1.5.0_04. In your documents you reffer to the commons-codec-1.2.jar and castor-0.9.9-wml.jar. Do I have to install these libraries too perhaps? If so, where do I have to place them? Below jboss/server/lib?
Stacktrace:
Value cannot be null. Parameter name: type at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at tamalesoftware.messaging.ConnectionFactory.CreateServerIL() at tamalesoftware.messaging.Connection..ctor(AuthenticationRequest pAuth, ConnectionFactory pFact ory) at tamalesoftware.messaging.ConnectionFactory.CreateConnection(Authentication Request pAuth) at tamalesoftware.messaging.ConnectionFactory.CreateConnection() at JMSTest.JMSTest..ctor() in d:\visual studio projects\jmstest\jmstest\jmstest.cs:line 19
C# code:
using System; using tamalesoftware.messaging; using tamalesoftware.jms; using tamalesoftware.concurrent; namespace JMSTest { class JMSTest { public JMSTest() { try { ConnectionFactory factory = new ConnectionFactory(); factory.Config.ServerAddress = "192.168.3.120"; factory.Config.Port = 8094; factory.Config.PingPeriod = 10; AuthenticationRequest auth = new AuthenticationRequest("admin", "admin"); Connection conn = factory.CreateConnection(); 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 = "Dit is een test."; publish.Send(message); } catch(Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } Console.ReadLine(); } public void doEvent(object sender, OnMessageEventArgs args) { Console.WriteLine("--> " + args.Message); } [STAThread] static void Main(string[] args) { new JMSTest(); } } }
I asume that the user and password required for authentication is a password assigned to the JMS systems.
Again, any advise would be appreciated and thanks again for your fast response.
Greetings,
Kurt