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

NullPointerException from RepositoryRestConfiguration if you inject mvcValidator into RepositoryRestConfigurer [DATAREST-866] #1236

Closed
spring-projects-issues opened this issue Aug 4, 2016 · 8 comments
Assignees
Labels
type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Aug 4, 2016

Petar Tahchiev opened DATAREST-866 and commented

Hopper release throws a null-pointer exception when you inject "mvcValidator" in your RepositoryRestConfigurer


Affects: 2.5.2 (Hopper SR2)

Attachments:

Backported to: 2.5.3 (Hopper SR3)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 4, 2016

Petar Tahchiev commented

Here's a demo project:

https://github.com/ptahchiev/DATAREST-866

Just switch version in pom.xml - it works with 1.3.7.RELEASE and fails with 1.4.0.RELEASE

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 8, 2016

Oliver Drotbohm commented

The issue stemmed from a non-static bean factory method to declare a BeanPostProcessor. That should be fixed now in master and the bug fix branch for Hopper

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 10, 2016

Petar Tahchiev commented

I tried testing the demo project with <spring-data-releasetrain.version>Ingalls-BUILD-SNAPSHOT</spring-data-releasetrain.version> and I still see the same error. I don't think this has been fixed :( . I will reopen it.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 10, 2016

Petar Tahchiev commented

As per previous comment, I'm reopening this issue

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 10, 2016

Oliver Drotbohm commented

Would you mind tweaking the project you linked to showing that it's failing on current snapshots? I can successfully bootstrap your project on both Spring 1.3.7 and 1.4.0 with both Hopper and Ingalls snapshots

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 11, 2016

Petar Tahchiev commented

I have already. If you look inside the demo project you will see this:

   <version>1.4.0.RELEASE</version>
    <!--version>1.3.7.RELEASE</version-->
</parent>
<properties>
   <spring-data-releasetrain.version>Ingalls-BUILD-SNAPSHOT</spring-data-releasetrain.version>
</properties>

I have cloned spring-data-rest and I made sure the RepositoryRestMvcConfiguration has the static modified. I rebuild the spring-data-rest and then I try to start my demo project with mvn spring-boot:run but then I get this exception:

Caused by: java.lang.NullPointerException
	at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:706)
	at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.basicObjectMapper(RepositoryRestMvcConfiguration.java:802)
	at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.objectMapper(RepositoryRestMvcConfiguration.java:440)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 11, 2016

Oliver Drotbohm commented

Well, to verify wether our fix works, you need to ouse our artifacts, not some locally hacked version of SD REST ;). Please wipe your SD REST snapshots from your local Maven repository to make sure you use our latest builds. If you can still se it fail, please tweak the example you have linked to up there to exactly the version combination that you see the the failure in

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Aug 11, 2016

Petar Tahchiev commented

Hi Oliver,

please find output.log which is a complete output from my command line. To spare the details here's what I do:

> git clone git@github.com:spring-projects/spring-data-rest.git spring-data-rest-orig
> cd spring-data-rest-orig/
> mvn clean install
> cd ..
> cd DATAREST-866/
> mvn spring-boot:run

And then the exception happens. Please let me know what wrong I am doing :(

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

No branches or pull requests

2 participants