Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ApacheCXF-将WSDL转换为Java_Java_Wsdl_Cxf_Converter - Fatal编程技术网

ApacheCXF-将WSDL转换为Java

ApacheCXF-将WSDL转换为Java,java,wsdl,cxf,converter,Java,Wsdl,Cxf,Converter,我需要将WSDL转换为Java。我使用commandwsdl2java SERVICE.WSDL运行命令行,但它导致了错误: “系统找不到指定的路径” 有人帮我吗?根据批次: @echo off rem rem rem Licensed to the Apache Software Foundation (ASF) under one rem or more contributor license agreements. See the NOTICE file rem dist

我需要将WSDL转换为Java。我使用command
wsdl2java SERVICE.WSDL
运行命令行,但它导致了错误:

“系统找不到指定的路径”

有人帮我吗?

根据批次:

@echo off
rem
rem
rem    Licensed to the Apache Software Foundation (ASF) under one
rem    or more contributor license agreements. See the NOTICE file
rem    distributed with this work for additional information
rem    regarding copyright ownership. The ASF licenses this file
rem    to you under the Apache License, Version 2.0 (the
rem    "License"); you may not use this file except in compliance
rem    with the License. You may obtain a copy of the License at
rem
rem    http://www.apache.org/licenses/LICENSE-2.0
rem
rem    Unless required by applicable law or agreed to in writing,
rem    software distributed under the License is distributed on an
rem    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem    KIND, either express or implied. See the License for the
rem    specific language governing permissions and limitations
rem    under the License.
rem
rem

rem 
rem  invoke the Apache CXF wsdl2java tool
rem 
@setlocal

if not defined CXF_HOME goto set_cxf_home

:cont
if not defined JAVA_HOME goto no_java_home

set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar;

if not exist "%CXF_HOME%\lib\cxf-manifest.jar" goto no_cxf_jar

set CXF_JAR=%CXF_HOME%\lib\cxf-manifest.jar


"%JAVA_HOME%\bin\java" -Xmx128M -Djava.endorsed.dirs="%CXF_HOME%\lib\endorsed" -cp "%CXF_JAR%;%TOOLS_JAR%;%CLASSPATH%" -Djava.util.logging.config.file="%CXF_HOME%\etc\logging.properties" org.apache.cxf.tools.wsdlto.WSDLToJava %*

@endlocal

goto end

:no_cxf_jar
echo ERROR: Unable to find cxf-manifest.jar in %cxf_home/lib
goto end

:no_java_home
echo ERROR: Set JAVA_HOME to the path where the JDK (6.0 or higher) is installed
goto end 

:set_cxf_home
set CXF_HOME=%~dp0..
goto cont

:end
根据我的说法,可能只有一个问题,它会产生您报告的错误。 路径%JAVA\u HOME%\lib\tools.jar不存在。
因此,请检查环境变量JAVA_HOME是否存在以及设置是否正确。

发出此错误的不是工具,而是您的操作系统试图告诉您无法找到您告诉它要查找的路径之一。请仔细检查你是如何调用生成器的,可能会给出更多的细节,比如确切的命令行和非常准确的错误消息(关于终端窗口的屏幕截图,电话和错误并排显示如何?)。但是我使用了WSDL2JAVA GetService.wsdl命令并导致了错误:系统无法找到指定的路径。我没有设置环境变量。将命令(文本而不是屏幕截图)添加到帖子中。我使用的唯一命令是:wsdl2java GetService.wsdl wsdl2java是一个批处理文件,它是apache cxf的bin文件夹。因此,wsdl与wsdl2java批处理位于同一文件夹中?感觉不对。您确定确切的命令行吗?如果非要我猜的话,我会说您要么忘了限定wsdl的路径,要么在不可见的地方调用了生成器,要么两者兼而有之。至于截图,你可以把它们上传到一些图片分享网站,比如imgur,然后在你的问题中发布上传链接。更高的代表用户可能会为您包括它。我也有同样的问题。在我的例子中,我在需要删除的环境变量
%JAVAHOME%
的末尾加了一个分号“;”。