JMS without JNDI?

We run portlets in WebSphere 6.01 using Java 1.4. We want to send JMS messages to the JBoss 5 queue using Java 5 (or maybe 6, but, of course, newer than 1.4). Attempting to connect using JNDI does not work, since we must include client JBoss banks in the path to the portlet classes, and they are Java 1.5. Therefore, when I try to create an InitialContext, I get an unsupported major / minor error.

Can I connect directly to JBoss without using JNDI? Or is there some way around this problem that I cannot think of?

+3
source share
6 answers

JMS JBoss JNDI, JAR JBoss JAR JMS. JNDI, JMS API-, API- .

+2

JNDI, Java 5, JBoss, . . WebSphere MQ JMS , WMQ, JBoss . WMQ JmsProducer.java:

  JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
  JmsConnectionFactory cf = ff.createConnectionFactory();

  // Set the properties
  cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);
  cf.setIntProperty(WMQConstants.WMQ_PORT, port);
  cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
  cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
  cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName);

  // Create JMS objects
  connection = cf.createConnection();
  session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
  if (isTopic) {
    destination = session.createTopic(destinationName);
  }
  else {
    destination = session.createQueue(destinationName);
  }
  producer = session.createProducer(destination);

, JBoss prereq Java 1.5, Java 1.5 .

+2

, JNDI - JMS- ( ), .

0

JNDI - JMS-, . , factory

0

, JNDI, .

JBOSS. , . , , "" " " . classloading, , Classpath , JBOSS , .

0

Source: https://habr.com/ru/post/1714625/


All Articles