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

Test-App doesn't work #10

Closed
rdmueller opened this issue Mar 12, 2017 · 6 comments
Closed

Test-App doesn't work #10

rdmueller opened this issue Mar 12, 2017 · 6 comments
Assignees
Labels

Comments

@rdmueller
Copy link
Contributor

The swagger files and swagger-ui now look great and I love that I can switch between XML and JSON.

But as soon as I try to use the test-app (with gradle 3.0 or grails 3.2.6), I only get exceptions.

Example:
https://localhost:8080/artist/index
should return a list of all known artists or an empty list []
Instead it returns a 500 with a stacktrace on the console which look like this:

ERROR org.grails.web.errors.GrailsExceptionResolver - IllegalArgumentException occurred when processing request: [GET] /artist/index
id to load is required for loading. Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
        at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:210)
        at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)
        at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
        at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
        at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: id to load is required for loading
        at org.hibernate.event.spi.LoadEvent.<init>(LoadEvent.java:93)
        at org.hibernate.event.spi.LoadEvent.<init>(LoadEvent.java:63)
        at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2759)
        at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2741)
        at org.hibernate.internal.SessionImpl.get(SessionImpl.java:978)
        at org.grails.orm.hibernate.GrailsHibernateTemplate$2.doInHibernate(GrailsHibernateTemplate.java:306)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:243)
        at org.grails.orm.hibernate.GrailsHibernateTemplate.get(GrailsHibernateTemplate.java:303)
        at org.grails.orm.hibernate.AbstractHibernateGormStaticApi.get(AbstractHibernateGormStaticApi.groovy:89)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper.get(GormEntity.groovy:518)
        at grails.rest.RestfulController.queryForResource(RestfulController.groovy:235)
        at grails.rest.RestfulController.$tt__show(RestfulController.groovy:73)
        at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
        ... 14 common frames omitted

unfortunately, I am not familiar (yet) with this kind of controller shortcut which is used in the example... so I can't easily find the problem. How has the test app been created?

@dilipkrish
Copy link
Member

let me take a look... I suspect it was created through the grails command line

@dilipkrish dilipkrish added the bug label Mar 12, 2017
@dilipkrish
Copy link
Member

Seems like a case of operation success but patient is out :) Trying to reproduce it on a new project

@rdmueller
Copy link
Contributor Author

that's what I currently try too!

@rdmueller
Copy link
Contributor Author

I get the feeling that this could be a problem (bug?) with grails rest scaffolding...

@dilipkrish
Copy link
Member

I think I figured it out.. its rendering the wrong paths

@dilipkrish
Copy link
Member

For e.g.

create is POST /book {...} and not POST /book/create {..}

@ghost ghost assigned dilipkrish Mar 14, 2017
@ghost ghost removed the in progress label Mar 14, 2017
dilipkrish added a commit that referenced this issue Mar 15, 2017
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

2 participants