Skip to content

Commit 154b80a

Browse files
committed
Fix Spring native metadata after the add of Spel in @value
After the add of Spel in @value, this error is thrown when starting the service in native: ```Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method getProperty(java.lang.String) cannot be found on type org.springframework.boot.web.servlet.context.ApplicationServletEnvironment at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethod(MethodReference.java:225) ~[na:na] at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:135) ~[na:na] at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:380) ~[na:na] at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:96) ~[na:na] at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:119) ~[org.gridsuite.directory.server.DirectoryApplication:6.0.11] at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:309) ~[na:na] at org.springframework.expression.common.CompositeStringExpression.getValue(CompositeStringExpression.java:108) ~[na:na] at org.springframework.expression.common.CompositeStringExpression.getValue(CompositeStringExpression.java:121) ~[na:na] at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity.resolve(SimpleElasticsearchPersistentEntity.java:353) ~[org.gridsuite.directory.server.DirectoryApplication:5.1.2] at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity.resolve(SimpleElasticsearchPersistentEntity.java:335) ~[org.gridsuite.directory.server.DirectoryApplication:5.1.2] at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity.getIndexCoordinates(SimpleElasticsearchPersistentEntity.java:134) ~[org.gridsuite.directory.server.DirectoryApplication:5.1.2] at org.springframework.data.elasticsearch.client.elc.IndicesTemplate.getIndexCoordinatesFor(IndicesTemplate.java:450) ~[na:na] at org.springframework.data.elasticsearch.client.elc.IndicesTemplate.getIndexCoordinates(IndicesTemplate.java:446) ~[na:na] at org.springframework.data.elasticsearch.client.elc.IndicesTemplate.exists(IndicesTemplate.java:169) ~[na:na] at org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository.<init>(SimpleElasticsearchRepository.java:83) ~[org.gridsuite.directory.server.DirectoryApplication:5.1.2] at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[org.gridsuite.directory.server.DirectoryApplication:na] at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[org.gridsuite.directory.server.DirectoryApplication:na] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211) ~[na:na] ... 81 common frames omitted``` Adding the missing method named in the stacktrace to metadata fix this issue.
1 parent 91468f3 commit 154b80a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
build-native-image:
6464
runs-on: ubuntu-latest
65-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
65+
# if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
6666

6767
steps:
6868
- name: Setup GraalVM
@@ -76,7 +76,7 @@ jobs:
7676
uses: actions/checkout@v1
7777

7878
- name: Build Docker Native image - Main
79-
if: github.ref == 'refs/heads/main'
79+
# if: github.ref == 'refs/heads/main'
8080
run: >
8181
mvn --batch-mode spring-boot:build-image -Pnative -DskipTests
8282
-Ddocker.publishRegistry.username=gridsuiteci
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[
22
{
33
"name":"[Ljava.util.UUID;"
4+
},
5+
{
6+
"name":"org.springframework.core.env.AbstractEnvironment",
7+
"methods":[{"name":"getProperty","parameterTypes":["java.lang.String"]}]
48
}
59
]

0 commit comments

Comments
 (0)