2016-06-24 70 views
3

WAS 8.5サーバーにJAX-WS Webサービスをデプロイしました。このアプリを起動すると、次のエラー与えながら: - 以下Websphere 8.5にWebアプリケーションをデプロイする際のJerseyServletContainerInitializerのnullPointerException

com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: null 
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432) 
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718) 
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175) 
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370) 
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639) 


Caused by: java.lang.NullPointerException 
at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.mappingExists(JerseyServletContainerInitializer.java:331) 
at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.addServletWithApplication(JerseyServletContainerInitializer.java:272) 
at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartupImpl(JerseyServletContainerInitializer.java:176) 
at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:143) 
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613) 
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409) 
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88) 
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169) 
... 101 more 

をweb.xmlのである: -

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd 「>

<display-name>My Event</display-name> 
<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>WEB-INF/applicationContext.xml 
     WEB-INF/classes/configs/*.xml 
    </param-value> 
</context-param> 
<!--<context-param> 
    <param-name>contextClass</param-name> 
    <param-value>com.javaetmoi.core.spring.JBoss5XmlWebApplicationContext</param-value> 
</context-param>--> 
<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener 
    </listener-class> 
</listener> 
<servlet> 
    <servlet-name>jerseyServlet</servlet-name> 
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer 
    </servlet-class> 
    <init-param> 
     <param-name>javax.ws.rs.Application</param-name> 
     <param-value>com.myapp.event.ws.JerseyConfig</param-value> 
    </init-param> 

    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>jerseyServlet</servlet-name> 
    <url-pattern>/*</url-pattern> 
</servlet-mapping> 

私は、問題を引き起こしているものを見つけることができません。

+0

[NullPointerExceptionとは何か、それを修正する方法は?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i) -fix-it) – Jens

+1

[Websphere 8で[JAX-RS Jersey 2.10のサポート]の可能な複製](http://stackoverflow.com/questions/24684958/jax-rs-jersey-2-10-support-in-websphere-8 ) – Gas

+1

@Jensユーザーが制御していないライブラリでNullPointerExceptionが発生しているため、推奨される複製が不適切です。 –

答えて

1

にですWebsphereのバグ。 IBM実装のjavax.servlet.ServletRegistration.getMappings()nullです。これは無効です。空のコレクションを返す必要があります。 https://java.net/jira/browse/JERSEY-2706

Websphere-Fixがありますが、を有効にしてにする必要があります。あなたがtrueにWebコンテナのカスタムプロパティcom.ibm.ws.webcontainer.emptyServletMappingsを設定する必要が

A new WebContainer custom property needs to be set to enable the behavior provided by this APAR:

http://www-01.ibm.com/support/docview.wss?uid=swg1PI23529

http://www-01.ibm.com/support/docview.wss?rss=180&uid=swg21284395

関連する問題