我正在尝试使用 apache cxf 实现宁静的 Web 服务。
在tomcat中部署war文件时,我收到错误,因为创建名称为“分析”的bean时出错:调用初始化方法失败;嵌套的异常是 org.apache.cxf.service.factory.ServiceConstructionException
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/cxf.xml]
03-Nov-2014 17:03:40 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12f41a5: defining beans [/Analysis/,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,Analysis,AnalysisResponse,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
03-Nov-2014 17:03:40 org.apache.cxf.jaxrs.utils.ResourceUtils checkMethodDispatcher
WARNING: No resource methods have been found for resource class com.bt.ws.pointsystem.pojo.AnalysisResponse
03-Nov-2014 17:03:40 org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean checkResources
SEVERE: No resource classes found
03-Nov-2014 17:03:40 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12f41a5: defining beans [/Analysis/,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,Analysis,AnalysisResponse,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
03-Nov-2014 17:03:40 org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
以下是cxf.xml:
<beans default-autowire="byName" xmlns="http://www.springframework.org/schema/beans"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
<context:component-scan base-package="com.bt.ws.pointsystem,com.bt.ws.pointsystem.pojo" />
<jaxrs:server address="/" id="Analysis">
<jaxrs:serviceBeans>
<ref bean="AnalysisResponse" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="xml" value="application/xml">
</entry>
</jaxrs:extensionMappings>
</jaxrs:server>
<bean class="com.bt.ws.pointsystem.pojo.AnalysisResponse" id="AnalysisResponse">
</bean>
</beans>
web.xml:
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>PointSystemService</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/cxf.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>
类定义:
package com.bt.ws.pointsystem.pojo;
public class AnalysisResponse {
private String UserId;
private String AnalysisType;
public String getUserId() {
return UserId;
}
public void setUserId(String userId) {
UserId = userId;
}
public String getAnalysisType() {
return AnalysisType;
}
public void setAnalysisType(String analysisType) {
AnalysisType = analysisType;
}
}
我在这里还错过了什么?
TIA公司
我遇到了一个类似的问题,当我更正@WebService注释时,这个问题就消失了,它需要在接口上,而不是服务类上。
此问题的另一个常见原因是使用@Path而不是
公共
方法进行注释。
这似乎是由导入的“BaseGameUtils”库项目中的“GameHelper.java”文件生成的,该库项目被我的游戏应用程序引用为库。 我已将google-play-sevices_llb导入到我的工作区,并将其作为一个库引用到BaseGameUtils库本身中。在BaseGameUtils的Android私有库中有一个google-play-services.jar。在Android Dep
创造刀身php 网状物php AdminController.php VerifyCsrfToken.php 当我上传图像在CKEditor我得到这个错误。 请求的资源/管理员/上传/图像?CKEditor=主体
当我尝试使用GooplayService运行游戏时,Logcat显示以下错误: 我的代码登录Google Play游戏服务: 我使用Genymotion,google play游戏服务的最新版本.
我使用Genymotion,google play游戏服务的最后一个版本。
我试图将GooglePlay排行榜和成就添加到我的Unity3D插件中,但总是出错: …………。d/dalvikvm(6052):vfy:替换0x003f w/dalvikvm(6052):vfy:无法解析lcom/google/android/gms/r$string中的静态字段1854(common_google_play_services_update_text);D/DALVIKVM(60