首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Artemis rest接口

Artemis rest接口
EN

Stack Overflow用户
提问于 2019-12-13 09:35:41
回答 1查看 744关注 0票数 1

我对ActiveMQ的Artemis插件有问题。当我启动Artemis时,它会抛出一个错误,如下所示:

代码语言:javascript
复制
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
    at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:798) [artemis-core-client-2.10.0.jar:2.10.0]
    at org.apache.activemq.artemis.rest.MessageServiceManager.start(MessageServiceManager.java:151) [artemis-rest-2.10.0.jar:2.10.0]
    at org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener.contextInitialized(RestMessagingBootstrapListener.java:50) [artemis-rest-2.10.0.jar:2.10.0]

我在运行rest插件时所做的:

  1. Build artemis-rest.war

pom.xml配置:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-        
 4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.artemis</groupId>
<artifactId>artemis-rest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>artemis-rest</name>


<dependencies>
    <dependency>
        <groupId>org.apache.activemq.rest</groupId>
        <artifactId>artemis-rest</artifactId>
        <version>2.10.0</version>
    </dependency>
</dependencies>

</project>

  1. 编辑的broker.xml文件:

vm://0tcp://localhost:61616

  • 编辑的bootstrap.xml

  • 并将artemis-rest.war添加到apache-artemis-2.10.0\web目录.

有人知道为什么它不起作用吗?

EN

回答 1

Stack Overflow用户

发布于 2019-12-19 23:04:49

您没有在web.xml中列出您的输入。同时也丢失了其余的-messaging.xml文件?您安装了RESTEasy吗?下面是要在WEB中运行的web.xml

代码语言:javascript
复制
<web-app>
    <listener>
        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
    </listener>

    <listener>
        <listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class>
    </listener>

    <filter>
        <filter-name>Rest-Messaging</filter-name>
        <filter-class>org.jboss.resteasy.plugins.server.servlet.FilterDispatcher</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>Rest-Messaging</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <context-param>
        <param-name>rest.messaging.config.file</param-name>
        <param-value>file:///WEB-INF/rest-messaging.xml</param-value>
   </context-param>
</web-app>

下面是剩余的消息传递-xml文件:

代码语言:javascript
复制
<rest-messaging>
    <server-in-vm-id>0</server-in-vm-id> <!-- deprecated, use "url" -->
    <use-link-headers>false</use-link-headers>
    <default-durable-send>false</default-durable-send>
    <dups-ok>true</dups-ok>
    <topic-push-store-dir>topic-push-store</topic-push-store-dir>
    <queue-push-store-dir>queue-push-store</queue-push-store-dir>
    <producer-time-to-live>0</producer-time-to-live>
    <producer-session-pool-size>10</producer-session-pool-size>
    <session-timeout-task-interval>1</session-timeout-task-interval>
    <consumer-session-timeout-seconds>300</consumer-session-timeout-seconds>
    <consumer-window-size>-1</consumer-window-size> <!-- deprecated, use "url" -->
    <url>vm://0</url>
</rest-messaging>

不过还没开始工作呢。我对RESTEasy有个问题。我不知道在Artemis 2.10.1中使用什么版本。获取以下内容: java.lang.RuntimeException: java.lang.RuntimeException:您必须将RESTEasy安装为一个引导程序,并且必须在该类之前列出它

可能很快就会寻求帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59319707

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档