Рабочая конфигурация (без собственной сборки):
Код: Выделить всё
import jakarta.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.metrics.MetricsFeature;
import org.apache.cxf.metrics.MetricsProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CalloutWebServiceConfiguration {
private final Bus bus;
private final MetricsProvider metricsProvider;
public CalloutWebServiceConfiguration(final Bus bus, final MetricsProvider metricsProvider) {
this.bus = bus;
this.metricsProvider = metricsProvider;
}
@Bean
public Endpoint endpoint(final GlobalXmlContextCalloutPortType globalXmlContextCalloutPortType) {
EndpointImpl endpoint = new EndpointImpl(
bus,
globalXmlContextCalloutPortType,
null,
null,
new MetricsFeature[]{
new MetricsFeature(metricsProvider)
});
endpoint.publish("/GlobalXmlContextCalloutService");
return endpoint;
}
}
Код: Выделить всё
2024-07-30 10:33:38 2024-07-30T08:33:38.736Z INFO 1 --- [ main] o.a.c.w.s.f.ReflectionServiceFactoryBean : Creating Service {http://callout.application.name.ch/}GlobalXmlContextCalloutPortTypeImplService from class ch.name.application.wsdl.callout.GlobalXmlContextCalloutPortType
2024-07-30 10:33:38 2024-07-30T08:33:38.737Z WARN 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpoint': Instantiation of supplied bean failed
2024-07-30 10:33:38 2024-07-30T08:33:38.738Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-07-30 10:33:38 Application run failed
2024-07-30 10:33:38 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'endpoint': Instantiation of supplied bean failed
2024-07-30 10:33:38 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1225)
...
2024-07-30 10:33:38 Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.apache.cxf.common.util.ASMHelper$ClassWriter] without it being registered for runtime reflection. Add [org.apache.cxf.common.util.ASMHelper$ClassWriter] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
2024-07-30 10:33:38 at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
...
Код: Выделить всё
2024-07-30 10:45:47 2024-07-30T08:45:47.965Z WARN 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cxf' of type [org.apache.cxf.bus.spring.SpringBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [meterRegistryPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
Код: Выделить всё
import jakarta.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.metrics.MetricsFeature;
import org.apache.cxf.metrics.MetricsProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
@Configuration
public class CalloutWebServiceConfiguration {
private final Bus bus;
private final MetricsProvider metricsProvider;
public CalloutWebServiceConfiguration(final Bus bus, final MetricsProvider metricsProvider) {
this.bus = bus;
this.metricsProvider = metricsProvider;
}
@Bean
@Lazy
@DependsOn({"bus", "metricsProvider"})
public Endpoint endpoint(final GlobalXmlContextCalloutPortType globalXmlContextCalloutPortType) {
EndpointImpl endpoint = new EndpointImpl(
bus,
globalXmlContextCalloutPortType,
null,
null,
new MetricsFeature[]{
new MetricsFeature(metricsProvider)
});
endpoint.publish("/GlobalXmlContextCalloutService");
return endpoint;
}
}
Код: Выделить всё
2024-07-30 10:47:21 2024-07-30T08:47:21.714Z WARN 1 --- [nio-8080-exec-4] o.a.c.t.servlet.ServletController : Can't find the request for http://localhost:8080/services's Observer
Подробнее здесь: https://stackoverflow.com/questions/788 ... th-graalvm
Мобильная версия