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'm running a JSF 2.0 application on Tomcat 7. I want to use javascript
I have a small JSF application where the user is required to enter some
i have a jsf application running on tomcat 6.0 and somewhere in the app
I have developed a JSF application and I am running into some funny behavior
In my web jsf application, I display different messages to the user using this
i was running my JSF 2 application from external tomcat 6 from eclipse and
I have a CDI / Weld application running with Hibernate and JSF 2 inside
i got error when i'm running my application im using : jsf 2.0 springframework
I have an jsf application (mojarra 2.1.8, primefaces 3.3) running on tomcat 6. While
I am developing a JSF application with JPA(EclipseLink 2.0) and Primefaces. I want to

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.