2
2
3
3
import gt .app .config .AppProperties ;
4
4
import gt .app .config .Constants ;
5
+ import gt .app .config .security .AppUserDetails ;
6
+ import gt .app .modules .email .dto .EmailDto ;
7
+ import gt .app .modules .note .dto .NoteCreateDto ;
8
+ import gt .app .modules .note .dto .NoteEditDto ;
9
+ import gt .app .modules .note .dto .NoteReadDto ;
10
+ import gt .app .modules .user .AppPermissionEvaluatorService ;
11
+ import gt .app .modules .user .dto .PasswordUpdateDTO ;
12
+ import gt .app .modules .user .dto .UserDTO ;
5
13
import lombok .extern .slf4j .Slf4j ;
14
+ import org .springframework .aot .hint .MemberCategory ;
15
+ import org .springframework .aot .hint .RuntimeHints ;
16
+ import org .springframework .aot .hint .RuntimeHintsRegistrar ;
6
17
import org .springframework .boot .SpringApplication ;
7
18
import org .springframework .boot .autoconfigure .SpringBootApplication ;
8
19
import org .springframework .boot .context .properties .EnableConfigurationProperties ;
20
+ import org .springframework .context .annotation .ImportRuntimeHints ;
9
21
import org .springframework .core .env .Environment ;
22
+ import org .springframework .data .domain .PageImpl ;
23
+ import org .springframework .security .authentication .UsernamePasswordAuthenticationToken ;
10
24
import org .springframework .transaction .annotation .EnableTransactionManagement ;
11
25
12
26
import java .net .InetAddress ;
18
32
@ Slf4j
19
33
@ EnableConfigurationProperties (AppProperties .class )
20
34
@ EnableTransactionManagement (proxyTargetClass = true )
35
+ @ ImportRuntimeHints (MyRuntimeHints .class ) //required for GraalVMNativeImage::
21
36
public class Application {
22
37
23
38
public static void main (String [] args ) throws UnknownHostException {
@@ -41,3 +56,29 @@ public static void main(String[] args) throws UnknownHostException {
41
56
}
42
57
43
58
}
59
+
60
+ //required for GraalVMNativeImage::
61
+ class MyRuntimeHints implements RuntimeHintsRegistrar {
62
+ @ Override
63
+ public void registerHints (RuntimeHints hints , ClassLoader classLoader ) {
64
+ //record and dto classes -> get/set not found
65
+ hints
66
+ .reflection ()
67
+ .registerType (AppProperties .class , MemberCategory .values ())
68
+ .registerType (AppProperties .FileStorage .class , MemberCategory .values ())
69
+ .registerType (EmailDto .class , MemberCategory .values ())
70
+ .registerType (EmailDto .FileBArray .class , MemberCategory .values ())
71
+ .registerType (PasswordUpdateDTO .class , MemberCategory .values ())
72
+ .registerType (UserDTO .class , MemberCategory .values ())
73
+ .registerType (NoteCreateDto .class , MemberCategory .values ())
74
+ .registerType (NoteEditDto .class , MemberCategory .values ())
75
+ .registerType (NoteReadDto .class , MemberCategory .values ())
76
+ .registerType (NoteReadDto .FileInfo .class , MemberCategory .values ())
77
+ .registerType (AppUserDetails .class , MemberCategory .values ())
78
+ .registerType (UsernamePasswordAuthenticationToken .class , MemberCategory .values ())
79
+ .registerType (AppPermissionEvaluatorService .class , MemberCategory .values ())
80
+ .registerType (PageImpl .class , MemberCategory .values ()); //EL1004E: Method call: Method getTotalElements() cannot be found on type org.springframework.data.domain.PageImpl
81
+
82
+
83
+ }
84
+ }
0 commit comments