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 8086473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:27:33+00:00 2026-06-05T18:27:33+00:00

I want to create a rest api using reasteasy and jax-rs in spring. to

  • 0

I want to create a rest api using reasteasy and jax-rs in spring. to do that the following lines are part of my application context:

<bean id="RESTeasyProviderFactory" class="org.springframework.web.context.support.ServletContextAttributeFactoryBean">
    <property name="attributeName" value="org.jboss.resteasy.spi.ResteasyProviderFactory" />
</bean>

<bean id="RESTeasyRegistry" class="org.springframework.web.context.support.ServletContextAttributeFactoryBean">
    <property name="attributeName" value="org.jboss.resteasy.spi.Registry" />
</bean>

<bean id="RESTeasyBeanPostProcessor" class="org.jboss.resteasy.plugins.spring.SpringBeanProcessor">
    <constructor-arg>
        <bean class="org.jboss.resteasy.core.AsynchronousDispatcher">
            <constructor-arg ref="RESTeasyProviderFactory" />
        </bean>
    </constructor-arg>
    <constructor-arg ref="RESTeasyRegistry" />
    <constructor-arg ref="RESTeasyProviderFactory" />
</bean>

during the component scan this caused a npe during the component scan when my first rest interface bean is found:

Caused by: java.lang.NullPointerException
       at org.jboss.resteasy.plugins.spring.SpringBeanProcessor$ResteasyBeanPostProcessor.getInjector(SpringBeanProcessor.java:133)
       at org.jboss.resteasy.plugins.spring.SpringBeanProcessor$ResteasyBeanPostProcessor.postProcessAfterInitialization(SpringBeanProcessor.java:125)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
       ... 11 more

the debugger shows that the resteasyregistry bean and the resteasyproviderfactory bean are both resolved as null.

can anybody explain how this can happen?
as a test i changed the xml so the registry and the factory are set as properties but even there when the setter is called the registry and factory are null.

*EDIT2: spring debug log *

here the relevant part from the spring debug log.

2012-06-01 12:13:34,337 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'RESTeasyBeanPostProcessor'
2012-06-01 12:13:34,337 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'RESTeasyBeanPostProcessor'
2012-06-01 12:13:34,337 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'org.jboss.resteasy.core.AsynchronousDispatcher#e0380'
2012-06-01 12:13:34,340 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'RESTeasyProviderFactory'
2012-06-01 12:13:34,340 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'RESTeasyProviderFactory'
2012-06-01 12:13:34,340 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'RESTeasyProviderFactory' to allow for resolving potential circular references
2012-06-01 12:13:34,350 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'RESTeasyProviderFactory'
2012-06-01 12:13:34,386 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'org.jboss.resteasy.core.AsynchronousDispatcher#e0380'
2012-06-01 12:13:34,386 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'RESTeasyRegistry'
2012-06-01 12:13:34,386 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'RESTeasyRegistry'
2012-06-01 12:13:34,386 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'RESTeasyRegistry' to allow for resolving potential circular references
2012-06-01 12:13:34,386 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'RESTeasyRegistry'
2012-06-01 12:13:34,389 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'RESTeasyProviderFactory'
2012-06-01 12:13:34,393 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'RESTeasyBeanPostProcessor' to allow for resolving potential circular references
2012-06-01 12:13:34,393 DEBUG [main] o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'RESTeasyBeanPostProcessor'
  • 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-06-05T18:27:35+00:00Added an answer on June 5, 2026 at 6:27 pm

    I fixed this by writing my own singleton factories for the two beans. its annoying and should not be necessary, but it worked.

    in the end we changed this part of the config totally so even this ugly solution became unnecessary.

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

Sidebar

Related Questions

I simply want to create a fairly basic REST service, so that I can
I want to create a global option that when a REST call contains &format=json
I'm trying to create a python script that logs into JIRA using their REST
I want to create a flexible API Rest server. I will allow the clients
I am using mvc webapi to create a REST API and struggling to find
I am a newbie w.r.t. jetty and RESTful API's. I want to create REST
I want to develop rest api.such as: http://localhost:8080/TestSomeWay/resources/test/create?meg=sadasd&name=sadasd and get params from urlparams exp.meg&name
I want to create a function using cURL and the bit.ly API to shorten
I am developing a REST API layer for my application using Zend_Rest_Controller. I have
I want to develop my own REST service, so I've created an IHttpHandler that

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.