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

Problem running with grails 3.3.0 #18

Open
leon-barboza-pya opened this issue Oct 13, 2017 · 11 comments
Open

Problem running with grails 3.3.0 #18

leon-barboza-pya opened this issue Oct 13, 2017 · 11 comments
Labels

Comments

@leon-barboza-pya
Copy link

Hi!

I'm trying to run this with a grails 3.3.0 project and getting this error at startup


org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NoSuchMethodError: grails.web.mapping.UrlMapping.getConstraints()[Lgrails/validation/ConstrainedProperty;
(...)
Caused by: java.lang.NoSuchMethodError: grails.web.mapping.UrlMapping.getConstraints()[Lgrails/validation/ConstrainedProperty;
	at springfox.documentation.grails.UrlMappings.hasControllerConstraint(UrlMappings.java:123)

gradle.properties:

grailsVersion=3.3.0
gormVersion=6.1.6.RELEASE

@laxmanc
Copy link

laxmanc commented Oct 16, 2017

If I downgrade the grails version to 3.2.9 it works. However from 3.3.0 grails the method signature of grails.web.mapping.UrlMapping.getConstraints() is changed, which broke this plugin.

@dilipkrish
Copy link
Member

Oh thanks for reporting @leon-barboza-pya. Do you have ideas around how we could make it work for both 3.2.x and 3.3.0?

@dilipkrish dilipkrish added the bug label Oct 26, 2017
@ibmsoft
Copy link

ibmsoft commented Nov 1, 2017

it seem that from http://docs.grails.org/3.3.0/guide/upgrading.html
In previous versions of Grails it was possible to access GrailsDomainClass instances and inspect the GrailsDomainClassProperty properties inside of the doWithSpring method in a plugin, for example.

If you have code that follows that example, an error will be thrown that looks like "The method …​ cannot be accessed before GORM has initialized". The solution is to move any logic that executes before the context is available to somewhere else that executes after the context is available.

@dilipkrish
Copy link
Member

@ibmsoft thanks for the detailed pointers. Will look at fixing it for the next release.

@rafseggir
Copy link

rafseggir commented Dec 11, 2017

Hi @dilipkrish,

Today, I had tried to use this plugin with grails 3.3.2 and I had this problem.

Have you find a solutions? Or are you developing a solution?

Thanks!

@dilipkrish
Copy link
Member

@rafseggir Im in the process of developing a solution. However, I may need help since Im not super familiar with grails 3.3.x.

The issue Im currently running into is that the MappingContext needs to be initialized in the GrailsApplication. Not sure how to do that. any pointers would be super helpful.

@dfarm3r
Copy link

dfarm3r commented Feb 23, 2018

@dilipkrish first, thank you for putting this together. I am now having this issue upgrading to 3.3.2 from 3.2.7. Any updates on when there will be a fix? I would help but I wouldn't know where to begin and I honestly don't have any spare time at the moment. I appreciate any help or guidance you can give. At the moment I had to comment out all the API documentation code for swagger. Kinda bummed but I needed to upgrade to a newer version of grails.

@batchu
Copy link

batchu commented Mar 19, 2018

@dilipkrish In your fix branch, MappingContext is utilized in a Spring Bean with a @component annotation. At this point of tie MappingContext is not available as Grails hasn't completed initializing GORM. Can you move the code that calls MappingContext to after Spring completes it's initialization?

@dilipkrish
Copy link
Member

@batchu if you have any ideas on how to do that I'd love some help with it. Not very familiar with grails/gorm internals

@dilipkrish dilipkrish removed the next label Mar 20, 2018
@hemantseth0210
Copy link

@dilipkrish do you have any solution or workaround for this? Please let us know if there are any update on solution

@gabivis
Copy link

gabivis commented Oct 9, 2019

I am also interested in a fix for this issue.

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

No branches or pull requests

9 participants