apache / apache/grails-core

New Feature: Implement @Resource and generate-resource-controller for RxGORM

Open
#10,136 1 comment 0 reactions 0 assignees View on GitHub
status: acknowledged type: enhancement
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

Trying to create test `rx-mongodb` and create new `domain-resource` on **Grails 3.2.0 RC1**
not able to run basic scenario as described below:
### Task List
- [x] Stacktrace (if present) provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Steps to reproduce provided
- [x] Full description of the issue provided (see below)
### Steps to Reproduce
1. Create New Project
`grails create-app myapp --profile=angular -features=rx-mongodb,json-views,asset-pipeline`
2. Create Domain Resource
`create-domain-resource myapp.Todo`
3. `run-app`
### Expected Behaviour

I should be able to access Todo list when I access `http://localhost:8080/todo`
### Actual Behaviour

Error

```
ERROR org.grails.web.errors.GrailsExceptionResolver - IllegalStateException occurred when processing request: [GET] /todo
No transactionManager was specified. Using @Transactional or @Rollback requires a valid configured transaction manager. If you are running in a unit test ensure the test has been properly configured and that you run the test suite not an individual test method.. Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
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.IllegalStateException: No transactionManager was specified. Using @Transactional or @Rollback requires a valid configured transaction manager. If you are running in a unit test ensure the test has been properly configured and that you run the test suite not an individual test method.
at grails.transaction.GrailsTransactionTemplate.(GrailsTransactionTemplate.groovy:60)
... 3 common frames omitted
```
### Environment Information
- **Operating System**: MacOS
- **Grails Version:** 3.2.0 RC1
- **JDK Version:** 1.8
- **Container Version (If Applicable):** N/A
### Example Application

``` groovy
package myapp

import grails.gorm.rx.mongodb.*
import org.bson.types.ObjectId

import grails.rest.*

@Resource(uri="/todo", readOnly=false, formats = ["json", "xml"] )
class Todo implements RxMongoEntity {
ObjectId id
String description
boolean done
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the example application with Grails 3.2.0 RC1, the rx-mongodb feature, and `create-domain-resource myapp.Todo`. Check the generated Todo resource at `/todo` and the reported transaction-manager exception; done means the endpoint serves the Todo list without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, mongodb
Domain
api, backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.