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

Server error on sorting Data Types by Type #375

Closed
jamesrwelch opened this issue Oct 22, 2021 · 4 comments · Fixed by #377
Closed

Server error on sorting Data Types by Type #375

jamesrwelch opened this issue Oct 22, 2021 · 4 comments · Fixed by #377
Labels
bug Something isn't working
Milestone

Comments

@jamesrwelch
Copy link
Contributor

On the data model page, when viewing the data types. If you try and sort the data types by type, you get a server error.

As a side issue, the message displayed when there are no data types is slightly wrong - it should say "model" rather than "repository", and should point out that this may be because you've applied a filter.

@jamesrwelch jamesrwelch added the bug Something isn't working label Oct 22, 2021
@jamesrwelch
Copy link
Contributor Author

See Comments in #368

@olliefreeman
Copy link
Contributor

what is the server error???

@jamesrwelch
Copy link
Contributor Author

jamesrwelch commented Oct 22, 2021

{
  "headers": {
    "normalizedNames": {},
    "lazyUpdate": null
  },
  "status": 500,
  "statusText": "OK",
  "url": "http://localhost:8080/api/dataModels/be4d2d54-e964-4d84-b711-6fc82b136476/dataTypes?max=20&sort=type&order=asc",
  "ok": false,
  "name": "HttpErrorResponse",
  "message": "Http failure response for http://localhost:8080/api/dataModels/be4d2d54-e964-4d84-b711-6fc82b136476/dataTypes?max=20&sort=type&order=asc: 500 OK",
  "error": {
    "status": 500,
    "reason": "Internal Server Error",
    "errorCode": "UEX--",
    "message": "could not resolve property: type of: uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataType",
    "path": "/api/dataModels/be4d2d54-e964-4d84-b711-6fc82b136476/dataTypes",
    "devMode": true,
    "version": "4.11.0-SNAPSHOT",
    "exception": {
      "type": "QueryException",
      "message": "could not resolve property: type of: uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataType",
      "stacktrace": [
        "org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:73)",
        "org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:67)",
        "org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:2075)",
        "org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:46)",
        "org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:2017)",
        "org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:538)",
        "org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:497)",
        "org.hibernate.criterion.Order.toSqlString(Order.java:109)",
        "org.hibernate.loader.criteria.CriteriaQueryTranslator.getOrderBy(CriteriaQueryTranslator.java:442)",
        "org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:106)",
        "org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:75)",
        "org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:80)",
        "org.hibernate.internal.SessionImpl.list(SessionImpl.java:1861)",
        "org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:370)",
        "org.grails.orm.hibernate.query.AbstractHibernateQuery.listForCriteria(AbstractHibernateQuery.java:720)",
        "org.grails.orm.hibernate.query.AbstractHibernateQuery.list(AbstractHibernateQuery.java:710)",
        "grails.gorm.PagedResultList.<init>(PagedResultList.java:43)",
        "grails.gorm.DetachedCriteria$_list_closure2.doCall(DetachedCriteria.groovy:137)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "grails.gorm.DetachedCriteria$_withPopulatedQuery_closure8.doCall(DetachedCriteria.groovy:771)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "org.grails.datastore.gorm.GormStaticApi$_withDatastoreSession_closure24.doCall(GormStaticApi.groovy:862)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:319)",
        "org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:40)",
        "org.grails.datastore.gorm.GormStaticApi.withDatastoreSession(GormStaticApi.groovy:861)",
        "grails.gorm.DetachedCriteria.withPopulatedQuery(DetachedCriteria.groovy:742)",
        "grails.gorm.DetachedCriteria.list(DetachedCriteria.groovy:135)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataTypeService.$tt__findAllByDataModelIdIncludingImported(DataTypeService.groovy:312)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)",
        "org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)",
        "grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataTypeController.listAllReadableResources(DataTypeController.groovy:133)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "uk.ac.ox.softeng.maurodatamapper.core.controller.EditLoggingController.listAllResources(EditLoggingController.groovy:136)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataTypeController.index(DataTypeController.groovy:49)",
        "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:211)",
        "org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188)",
        "org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)",
        "org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)",
        "org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)",
        "org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)",
        "org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)",
        "org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)",
        "org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)",
        "org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)",
        "java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)",
        "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)",
        "java.lang.Thread.run(Thread.java:831)"
      ]
    }
  }
}

@olliefreeman
Copy link
Contributor

olliefreeman commented Oct 22, 2021

i suspect the url is using the query param type not domainType .. as there is no such property type on DataType and we dont check the sort properties we just apply them
could not resolve property: type of: uk.ac.ox.softeng.maurodatamapper.datamodel.item.datatype.DataType

@gammonpeter gammonpeter self-assigned this Oct 28, 2021
@gammonpeter gammonpeter linked a pull request Oct 28, 2021 that will close this issue
@jamesrwelch jamesrwelch added this to the 6.7.0 milestone Nov 1, 2021
jamesrwelch added a commit that referenced this issue Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants