[ARTEMIS] REST Interface in Wildfly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ARTEMIS] REST Interface in Wildfly

Vinche59
This post was updated on .
Hello,

I experience some troubles to add Artemis REST Interface into Wildfly 11 Beta1.
I followed the documentation here (https://activemq.apache.org/artemis/docs/1.5.5/rest.html) Section « Installing Within Pre-configured Environment » for web.xml file.

But the WAR deployment failed with this error :

WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "artemis-rest.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./artemis-rest" => "java.lang.RuntimeException: java.lang.RuntimeException: You must install RESTEasy as a Bootstrap Listener and it must be listed before this class

Can someone help me to pinpoint what I'm missing ?

Here is the pom.xml I use :

<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>my.group</groupId>
        <artifactId>artemis-rest</artifactId>
        <version>1.0.0</version>
        <packaging>war</packaging>

        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.source>1.8</maven.compiler.source>
        </properties>

        <dependencies>
                <dependency>
                        <groupId>org.apache.activemq.rest</groupId>
                        <artifactId>artemis-rest</artifactId>
                        <version>1.5.5.jbossorg-006</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>*</groupId>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
        </dependencies>

        <build>
                <finalName>${project.artifactId}</finalName>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <version3.1.0</version>
                                <configuration>
                                        <archive>
                                                <manifestEntries>
                                                        <Dependencies>org.apache.activemq.artemis export</Dependencies>
                                                </manifestEntries>
                                        </archive>
                                </configuration>
                        </plugin>
                </plugins>
        </build>
</project>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ARTEMIS] REST Interface in Wildfly - Resolved

Vinche59
After some digging it seems that the RestEasy version shipped with Wildfly 11 do not register anymore org.jboss.resteasy.spi.Registry into ServletContext attributes in RestEasyBootstrap class

I had to manually registered it to make it works.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [ARTEMIS] REST Interface in Wildfly - Resolved

Justin Bertram
Can you elaborate on what exactly you changed?  Anybody else who runs into
this issue will care about the specifics of your solution.


Justin

On Wed, Aug 9, 2017 at 1:07 PM, Vinche59 <[hidden email]>
wrote:

> After some digging it seems that the RestEasy version shipped with Wildfly
> 11
> do not register anymore org.jboss.resteasy.spi.Registry into
> ServletContext
> attributes in RestEasyBootstrap class
>
> I had to manually registered it to make it works.
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ARTEMIS-REST-Interface-in-Wildfly-tp4729520p4729544.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [ARTEMIS] REST Interface in Wildfly - Resolved

Vinche59
This post was updated on .
I just subclassing « org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap » and register « org. jboss.resteasy.spi.Registry » into ServletContext :

package org.example;

import javax.servlet.ServletContextEvent;
import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap;
import org.jboss.resteasy.spi.Registry;

public class MyResteasyBootstrap extends ResteasyBootstrap {
    @Override
    public void contextInitialized(ServletContextEvent event)
    {
        super.contextInitialized(event);
        event.getServletContext().setAttribute(Registry.class.getName(), deployment.getRegistry());
    }
}

Then I use this new class instead of ResteasyBootstrap in web.xml :

<web-app version="3.1" xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <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>

                <listener>
                <listener-class>
                org.example.MyResteasyBootstrap
                </listener-class>
                </listener>

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

</web-app>

De : Justin Bertram [via ActiveMQ] [mailto:ml+s2283324n4729576h21@n4.nabble.com]
Envoyé : jeudi 10 août 2017 01:18
À : Vincent Sourin <sourin-v@bridgestone-bae.com>
Objet : Re: [ARTEMIS] REST Interface in Wildfly - Resolved

Can you elaborate on what exactly you changed?  Anybody else who runs into
this issue will care about the specifics of your solution.


Justin

On Wed, Aug 9, 2017 at 1:07 PM, Vinche59 <[hidden email]</user/SendEmail.jtp?type=node&node=4729576&i=0>>
wrote:

> After some digging it seems that the RestEasy version shipped with Wildfly
> 11
> do not register anymore org.jboss.resteasy.spi.Registry into
> ServletContext
> attributes in RestEasyBootstrap class
>
> I had to manually registered it to make it works.
>
>
>
>
>
>
Loading...