2015-06-12 63 views
1

我需要將WSDL轉換爲Java。我使用命令wsdl2java SERVICE.WSDL運行命令行,但它導致錯誤:apache cxf - 將WSDL轉換爲Java

"the system cannot find the path specified"

任何人都可以幫我嗎?

+0

這不是發佈此錯誤的工具,但您的操作系統試圖告訴您,它無法找到您告訴它找到的路徑之一。請仔細檢查你如何調用生成器,並且可能提供更多細節,如確切的命令行和非常確切的錯誤消息(如何通過調用和錯誤並排顯示終端窗口的截圖?) – hiergiltdiestfu

+0

我可以放不上截圖,我需要10點聲望。但是我使用WSDL2JAVA GetService.wsdl命令並導致錯誤:系統找不到指定的路徑。我沒有設置環境變量。 – xptoo

+0

將這些命令(文本不是屏幕截圖)添加到帖子中。 – cyroxis

回答

1

根據批次:

@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_HOME%\ lib \ tools.jar不存在。 因此,請檢查環境變量JAVA_HOME是否存在,以及它是否正確設置。

+0

我有同樣的問題。在我的情況下,我把分號「;」在'%JAVAHOME%'環境變量末尾,需要**刪除**。 – alseether