apache / apache/grails-core

Production War lose its environment setting

Open
#11,658 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

- [x] Steps to reproduce provided
- [x] Stacktrace (if present) provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)

### Steps to Reproduce

1. Create a simple Grails4 application with hibernate dependencies (I created mine with IntelliJ "application forge" utility)
2. Set "org.springframework.boot:spring-boot-starter-tomcat" scope to "provided"
3. Enable war creation in "build.gradle"
4. Create war package
5. Deploy it to JBoss/Wildfly

### Expected Behaviour

The application runs in "production environment"

### Actual Behaviour

The application can't recognize the environment ("initializing:false", you can see it in logs)

2020-12-11 09:36:37,490 INFO DefaultEnvironment - Established active environments: [[initializing:false]]
2020-12-11 09:36:37,803 INFO GrailsApp - Started Micronaut Parent Application Context in 391ms
2020-12-11 09:36:37,834 INFO ApplicationLoader - The following profiles are active: [initializing:false]

### Environment Information

- **Operating System**: Windows 10 / Windows Server 2012 R2
- **Grails Version:** 4.0.5
- **JDK Version:** 1.8 64bit
- **Container Version (If Applicable):** Wildfly 17
### Example Application

- https://github.com/leleFc/TestWar

[Stacktrace.txt](https://github.com/grails/grails-core/files/5678077/Stacktrace.txt)

Contributor guide

Open the contributing guide

Research direction

Start with the linked TestWar example and its build.gradle, then review Stacktrace.txt and compare the WAR deployment steps on WildFly 17. Trace how the production environment is established when Tomcat is provided and WAR creation is enabled. Done means the deployed application recognizes and runs in the production environment rather than reporting "initializing:false".

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.