wsimport 相关问题

wsimport是一个命令行工具,用于从WSDL生成客户端和服务工件。该实用程序是JAX-WS标准的一部分,并从版本6开始随Java平台一起提供。

Java SOAP 消息内容类型

我使用maven wsimport 和Java 1.7 生成SOAP 客户端代码。 WSDL 是由客户提供的,我相信它是一个 .NET 支持的 SOAP 服务器。 致电服务后,我不断收到...

回答 1 投票 0

使用 jaxws 插件从 WSDL 生成 Java 类,该类将通过 Bindigs 实现公共接口

我有以下类型的 wsdl 文件: .... .... 我有以下类型的 wsdl 文件: <xs:complexType name="someName"> .... </xs:complexType> <xs:complexType name="someOtherName"> .... </xs:complexType> 我想要实现的是让这些类型实现通用接口 public interface Test { //methods that already exist in the types } 为了实现这一点,我创建了绑定文件: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <jaxws:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance" jaxb:extensionBindingPrefixes="xjc inheritance" xmlns:xs="http://www.w3.org/2001/XMLSchema" wsdlLocation="my_wsdl.wsdl"> <enableWrapperStyle>true</enableWrapperStyle> <enableAsyncMapping>false</enableAsyncMapping> <jaxws:bindings node="//xs:complexType[@name='someName']"> <inheritance:implements>com.mycompany.package.Test</inheritance:implements> </jaxws:bindings> </jaxws:bindings> 还配置了插件: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>${jaxws-maven-plugin.version}</version> <dependencies> <dependency> <groupId>org.jvnet.jaxb2_commons</groupId> <artifactId>jaxb2-basics</artifactId> <version>0.6.4</version> </dependency> </dependencies> <executions> <execution> <id>wsdl</id> <goals> <goal>wsimport</goal> </goals> <configuration> <xjcArgs> <xjcArg>-Xinheritance</xjcArg> <xjcArg>-Xequals</xjcArg> <xjcArg>-XtoString</xjcArg> </xjcArgs> <genJWS>true</genJWS> <bindingDirectory>${basedir}/src/main/resources/soap</bindingDirectory> <bindingFiles> <bindingFile>binding.xjb</bindingFile> </bindingFiles> <xnocompile>true</xnocompile> <xdebug>true</xdebug> <verbose>true</verbose> <wsdlUrls> <wsdlUrl>${project.basedir}/src/main/resources/soap/my_wsdl.wsdl</wsdlUrl> </wsdlUrls> <sourceDestDir>target/generated-sources/soap</sourceDestDir> </configuration> </execution> </executions> <extensions>true</extensions> </plugin> 旗帜 <xjcArg>-Xequals</xjcArg> <xjcArg>-XtoString</xjcArg> 已考虑在内,我生成的类具有以下签名: public class SomeName implements ToString, Equals{...} 但是,即使考虑到 -Xinheritance 选项(在我添加对 jaxb2-basics 的依赖之前,它抱怨未知选项),也不会对代码生成产生任何影响。 绑定中的 XPath 是正确的,并且考虑了绑定 例如,如果代替 <inheritance:implements>com.mycompany.package.Test</inheritance:implements> 我提供: <jaxb:class name="changedName"/> 类将以更改的名称生成,但它们仍然不会实现我想要的接口。 您知道哪里出了问题吗? 我怀疑问题出在绑定文件上,但我无法确定确切的位置。 您可以尝试关注官方存储库中有关继承插件的wiki页面。 据我所知,主要区别是绑定中使用的 jaxws/jaxb 前缀。 您还可以尝试使用 -X -e 选项在 Maven 构建中添加额外的调试,以在类生成期间查看调试输出。 您可以按照此迁移指南了解如何获取最新版本的 jaxb-tools,该工具现已全部合并到同一位置。 如果仍然不起作用,请回来,我会更深入地研究,如果有必要,我会在 jaxb-tools 的 github 存储库中创建一个问题

回答 1 投票 0

使用 JDK 21 构建时 Wsimport 失败

我正在尝试将服务从 Java 8 升级到 JDK 17。我对 Maven 还很陌生。下面是 Maven pom.xml 文件。 com.sun.xml.ws ...

回答 1 投票 0

自 JDK 11 起替换 wsimport

我目前正在开发一个需要 wsimport 的项目,但我们使用 JDK 11,我发现自该版本以来 wsimport 已从 JDK 中删除。 我寻找答案并尝试添加这个

回答 6 投票 0

Java 11之后wsimport在哪里

我使用 wsimport 和其他 Metro 工具很多年了,但自从 Java 11 中删除了 Java EE 模块后,我找不到这些工具了。 在哪里可以找到 wsimport 可执行文件?

回答 1 投票 0

使用 Spring Boot 3 jakarta 依赖项生成 WSDL2Java 代码 - 为集合参数生成 setter

我正在尝试从 wsdl 文件生成 java 源,以与在 Java 17 /Spring Boot 3 上运行的项目集成。我正在使用以下 Maven 插件设置来实现此目的: 我正在尝试从 wsdl 文件生成 java 源,以与在 Java 17 /Spring Boot 3 上运行的项目集成。我正在使用以下 Maven 插件设置来实现此目的: <plugin> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>4.0.1</version> <executions> <execution> <goals> <goal>wsimport</goal> </goals> </execution> </executions> <configuration> <packageName>io.test.lib</packageName> <wsdlDirectory>${project.basedir}/src/main/resources/</wsdlDirectory> <wsdlFiles> <wsdlFile>my_wsdl.wsdl</wsdlFile> </wsdlFiles> <wsdlLocation>/my_wsdl.wsdl</wsdlLocation> <!-- <xjcArgs>--> <!-- <xjcArg>-Xsetters</xjcArg>--> <!-- </xjcArgs>--> </configuration> <!-- <dependencies>--> <!-- <dependency>--> <!-- <groupId>org.jvnet.jaxb2_commons</groupId>--> <!-- <artifactId>jaxb2-basics</artifactId>--> <!-- <version>1.11.1</version>--> <!-- </dependency>--> <!-- </dependencies>--> </plugin> 除了生成的 java 文件不包含列表/集合类型参数的 setter 方法之外,这一切都很好。我之前在 Spring boot 2 中使用注释掉的插件来实现此目的,但这不再起作用。关于如何实现这一目标有什么想法吗? 该插件已更新为支持 jakarta 命名空间(JAXB 3 / JAXB 4) 初始存储库位于此处 新存储库位置此处(合并到 maven-jaxb2-plugin 位置,重命名为 jaxb-tools) 您可以遵循 迁移指南,因为我们对 groupId(统一化)和 artifactId 进行了一些更改(删除 jaxb2 参考) 更新后的插件参考配置应如下所示: <plugin> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>4.0.1</version> <executions> <execution> <goals> <goal>wsimport</goal> </goals> </execution> </executions> <configuration> <packageName>io.test.lib</packageName> <wsdlDirectory>${project.basedir}/src/main/resources/</wsdlDirectory> <wsdlFiles> <wsdlFile>my_wsdl.wsdl</wsdlFile> </wsdlFiles> <wsdlLocation>/my_wsdl.wsdl</wsdlLocation> <xjcArgs> <xjcArg>-Xsetters</xjcArg> </xjcArgs> </configuration> <dependencies> <dependency> <groupId>org.jvnet.jaxb</groupId> <artifactId>jaxb-plugins</artifactId> <version>4.0.0</version> </dependency> </dependencies> </plugin>

回答 1 投票 0

在 JAX-WS Web 服务中实现 WS-Policy

我正在使用 JAX-WS 用 Java 开发 SOAP Web 服务。我正在使用 Eclipse Juno 和 Weblogic 12c。该 Web 服务正在 EJB 项目中开发。我正在使用自上而下的方法:从 WSDL t...

回答 1 投票 0

wsimport - 'XXX' 已经定义,第一个定义出现在这里

我正在使用 WSDL 生成 Java 类,该 WSDL 导入并包含大量其他模式和 DTD,而这些模式和 DTD 又相互引用。 (这就是臭名昭著的“标准”XTA2 V3 WSDL...

回答 1 投票 0

命令提示符中无法识别“wsimport”错误

我是网络服务新手。我正在尝试使用以下命令生成存根: wsimport -d ./build -s ./src -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceS...

回答 11 投票 0

wsimport 生成 java 类 - 401 错误

我用 wsimport java 类生成。我导入的 wsdl 请求身份验证。 我用了这个例子: wsimport -Xauthfile C: uth.txt -keep http://example.com/test?wsdl -s c:\path o\sou...

回答 1 投票 0

wsimport 对 jax-ws-catalog.xml 有什么作用?

我在网上找到的有关 wsimport 的所有文档似乎对于使用目录文件 (jax-ws-catalog.xml) 的某个方面都有点模糊。我的问题是: 当我生成 Web 服务cl...

回答 1 投票 0


ServerSOAPFaultException:客户端从服务器接收到SOAP错误

我有来自ERP云的wsdl。要在Java中使用它,我使用wsimport对其进行了编译,并提取了所有Java文件。现在,我正在尝试使用这些java文件来与服务器数据进行通信...

回答 1 投票 2

将样本请求XML从wsdl转换为Java

这里是示例wsdl:http://www.dneonline.com/calculator.asmx?wsdl,这是在SOAPUI中生成的示例请求:

回答 1 投票 0

Java jax-ws目录文件:PUBLIC和SYSTEM条目之间的区别

[有人可以解释以下TR9401目录格式(我与Java jax-ws工具(如xjc,wsimport等一起使用)中的SYSTEM和PUBLIC条目之间的区别)相同的概念(SYSTEM和...

回答 1 投票 1

WSDL2Java:缺少复杂元素类型会生成java.lang.Object参数类型

我正在尝试导入此WSDL:https://gateway.monster.com:8443/bgwBroker其中包括此XSD:http://schemas.monster.com/current/xsd/Query.xsd,其中包含以下代码段:

回答 1 投票 0


使用Java进行SOAP服务调用时出错

我有HTTPS Web服务。我可以使用wsimport生成Java类,但是在调用服务时会收到以下异常:com.sun.xml.internal.ws.client.ClientTransportException:HTTP ...

回答 1 投票 0

我有一个Web服务,它可以通过https进行工作,我可以使用wsimport生成Java类,但是当我调用该服务时,会收到以下异常:

当我尝试运行Soap服务呼叫时,我遇到了异常。 com.sun.xml.internal.ws.client.ClientTransportException:HTTP传输错误:java.net.UnknownHostException:abc.xyz.ca.com ...

回答 1 投票 -1

maven 无法执行目标 org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport

下面是我用来做 wsimport 的 pom.xml 下面是我用来做 wsimport 的 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.dat</groupId> <artifactId>digsig</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>digsig</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-xjc --> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-xjc</artifactId> <version>2.2.11</version> </dependency> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>2.2.8</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>validate</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/endorsed</outputDirectory> <silent>true</silent> <artifactItems> <artifactItem> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.2.7</version> <type>jar</type> </artifactItem> <artifactItem> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.2.9</version> <type>jar</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.jvnet.jax-ws-commons</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.3</version> <executions> <execution> <goals> <goal>wsimport</goal> </goals> <!-- Following configuration will pass all XML files from ${basedir}/src/bindings to wsimport. --> <configuration> <bindingDirectory>${basedir}/src</bindingDirectory> <vmArgs> <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> </vmArgs> <wsdlUrls> <wsdlUrl>http://webservice.server/Services/InvoiceService.asmx?WSDL</wsdlUrl> </wsdlUrls> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> 构建失败并出现以下错误 [DEBUG] Importing foreign packages into class realm plugin>org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3 [DEBUG] Imported: < maven.api [DEBUG] Populating class realm plugin>org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3 [DEBUG] Included: org.jvnet.jax-ws-commons:jaxws-maven-plugin:jar:2.3 [DEBUG] Included: com.sun.xml.ws:jaxws-tools:jar:2.2.8 [DEBUG] Included: org.jvnet.jaxb2_commons:jaxb2-basics:jar:0.6.4 [DEBUG] Included: org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.6.4 [DEBUG] Included: org.jvnet.jaxb2_commons:jaxb2-basics-tools:jar:0.6.4 [DEBUG] Included: commons-beanutils:commons-beanutils:jar:1.7.0 [DEBUG] Included: commons-lang:commons-lang:jar:2.2 [DEBUG] Included: commons-logging:commons-logging:jar:1.1.1 [DEBUG] Included: com.google.code.javaparser:javaparser:jar:1.0.8 [DEBUG] Included: backport-util-concurrent:backport-util-concurrent:jar:3.1 [DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.11 [DEBUG] Included: junit:junit:jar:3.8.1 [DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5 [DEBUG] Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0 [DEBUG] Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0 [DEBUG] Included: org.sonatype.sisu:sisu-guava:jar:0.9.9 [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.10 [DEBUG] Configuring mojo org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport from plugin realm ClassRealm[plugin>org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3, parent: sun.misc.Launcher$AppClassLoader@55f96302] [DEBUG] Configuring mojo 'org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport' with basic configurator --> [DEBUG] (f) bindingDirectory = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src [DEBUG] (f) destDir = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\classes [DEBUG] (f) encoding = UTF-8 [DEBUG] (f) extension = false [DEBUG] (f) genJWS = false [DEBUG] (f) implDestDir = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src\main\java [DEBUG] (f) keep = true [DEBUG] (f) localRepository = id: local url: file:///c:/tools/maven/repository/ layout: default snapshots: [enabled => true, update => always] releases: [enabled => true, update => always] [DEBUG] (f) pluginArtifactMap = {org.jvnet.jax-ws-commons:jaxws-maven-plugin=org.jvnet.jax-ws-commons:jaxws-maven-plugin:maven-plugin:2.3:, com.sun.xml.ws:jaxws-tools=com.sun.xml.ws:jaxws-tools:jar:2.2.8:compile, org.jvnet.jaxb2_commons:jaxb2-basics=org.jvnet.jaxb2_commons:jaxb2-basics:jar:0.6.4:compile, org.jvnet.jaxb2_commons:jaxb2-basics-runtime=org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.6.4:compile, org.jvnet.jaxb2_commons:jaxb2-basics-tools=org.jvnet.jaxb2_commons:jaxb2-basics-tools:jar:0.6.4:compile, commons-beanutils:commons-beanutils=commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-lang:commons-lang=commons-lang:commons-lang:jar:2.2:compile, commons-logging:commons-logging=commons-logging:commons-logging:jar:1.1.1:compile, com.google.code.javaparser:javaparser=com.google.code.javaparser:javaparser:jar:1.0.8:compile, org.apache.maven:maven-project=org.apache.maven:maven-project:jar:2.2.1:compile, org.apache.maven:maven-settings=org.apache.maven:maven-settings:jar:2.2.1:compile, org.apache.maven:maven-profile=org.apache.maven:maven-profile:jar:2.2.1:compile, org.apache.maven:maven-model=org.apache.maven:maven-model:jar:2.2.1:compile, org.apache.maven:maven-artifact-manager=org.apache.maven:maven-artifact-manager:jar:2.2.1:compile, org.apache.maven:maven-repository-metadata=org.apache.maven:maven-repository-metadata:jar:2.2.1:compile, backport-util-concurrent:backport-util-concurrent=backport-util-concurrent:backport-util-concurrent:jar:3.1:compile, org.apache.maven:maven-plugin-registry=org.apache.maven:maven-plugin-registry:jar:2.2.1:compile, org.codehaus.plexus:plexus-interpolation=org.codehaus.plexus:plexus-interpolation:jar:1.11:compile, org.apache.maven:maven-artifact=org.apache.maven:maven-artifact:jar:2.2.1:compile, org.codehaus.plexus:plexus-container-default=org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile, junit:junit=junit:junit:jar:3.8.1:compile, classworlds:classworlds=classworlds:classworlds:jar:1.1-alpha-2:compile, org.apache.maven:maven-plugin-api=org.apache.maven:maven-plugin-api:jar:3.0.5:compile, org.sonatype.sisu:sisu-inject-plexus=org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile, org.codehaus.plexus:plexus-component-annotations=org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile, org.codehaus.plexus:plexus-classworlds=org.codehaus.plexus:plexus-classworlds:jar:2.4:compile, org.sonatype.sisu:sisu-inject-bean=org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile, org.sonatype.sisu:sisu-guice=org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile, org.sonatype.sisu:sisu-guava=org.sonatype.sisu:sisu-guava:jar:0.9.9:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:3.0.10:compile} [DEBUG] (f) quiet = false [DEBUG] (f) remoteRepositories = [ id: nexus url: http://passport-nexus/nexus/content/groups/public layout: default snapshots: [enabled => false, update => daily] releases: [enabled => true, update => never] ] [DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@78e89bfe [DEBUG] (f) sourceDestDir = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\generated-sources\wsimport [DEBUG] (f) staleFile = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\jaxws\stale [DEBUG] (f) verbose = false [DEBUG] (f) vmArgs = [-Djavax.xml.accessExternalSchema=all] [DEBUG] (f) wsdlDirectory = D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src\wsdl [DEBUG] (f) wsdlUrls = [http://webservice.server/Services/InvoiceService.asmx?WSDL] [DEBUG] (f) xadditionalHeaders = false [DEBUG] (f) xdebug = false [DEBUG] (f) xdisableAuthenticator = false [DEBUG] (f) xdisableSSLHostnameVerification = false [DEBUG] (f) xnoAddressingDataBinding = false [DEBUG] (f) xnocompile = true [DEBUG] (f) xuseBaseResourceAndURLToLoadWSDL = false [DEBUG] (f) project = MavenProject: com.dat:digsig:0.0.1-SNAPSHOT @ D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\pom.xml [DEBUG] -- end configuration -- [DEBUG] The wsdl Directory is D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src\wsdl [DEBUG] The binding Directory is D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src [INFO] Processing: http://webservice.server/Services/InvoiceService.asmx?WSDL [DEBUG] adding src root: D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\generated-sources\wsimport [DEBUG] The binding Directory is D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\src [DEBUG] jaxws:wsimport args: [-keep, -s, D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\generated-sources\wsimport, -d, D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\classes, -encoding, UTF-8, -Xnocompile] [INFO] jaxws:wsimport args: [-keep, -s, D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\generated-sources\wsimport, -d, D:\Dev\Eclipse_Workspace\Neon\WebService_Demo\digsig\target\classes, -encoding, UTF-8, -Xnocompile, "http://webservice.server/Services/InvoiceService.asmx?WSDL"] [DEBUG] dummy:dummy:jar:1.0 (selected for null) [WARNING] Failed to build parent project for com.sun.xml.ws:project:pom:2.2.8 [WARNING] Failed to build parent project for com.sun.xml.ws:bundles:pom:2.2.8 [WARNING] Failed to build parent project for com.sun.xml.ws:jaxws-tools:pom:2.2.8 [WARNING] Invalid POM for com.sun.xml.ws:jaxws-tools:jar:2.2.8, transitive dependencies (if any) will not be available, enable debug logging for more details: Some problems were encountered while processing the POMs: [ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} @ com.sun.xml.ws:jaxws-ri-bom:2.2.8, c:\tools\maven\repository\com\sun\xml\ws\jaxws-ri-bom\2.2.8\jaxws-ri-bom-2.2.8.pom, line 395, column 29 [DEBUG] com.sun.xml.ws:jaxws-tools:jar:2.2.8:compile (selected for compile) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.747 s [INFO] Finished at: 2017-02-27T16:47:38-06:00 [INFO] Final Memory: 12M/364M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (default) on project digsig: Execution default of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport failed: String index out of range: -1 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (default) on project digsig: Execution default of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport failed: String index out of range: -1 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport failed: String index out of range: -1 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.AbstractStringBuilder.substring(Unknown Source) at java.lang.StringBuilder.substring(Unknown Source) at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.getCP(AbstractJaxwsMojo.java:484) at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.exec(AbstractJaxwsMojo.java:359) at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.java:342) at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.execute(WsImportMojo.java:282) at org.jvnet.jax_ws_commons.jaxws.MainWsImportMojo.execute(MainWsImportMojo.java:50) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 有人可以帮我解决这个问题吗? 我通过简单地降级我使用的 JDK 版本来修复这个错误。 右键单击您的项目 > 属性 > 构建 > 编译 > Java 平台 > 将其设置为 JDK 1.8. 有时会因为类未找到异常而发生 点击wsgen error然后你可以看到更多的细节 检查构建失败的点 检查 sei 标签中的类(在 pom.xml 中)指的是正确的服务。它应该从源(src)指向正确的路径。 这解决了我的问题。

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.