- Я недавно обновился с JBoss 7.4 до JBoss 8.0.
- Я в настоящее время тестирую это на Windows 11 и openjdk 17 , но поведение то же самое на Linux Distro
по какой -то причине, чтобы я не могу написать, чтобы я не могу написать, чтобы я не могу написать, чтобы я не могу написать, и я не могу написать, и я не могу написать, и я не могу написать. очередь.Код: Выделить всё
09:49:55,595 ERROR [stderr] (default task-1) javax.naming.NamingException: Failed to lookup [Root exception is java.lang.ClassNotFoundException: org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl from [Module "deployment.TESTQUEUE.war" from Service Module Loader]] 09:49:55,596 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.util.NamingUtils.namingException(NamingUtils.java:171) 09:49:55,597 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.remote.RemoteClientTransport.lookup(RemoteClientTransport.java:291) 09:49:55,597 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.remote.RemoteContext.lambda$lookupNative$0(RemoteContext.java:190) 09:49:55,597 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.NamingProvider.performExceptionAction(NamingProvider.java:222) 09:49:55,597 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.remote.RemoteContext.performWithRetry(RemoteContext.java:100) 09:49:55,597 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.remote.RemoteContext.lookupNative(RemoteContext.java:188) 09:49:55,599 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:74) 09:49:55,599 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.store.RelativeFederatingContext.lookupNative(RelativeFederatingContext.java:58) 09:49:55,601 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:74) 09:49:55,602 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:60) 09:49:55,603 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:66) 09:49:55,603 ERROR [stderr] (default task-1) at org.wildfly.naming-client@2.0.1.Final-redhat-00001//org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:144) 09:49:55,603 ERROR [stderr] (default task-1) at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409) 09:49:55,604 ERROR [stderr] (default task-1) at java.naming/javax.naming.InitialContext.lookup(InitialContext.java:409) 09:49:55,604 ERROR [stderr] (default task-1) at deployment.TESTQUEUE.war//QueueWriter.writeToRequestQueue(QueueWriter.java:49) 09:49:55,605 ERROR [stderr] (default task-1) at deployment.TESTQUEUE.war//NewServlet.processRequest(NewServlet.java:48) 09:49:55,605 ERROR [stderr] (default task-1) at deployment.TESTQUEUE.war//NewServlet.doPost(NewServlet.java:79) 09:49:55,606 ERROR [stderr] (default task-1) at jakarta.servlet.api@6.0.0.redhat-00001//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547) < /code> [*] Это не удается именно в этой строке, пытаясь найти завод по соединению: connectionFactory = (ConnectionFactory) namingContext.lookup("jms/RemoteConnectionFactory"); - Ниже приведен код, который я пишу в очереди с:
Код: Выделить всё
import javax.jms.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.HashMap;
import java.util.Properties;
import java.util.logging.Logger;
public class QueueWriter {
Context namingContext = null;
private ConnectionFactory connectionFactory;
private Queue queue;
private Connection connection;
private Session session;
private MessageProducer messageProducer;
public QueueWriter() {
}
public boolean writeToRequestQueue(String queueName, HashMap dataMap) {
boolean writeToQueue = false;
String messageID = "1223334343535456";
// messageID = (String) dataMap.get("CorrelationID");
try {
final Properties P = new Properties();
P.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
P.put(Context.PROVIDER_URL, "remote+http://127.0.0.1:8080");
P.put(Context.SECURITY_PRINCIPAL, "queue");
P.put(Context.SECURITY_CREDENTIALS, "Pass@123");
namingContext = new InitialContext(P);
connectionFactory = (ConnectionFactory) namingContext.lookup("jms/RemoteConnectionFactory");
System.out.println("Attempting to acquire connection factory"+ connectionFactory);
this.queue = (Queue) namingContext.lookup("jms/queue/ESBChannelRequest_Queue");
//this.queue = (Queue) namingContext.lookup(queueName);
connection = connectionFactory.createConnection("queue", "Pass@123"); // specify username and password
connection.start();
System.out.println("Attempting to acquire connection status>>>>>>"+ connection.getClientID());
this.session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
this.messageProducer = session.createProducer((Destination) this.queue);
TextMessage textMessage = session.createTextMessage();
textMessage.setText("TEST MESSAGE"); // Set the request data in the message
textMessage.setJMSCorrelationID(messageID); // Set the correlation ID
this.messageProducer.send(textMessage);
writeToQueue = true;
releaseConnections();
} catch (JMSException ex) {
ex.printStackTrace();
} catch (NamingException ex) {
ex.printStackTrace();
} finally {
}
return writeToQueue;
}
public void releaseConnections() {
try {
if (this.messageProducer != null) {
this.messageProducer.close();
}
if (this.session != null) {
this.session.close();
}
if (this.connection != null) {
this.connection.close();
}
this.closeReleaseOtherResources();
} catch (Exception var3) {
var3.printStackTrace();
}
}
private void closeReleaseOtherResources() {
try {
if (this.queue != null) {
this.queue = null;
}
if (this.connectionFactory != null) {
this.connectionFactory = null;
}
if (this.connectionFactory != null) {
this.connectionFactory = null;
}
if (this.namingContext != null) {
this.namingContext = null;
}
} catch (Exception var3) {
var3.printStackTrace();
}
}
}
< /code>
[*] Моя подсистема обмена сообщениями на автономной offull.xml < /code>: < /li>
< /ul>
Я также пробовал несколько свежих установок и переосмысления jboss 8.0. /> < /li>
< /ul>
Подробнее здесь: https://stackoverflow.com/questions/795 ... up-on-jbos