Can I use RESTEasy to deploy an endpoint to the GateIn/eXo portal context?

Solution Unverified - Updated -


  • JBoss Portal Platform (JPP)
    • 6.x


How to deploy a JAX-RS resource and integrate it with the portal container. I add this to my portal configuration to configure the integration:


This is to be deployed using RESTEasy, but I'm experiencing issues trying to do this. How can this be done using RESTEasy?

A couple errors we see in our log:

    at org.jboss.resteasy.util.PathHelper.replaceEnclosedCurlyBraces( 
    at org.jboss.resteasy.util.Encode.savePathParams( 
    at org.jboss.resteasy.util.Encode.encodeValue( 
    at org.jboss.resteasy.util.Encode.encodeFragment( 
    at org.jboss.resteasy.specimpl.UriBuilderImpl.fragment( 
java.lang.ClassCastException: cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory,

During Arquillian tests with JPP getting the following issue

java.lang.ClassCastException: cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory


RESTEasy cannot be used to deploy JAX-RS resources that are to be integrated into the portal kernel/container.

The best way to make this work is to follow the directions in this knowledgebase solution: How can I add a JAX-RS resource to the GateIn/eXo portal context in JPP 6.x?.

If you must package your JAX-RS resource in a .war, then you need to disable the JAX-RS subsystem from your deployment so RESTEasy does not automatically try to deploy your resource outside of the eXo container.

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <subsystem name="jaxrs"/>

Root Cause

  • Behind the scenes, eXo simply takes all JAX-RS resources found in the set of portal components and that implement and adds them to the set of resources returned in its own 1. Therefore you cannot use a separate JAX-RS implementation to deploy your resource than what eXo uses since eXo is actually deploying your resource in the same JAX-RS application as all the other portal resources.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.