Skip to content

Commit ad5e742

Browse files
committed
OfflineEventReplicator in Spring Boot
The mechanism of interpreting the .services of the external REST services was not working for the spring boot case. In particular this causes the OfflineEventReplicator service to not work Issue: 206569
1 parent 1db8390 commit ad5e742

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

gxspringboot/src/main/java/com/genexus/springboot/GXConfig.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.glassfish.jersey.servlet.ServletProperties;
1414
import org.springframework.boot.web.servlet.FilterRegistrationBean;
1515
import org.springframework.beans.factory.annotation.Value;
16+
import org.springframework.boot.web.servlet.ServletContextInitializer;
1617
import org.springframework.context.annotation.Bean;
1718
import org.springframework.context.annotation.Configuration;
1819
import org.springframework.core.Ordered;
@@ -92,14 +93,17 @@ public FilterRegistrationBean<UrlRewriteFilter> urlRewriteFilter() {
9293
}
9394

9495
@Bean
95-
public FilterRegistrationBean<ServletContainer> jerseyFilter() {
96-
ResourceConfig rc = new ResourceConfig();
96+
public ServletContextInitializer jerseyFilter() {
9797
Set<Class<?>> rrcs = JaxrsResourcesHolder.getAll();
98-
if (!rrcs.isEmpty()) {
99-
rc.registerClasses(rrcs.toArray(new Class<?>[0]));
100-
rc.property(ServletProperties.FILTER_FORWARD_ON_404, true);
98+
99+
if (rrcs.isEmpty()) {
100+
return sc -> {};
101101
}
102102

103+
ResourceConfig rc = new ResourceConfig();
104+
rc.registerClasses(rrcs.toArray(new Class<?>[0]));
105+
rc.property(ServletProperties.FILTER_FORWARD_ON_404, true);
106+
103107
ServletContainer container = new ServletContainer(rc);
104108

105109
FilterRegistrationBean<ServletContainer> reg = new FilterRegistrationBean<>(container);

0 commit comments

Comments
 (0)