Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6041887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:43:35+00:00 2026-05-23T06:43:35+00:00

In a JSF 2.0 application (running on Tomcat 7 and using weld 1.1.1.Final), I

  • 0

In a JSF 2.0 application (running on Tomcat 7 and using weld 1.1.1.Final), I want to propose my user to download some binary files (.doc, .pdf etc).

In order to fulfil that need, I want to use a JAX-RS (RESTEasy 2.2.0.Final) resource bean (annotated with @Path). The problem is that inside that bean, I want to call a service from a field annotated with @Inject annotation.

Actually, like a weld user trying a similar thing I’ve got a NullPointerException : Weld doesn’t inject me my service.

So I read a post on JBoss community wiki talking about how to integrate RESTEasy with CDI so I’ve made my maven war project depend on org.jboss.resteasy:resteasy-cdi and here is my web.xml :

<!-- Weld -->
<resource-env-ref>
    <description>Object factory for the CDI Bean Manager</description>
    <resource-env-ref-name>BeanManager</resource-env-ref-name>
    <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
</resource-env-ref>
<listener>
    <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<filter>
    <filter-name>ConversationPropagationFilter</filter-name>
    <filter-class>org.jboss.weld.servlet.ConversationPropagationFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>ConversationPropagationFilter</filter-name>
    <url-pattern>*</url-pattern>
</filter-mapping>

<!-- Resteasy -->
<listener>
    <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<servlet>
    <servlet-name>Resteasy</servlet-name>
    <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<context-param>
    <param-name>resteasy.injector.factory</param-name>
    <param-value>org.jboss.resteasy.cdi.CdiInjectorFactory</param-value>
</context-param>
<context-param>
    <param-name>resteasy.scan</param-name>
    <param-value>true</param-value>
</context-param>
<servlet-mapping>
    <servlet-name>Resteasy</servlet-name>
    <url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<context-param>
    <param-name>resteasy.servlet.mapping.prefix</param-name>
    <param-value>/rest</param-value>
</context-param>

The problem now is that when my application bootstraps, I’ve got that exception :

java.lang.RuntimeException: Unable to instantiate InjectorFactory implementation.
    at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:141)
    at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
...
Caused by: java.lang.NullPointerException
    at org.jboss.resteasy.cdi.CdiInjectorFactory.lookupBeanManager(CdiInjectorFactory.java:116)
    at org.jboss.resteasy.cdi.CdiInjectorFactory.<init>(CdiInjectorFactory.java:41)
...
    at java.lang.Class.newInstance(Class.java:308)
    at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:133)

And when I remove the resteasy.injector.factory context-param, I’ve got an NPE when trying to get my service from the field variable annotated with @Inject …

Does anybody knows how to configure RESTEasy beans to be managed by Weld (and make possible injection in JAX-RS resources) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:43:36+00:00Added an answer on May 23, 2026 at 6:43 am

    This has been fixed in RESTEasy trunk. See https://issues.jboss.org/browse/RESTEASY-558 for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a JSF application and I am running into some funny behavior
I`m developing an application using Spring WebFlow 2, Facelets and JSF. One of my
I'm using JSF/Facelets, and I'm trying to iterate over some Document objects (custom object)
I am using JSF framework in my application. I need to run a specific
In a JSF dataTable I want to display the row index next to the
I have a simple JSF application, a search form and results table, and a
I am running JSF 2.0 I currently have one java controller that is called
It is an application that has been built using seam 2.2 and it is
JSF is setting the ID of an input field to search_form:expression . I need
Is JSF being used in the enterprise, or at least growing in use?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.