带有SpringBoot和Apache CXF的wsdl Only Compiled Jar(不在调试模式下)的问题

时间:2019-04-15 14:14:47

标签: spring-boot wsdl cxf

在生成以下服务时遇到问题,我指定了pom,生成该服务的代码以及错误。在调试模式下在eclipse中执行api时不会发生该错误,只有在编译并执行jar时才会出现此错误。

代码:

# e.g. routing.yaml (`kubectl apply -f routing.yaml`)
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: entry-route
  namespace: default
spec:
  - knative-ingress-gateway.knative-serving.svc.cluster.local
  # Set host to the domain name that you own.
  hosts:
  - myapp.com
  http:
  - match:
    - uri:
        prefix: "/login"
    rewrite:
      authority: login-service.default.myapp.com
    route:
      - destination:
          host: istio-ingressgateway.istio-system.svc.cluster.local
        weight: 100
  - match:
    - uri:
        prefix: "/logout"
    rewrite:
      authority: logout-service.default.myapp.com
    route:
      - destination:
          host: istio-ingressgateway.istio-system.svc.cluster.local
        weight: 100

POM:

URL wsdlLocation = new URL(strWsdlLocation);
QName serviceName =  new QName(namespaceURI, localPart);

Service service = Service.create(wsdlLocation, serviceName);

//ERROR HERE
serviceObject = service.getPort(serviceEndpointInterface);

Client client = ClientProxy.getClient(serviceObject);
Endpoint cxfEndpoint = client.getEndpoint();

错误排除:

    <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-codegen-plugin</artifactId>
                    <version>3.3.0</version>

                    <executions>
                        <execution>
                            <id>wsdl2java-generate-ObtenerUsuario</id>
                            <phase>generate-sources</phase>
                            <configuration>
                                <wsdlOptions>
                                    <wsdlOption>
                                        <wsdl>${project.basedir}/src/wsdl/ObtenerUsuario.wsdl</wsdl>
                                        <wsdlLocation>http://testPruebas_8080/testClient/ObtenerUsuario.wsdl</wsdlLocation>
                                        <extraargs>
                                            <extraarg>-p</extraarg>
                                            <extraarg>project.bindings.test.obtenerusuario</extraarg>
                                            <extraarg>-bareMethods</extraarg>
                                        </extraargs>
                                        <frontEnd>jaxws21</frontEnd>
                                        <faultSerialVersionUID>1</faultSerialVersionUID>
                                    </wsdlOption>
                                </wsdlOptions>
                            </configuration>
                          <goals>
                                <goal>wsdl2java</goal>
                          </goals>
                        </execution>
                    </executions>

                    <configuration>
                        <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsdl2java</sourceDestDir>
                        <xnocompile>true</xnocompile>
                        <verbose>true</verbose>
                        <extension>true</extension>
                        <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
                    </configuration>
                </plugin>

0 个答案:

没有答案