Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Data makes spring unable to find JAXRS's @Provider [DATAJPA-172] #589

Closed
spring-projects-issues opened this issue Feb 14, 2012 · 2 comments
Assignees
Labels
in: core type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 14, 2012

smallufo opened DATAJPA-172 and commented

I am using Spring + Jersey to build an API service .
Recently , I try to incorporate Spring Data to my server .
I haven't truly use any Repositories in my running code , just add one line in my app.xml :

<jpa:repositories base-package="destiny.web" entity-manager-factory-ref="entityManagerFactoryApp" />

But ! I notice my API not working , complaining "A message body writer for Java class xxx , and Java type class xxx , and MIME media type application/json was not found"

If I remove the "jpa:repositories ..." line in my xml , everything works fine !
and , all provider classes are registered by spring :

{http://*:8080-1} Registering Spring bean, apiResultJsonWriter, of type destiny.web.api.ApiResultJsonWriter as a provider class
{http://*:8080-1} Registering Spring bean, webApi, of type destiny.web.api.WebApi as a root resource class
{http://*:8080-1} Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM'

But , if I add "jpa:repositories..." line in my XML , only "root resources class" are registered :

{http://*:8080-1} CDI support is enabled
{http://*:8080-1} Using default applicationContext
{http://*:8080-1} Registering Spring bean, webApi, of type destiny.web.api.WebApi as a root resource class
{http://*:8080-1} Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM'

I don't know if it is Spring-Data's bug ?
And how to solve it ?

environment :

spring-3.1
jersey-core-1.8.jar
jersey-server-1.8.jar
jersey-spring-1.8.jar

spring-data-jpa-1.0.3.RELEASE.jar
spring-data-commons-core-1.1.0.RELEASE.jar

server : resin-4.0.25

Related dependencies :

<dependency>
  <groupId>com.sun.jersey</groupId>
  <artifactId>jersey-server</artifactId>
  <version>1.8</version>
</dependency>
<dependency>
  <groupId>com.sun.jersey.contribs</groupId>
  <artifactId>jersey-spring</artifactId>
  <version>1.8</version>
  <exclusions> 
    <exclusion>
      <groupId>org.springframework</groupId> 
      <artifactId>spring-beans</artifactId> 
    </exclusion> 
  </exclusions>
</dependency>
<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-jpa</artifactId>
  <version>1.0.3.RELEASE</version>
</dependency>

Affects: 1.0.3

Reference URL: http://forum.springsource.org/showthread.php?123119-Spring-Data-makes-spring-unable-to-find-JAXRS-s-Provider&p=401568

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Apr 20, 2012

Oliver Drotbohm commented

Is anyone able to reproduce this? I have a hard time trying to come up with a idea for a reason why these two mechanisms should interfere

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 27, 2012

Oliver Drotbohm commented

Closing due to inactivity. Feel free to re-open if there are new aspects to be discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: bug
Projects
None yet
Development

No branches or pull requests

2 participants