- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在运行 Spring Boot 应用程序 (mvn:spring-boot:run
) 并获取下一个堆栈跟踪:
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.2.RELEASE)
2016-02-10 09:57:31.350 INFO 8868 --- [ main] com.comp.config.Application : Starting Application on SOFT12 with PID 8868 (C:\Users\Maya\git\app-services\target\classes started by Maya in C:\Users\Maya\git\app-services)
2016-02-10 09:57:31.356 INFO 8868 --- [ main] com.comp.config.Application : No active profile set, falling back to default profiles: default
2016-02-10 09:57:31.429 INFO 8868 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7dd7f653: startup date [Wed Feb 10 09:57:31 MSK 2016]; root of context hierarchy
2016-02-10 09:57:33.174 INFO 8868 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2016-02-10 09:57:35.126 INFO 8868 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-02-10 09:57:35.151 INFO 8868 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-02-10 09:57:35.153 INFO 8868 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.0.30
2016-02-10 09:57:35.296 INFO 8868 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-02-10 09:57:35.296 INFO 8868 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3871 ms
2016-02-10 09:57:36.401 INFO 8868 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'CXFServlet' to [/APPservice/*]
2016-02-10 09:57:36.408 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'metricFilter' to: [/*]
2016-02-10 09:57:36.409 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-02-10 09:57:36.409 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-02-10 09:57:36.409 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-02-10 09:57:36.410 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-02-10 09:57:36.410 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2016-02-10 09:57:36.410 INFO 8868 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2016-02-10 09:57:37.028 INFO 8868 --- [ main] o.a.c.w.s.f.ReflectionServiceFactoryBean : Creating Service {http://new.webservice.namespace}CompServiceForPCO from WSDL: classpath:CompService.wsdl
2016-02-10 09:57:39.665 WARN 8868 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ws' defined in com.comp.config.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.xml.ws.Endpoint]: Factory method 'ws' threw exception; nested exception is javax.xml.ws.WebServiceException: java.lang.NullPointerException
2016-02-10 09:57:39.676 INFO 8868 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2016-02-10 09:57:39.891 ERROR 8868 --- [ main] o.s.boot.SpringApplication : Application startup failed
ws 方法在 Application.class 中,如下所示:
package com.comp.config;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import com.comp.pcoserv.CompServiceEndPoindImpl;
import javax.xml.ws.Endpoint;
@Configuration
@EnableAutoConfiguration
public class Application {
public static final String SERVLET_MAPPING_URL_PATH = "/APPservice";
public static final String SERVICE_NAME_URL_PATH = "/ws";
@Autowired
private ApplicationContext applicationContext;
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public ServletRegistrationBean dispatcherServlet() {
return new ServletRegistrationBean(new CXFServlet(), SERVLET_MAPPING_URL_PATH + "/*");
}
@Bean(name = Bus.DEFAULT_BUS_ID)
/* <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus">*/
public SpringBus springBus() {
return new SpringBus();
}
@Bean
/* <jaxws:endpoint id="app" implementor="com.dlizarra.app.ws.AppImpl" address="/app">*/
public Endpoint ws() {
//Bus bus = (Bus) applicationContext.getBean(Bus.DEFAULT_BUS_ID);
Object implementor = new CompServiceEndPoindImpl();
EndpointImpl endpoint = new EndpointImpl(springBus(), implementor);
endpoint.publish(SERVICE_NAME_URL_PATH);
endpoint.setWsdlLocation("CompService.wsdl");
/*endpoint.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
endpoint.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());*/
return endpoint;
}
}
我搜索了整个 Internet 以找到解决方案,但没有成功。你能帮我解决这个异常吗?
完整的堆栈跟踪在这里:full stack trace
最佳答案
当您的服务返回的对象没有空构造函数时,可能会发生此错误。
只需确保您所有的 dto 都是空构造函数。
关于java - 如何修复 javax.xml.ws.WebServiceException : java. lang.NullPointerException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35309022/
我之前已经使用以下完全相同的代码片段成功注册了一个模型: #register model from azureml.core.model import Model register_model = M
我创建了一个使用 Web 服务来登录、注册、添加和编辑客户的应用程序。当我在部署 Web 服务后运行应用程序时,它会在应用程序的控制台中抛出一个名为 webServiceException 的异常。这
我目前在使用 Websphere 7.0.0.27 和使用 org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean 的特定 Web 服
我正在尝试使用 jax-ws 进行动态 WS 调用。 但是我无法创建调度程序,代码是: String namespace= "http://wsf.cdyne.com/WeatherWS/Weathe
我迫切需要帮助来弄清楚为什么我的应用程序没有创建网络服务。 这是我的网络服务 Java 类: @WebService @Component public class LoginWs ext
我有一个类似这样的 Controller 方法: public class FooController : Controller { private IApi api; public
我做了一个 SOAP 客户端,我收到了下一个答案: javax.xml.ws.WebServiceException: no response returned. at com.sun.xml
我希望使用 Travelport Universal API 来开发航类预订系统,因此我使用了此 Travelport 开发人员官方链接作为引用: Getting Started for Travel
在我的 ServiceStack 服务中,我抛出了一个具有内部异常的异常。当我在客户端捕获 WebServiceRequest 时,ErrorCode 是内部异常类型名称。 这对我不利,因为它不允许我
我在调用 SOAP Web 服务时收到以下错误 Caused by: javax.xml.ws.WebServiceException: Could not find service named {h
我有已注入(inject)服务的 REST 端点。 @Singleton @Path("/v1/service") public class MyService { @Inject p
我有 3 个使用 netbean 6.9 创建的 Web 服务 当我在工作时在我的电脑上工作时,它运行顺利,没有错误。但是,当我将 netbean 项目复制到家中的计算机时,它运行时出现错误,如下所示
我正在使用 JAX-WS RI 与第三方 Web 服务 (Adyen) 集成。我已经下载了他们的 wsdl 副本,并在我的构建中使用了 jaxws:wsdl2java 来生成 Web 服务实现源代码。
在 java 文件中导入 javax.xml.ws.WebServiceException; 时,出现编译错误 cannot resolve symbol ws. 我已经清理并安装了 POM.xml
我正在使用 JAX-WS RI 与第三方 Web 服务 (Adyen) 集成。我已经下载了他们的 wsdl 副本,并在我的构建中使用了 jaxws:wsdl2java 来生成 Web 服务实现源代码。
我在使用 Apache CXF 生成的类 (wsdl2java) 访问 Web 服务时遇到问题。 一切正常,直到网络服务提供商突然更改了他们防火墙上的规则并关闭了我们。他们说的是他们不再允许 http
我有一个 wsdl 文件,很多 xsd 文件,jxb 绑定(bind)文件。我使用 Apache CXF cxf-codegen-plugin 创建了一个 Web 服务客户端。 Java 类的创建没有
我正在运行 Spring Boot 应用程序 (mvn:spring-boot:run) 并获取下一个堆栈跟踪: \\/ ___)| |_)| | | | | || (_| | ) ) ) )
我正在创建 Jersey Web 服务,我发现自己使用了上述两种异常类型。 WebServiceException 的构造函数允许您传递一个 String 作为原因,而 WebApplicationE
我使用 CXF 开发了网络服务。今天我为 Web 服务添加了简单的用户名 token 安全性。之后,当我尝试部署 Web 服务时出现以下异常 javax.xml.ws.WebServiceExcept
我是一名优秀的程序员,十分优秀!