Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.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
Java 使用Eclipse创建web服务_Java_Web Services_Eclipse - Fatal编程技术网

Java 使用Eclipse创建web服务

Java 使用Eclipse创建web服务,java,web-services,eclipse,Java,Web Services,Eclipse,我正在尝试在Axis2下使用EclipseJavaEE创建我的第一个Web服务, 我在看这本旅游杂志 为了了解如何创建Web服务,我创建了Web服务,但当我想通过URL查看Web服务以确保其已部署时,会出现HTTP状态400。我怎么知道是什么错误?? 下面是我所做的: 我在preferences[ant、axis2、tomcat和java]中进行设置 新建->新建动态网页 新建->java(我创建了要转换为ws的类) 新建->web服务(我想创建自底向上的ws) 键入浏览器的url 这是返回

我正在尝试在Axis2下使用EclipseJavaEE创建我的第一个Web服务, 我在看这本旅游杂志 为了了解如何创建Web服务,我创建了Web服务,但当我想通过URL查看Web服务以确保其已部署时,会出现HTTP状态400。我怎么知道是什么错误?? 下面是我所做的:

  • 我在preferences[ant、axis2、tomcat和java]中进行设置
  • 新建->新建动态网页
  • 新建->java(我创建了要转换为ws的类)
  • 新建->web服务(我想创建自底向上的ws)
  • 键入浏览器的url
这是返回的HTTP状态404-/services/listservices

有人能告诉我怎么知道是什么错误吗?或者我如何定义它

编辑: eclipse控制台中发生异常,异常为:

org.apache.axis2.transport.http.AxisAdminServlet java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet
在配置中,我指定axis2和eclipse显示的位置,我应该怎么做

Axis2 runtime loaded successfully
在创建新的工作空间并再次创建webservice之后,这是控制台中显示的输出

 Dec 20, 2010 8:32:04 PM org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal performance in 
production environments was not found on the java.library.path: C:\Program      
 Files\Java\jdk1.6.0_18\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/alaa college/year 4/1st   
 semester/Advance sw/Libraries/eclipse/jre/bin/client;F:/alaa college/year 4/1st    
semester/Advance sw/Libraries/eclipse/jre/bin;D:\app\AloOoSh\product\11.1.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_18\bin;%ANT_HOME%\bin;%AXIS2_HOME%\bin;%CATALINA_HOME%\bin;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win32;
Dec 20, 2010 8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'     
to 'org.eclipse.jst.jee.server:testFirst' did not find a matching property.
 Dec 20, 2010 8:32:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 401 ms
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina

Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
[INFO] Deploying module: addressing-1.4 -     file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testF
 irst/WEB-INF/modules/addressing-1.4.mar
[INFO] Deploying module: metadataExchange-1.4 -    
 file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/mex-1.4.mar
 [INFO] Deploying module: ping-1.4 -    
 file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/ping-1.4.mar
 [INFO] Deploying module: script-1.4 -  file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/scripting-1.4.mar
 [INFO] Deploying module: smtpfault - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/smtpfault.mar
[INFO] Deploying module: soapmonitor-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/soapmonitor-1.4.mar
 [INFO] Deploying Web service: Converter - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/Converter/
[INFO] Deploying Web service: version.aar - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/version.aar
 Dec 20, 2010 8:32:06 PM org.apache.coyote.http11.Http11Protocol start
 INFO: Starting Coyote HTTP/1.1 on http-8080
 Dec 20, 2010 8:32:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 20, 2010 8:32:06 PM org.apache.jk.server.JkMain start
 INFO: Jk running ID=0 time=0/19  config=null
Dec 20, 2010 8:32:06 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1383 ms

发生404错误是因为所需url中没有任何内容。所以你的部署一定有问题

您是否在eclipse中设置了服务器并实际发布了WS?请注意,这不同于从计算机上其他地方的目录运行Tomcat!您可以通过选择New=>server来添加服务器实例


如果服务器配置是正确的,那么服务器输出应该出现在eclipse的控制台中,如果您的WS设置有任何错误,那么应该有错误消息可以用来跟踪问题。

这是我自己关于创建webservice并在android中使用该服务的帖子。它的 工作正常

在下面的链接中尝试一下


您可能将axis2.war(重命名为app.zip)的内容提取到了错误的文件夹中,或者将文件部署到了错误的文件夹中。查找部署的app.war文件夹下的WEB-INF文件夹。如果您有另一个用于axis2提取文件夹的WEB-INF文件夹,则JBoss无法找到它们。WEB-INF文件夹必须是作为一级子体的文件夹。以及以下文件夹:axis2 web、META-INF和org。

@weltraumpirat-是的,控制台中有一个异常,是关于axis2的。请检查编辑部分。这肯定是配置问题。按照我的理解,AdminServlet不是核心Axis2运行时的一部分。您是将Axis2部署为web服务中的库,还是将其单独安装在服务器上?您需要相应地设置类路径。如果您还没有做很多更改,请返回教程,确保您已经完成了正确设置Axis2所需的所有步骤。这应该比尝试查找错误快得多。我创建了新的工作空间并创建了新的web服务,没有发生错误,但它不会在URK上运行:(您可以从控制台发布整个输出吗?否则问题很难找到。这似乎是唯一的奇怪消息:2010年12月20日8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING:[SetPropertiesRule]{Server/Service/Engine/Host/Context}将属性“source”设置为“org.eclipse.jst.jee.server:testFirst”未找到匹配的属性。