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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:28:38+00:00 2026-06-17T22:28:38+00:00

I am trying to integrate Resteasy and Spring; I have followed both the docs

  • 0

I am trying to integrate Resteasy and Spring; I have followed both the docs for Resteasy and this post: Inject Spring beans into RestEasy .
I have it working using @Autowire or other Spring annotations on the rest class, but I would like to do this keeping my rest classes free from spring (or DI) dependencies.
I also would like to configure spring only through java configuration. In spring configuration I added this:

<context:component-scan base-package="package.where.spring.configuration.beans.are , package.where.rest.classes.are">
<context:include-filter type="annotation" expression="javax.ws.rs.Path"/>
</context:component-scan>

and of course I have in web.xml, so that spring config is picked up by SpringContextLoaderListener:

<context-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>classpath:/spring-config.xml</param-value>
</context-param>

Removing the @Autowire annotations, if I also remove the first package (where I configured the injections through Spring java config) no injection takes place and the fields remain null; if I remove the second package the urls for the rest classes are not recognized by resteasy.

I would like to configure the injections just in Spring configuration, is there a way to have resteasy recognize the paths from spring beans which are configured externally?

EDIT: I noticed that what I am trying to do works with @Provider annotated classes, given that you configure Spring correctly:

 <context:component-scan base-package="my.package1 , my.package2">
    <context:include-filter type="annotation" expression="javax.ws.rs.ext.Provider"/>
 </context:component-scan>

But the mistery is deeper than I first thought… I am more confident that I am on the right track and just missed a step!

  • 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-17T22:28:39+00:00Added an answer on June 17, 2026 at 10:28 pm

    Using JSR-250’s @Resource instead of @Autowired is a big step forward; it does what is needed from @Autowired and it is JSR and not Spring specific.

    Could be good enough for many uses.

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

Sidebar

Related Questions

trying to integrate hibernate and spring ,I ran into this error SEVERE: Context initialization
I'm trying to integrate Facebook sharing into a webpage using this code edited from
I'm trying to integrate passport into my nodejs server using connect, but can't seem
Trying to integrate Spring 2.5.5 with Xfire 1.2.6, I'm attempting to inject one of
I am trying to integrate some OpenCV functionality into my application. Currently I have
I am trying to integrate twitter into an iOS app using Ben Gottlieb's Twitter-OAuth-iPhone
Im trying to integrate my PHPUnit tests into Hudson using the xUnit plugin. After
I am trying to integrate SWFUpload into Joomla (customized implementation, and this is why
I am trying to integrate yelp into a website I'm working on. I'm really
I am trying to integrate NCover 2 into TeamCity 5.0.1, and since I have

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.