WebSphere web.xml / 绑定问题

发布于 2024-09-10 08:52:08 字数 10086 浏览 2 评论 0原文

我最近在 websphere 中部署 EARS 时开始遇到问题。下面提供了我安装应用程序后遇到的错误。

------Start of DE processing------ = [7/18/10 10:51:19:309 CDT] , key = javax.management.MBeanException com.ibm.ws.management.AdminServiceImpl.invoke 679
Exception = javax.management.MBeanException
Source = com.ibm.ws.management.AdminServiceImpl.invoke
probeid = 679
Stack Dump = javax.management.MBeanException: Exception thrown in RequiredModelMBean while trying to invoke operation startApplication
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1119)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:973)
...
...
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.NullPointerException
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:955)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1437)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4191)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4289)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1442)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
...
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:271)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1092)
... 64 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:884)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
... 79 more
Caused by: java.lang.NullPointerException
at com.ibm.ws.wswebcontainer.webapp.WebAppConfigurationHelper.constructServletMappings(WebAppConfigurationHelper.java:406)
at com.ibm.ws.wswebcontainer.webapp.WebAppConfigurationHelper.createConfiguration(WebAppConfigurationHelper.java:148)
at com.ibm.ws.webcontainer.metadata.WebMetaDataFactory.createMetaData(WebMetaDataFactory.java:180)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaDataFromFactories(MetaDataMgrImpl.java:172)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaData(MetaDataMgrImpl.java:306)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:581)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:834)
... 80 more

Dump of callerThis = 
Object type = com.ibm.ws.management.AdminServiceImpl$1
com.ibm.ws.management.AdminServiceImpl$1@60726072
parm[0] =     WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=cc503216Node02,version=6.1.0.29,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=cc503216Node02Cell,spec=1.0
==> Performing default dump from com.ibm.ws.management.dm.JmxDM  = Sun Jul 18 10:51:19 CDT 2010
Dump of callerThis = 
Object type = com.ibm.ws.management.AdminServiceImpl$1
val$origName = 
oldSerialVersionUID = -5467795090068647408
newSerialVersionUID = 1081892073854801359
oldSerialPersistentFields = [Ljava.io.ObjectStreamField;@7b127b12
newSerialPersistentFields = {}
serialVersionUID = 1081892073854801359
serialPersistentFields = this.val$origName.newSerialPersistentFields
compat = false
_Empty_property_array = {}
_EmptyPropertyList = java.util.Hashtable@7e287e28
_canonicalName = WebSphere:cell=cc503216Node02Cell,mbeanIdentifier=ApplicationManager,name=ApplicationManager,node=cc503216Node02,platform=proxy,process=server1,spec=1.0,type=ApplicationManager,version=6.1.0.29
_kp_array = [Ljavax.management.ObjectName$Property;@57a257a2
_ca_array = [Ljavax.management.ObjectName$Property;@57be57be
_domain_length = 9
_propertyList = java.util.Hashtable@60846084
_domain_pattern = false
_property_pattern = false
val$operationName = startApplication
val$params = 
[0] = CommercialWSIntegration
val$signature = 
[0] = java.lang.String
  this$0 = com.ibm.ws.management.AdminServiceImpl@9bc09bc

+Data for directive [defaultjmx] obtained. = 
==> Dump complete for com.ibm.ws.management.dm.JmxDM  = Sun Jul 18 10:51:19 CDT 2010

我相信这与 web.xml 中的资源绑定有关,但我不确定。我尚未创建 ibm 专有绑定文件并将其包含在 EAR 中,但希望将其作为部署过程的一部分来完成。为了实现这一目标,我尝试告诉它生成新的绑定,同时覆盖现有的绑定以及绑定设置的其他组合,但我似乎总是收到上面的错误。我在下面提供了我的 web.xml。你能找出任何看起来不对劲的地方吗?我尝试删除 resources-ref 元素的 id 属性,但这似乎没有帮助。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>
    CommercialWSIntegrationWARProject
</display-name>
<context-param>
    <param-name>
        log4jConfigLocation
    </param-name>
    <param-value>
        /WEB-INF/log4j.xml
    </param-value>
</context-param>


<!-- Reads request input using UTF-8 encoding -->
<filter>
    <filter-name>
        characterEncodingFilter
    </filter-name>
    <filter-class>
        org.springframework.web.filter.CharacterEncodingFilter
    </filter-class>
    <init-param>
        <param-name>
            encoding
        </param-name>
        <param-value>
            UTF-8
        </param-value>
    </init-param>
    <init-param>
        <param-name>
            forceEncoding
        </param-name>
        <param-value>
            true
        </param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>
        characterEncodingFilter
    </filter-name>
    <url-pattern>
        /*
    </url-pattern>
</filter-mapping>

<listener>
    <listener-class>
        org.springframework.web.util.Log4jConfigListener
    </listener-class>
</listener>

<servlet>
    <description>
    </description>
    <display-name>
        CommercialPDInitServlett
    </display-name>
    <servlet-name>
        CommercialPDInitServlett
    </servlet-name>
    <servlet-class>
        com.inscompany.cqp.integration.CommercialPDInitServlett
    </servlet-class>
    <load-on-startup>
        -1
    </load-on-startup>
</servlet>

<servlet>
    <servlet-name>
        Spring MVC Dispatcher Servlet
    </servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
        <param-name>
            contextConfigLocation
        </param-name>
        <param-value>
            /WEB-INF/spring/app-config.xml
        </param-value>
    </init-param>
    <load-on-startup>
        1
    </load-on-startup>
</servlet>


<servlet-mapping>
    <servlet-name>
        default
    </servlet-name>
    <url-pattern>
        /css/*.css
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        default
    </servlet-name>
    <url-pattern>
        /js/*.js
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        CommercialPDInitServlett
    </servlet-name>
    <url-pattern>
        /Initialize
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        Spring MVC Dispatcher Servlet
    </servlet-name>
    <url-pattern>
        /rest/*
    </url-pattern>
</servlet-mapping>

<resource-ref id="ResourceRef_1191955667160">
    <description>
    </description>
    <res-ref-name>
        url/pdProps
    </res-ref-name>
    <res-type>
        java.net.URL
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>url/pdProps</mapped-name>
</resource-ref>

<resource-ref id="ResourceRef_1191957500691">
    <description>
    </description>
    <res-ref-name>
        jdbc/CCDB2
    </res-ref-name>
    <res-type>
        javax.sql.DataSource
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jdbc/CCDB2</mapped-name>
</resource-ref>
<resource-ref id="ResourceRef_1271699412761">
    <description>
    </description>
    <res-ref-name>
        jms/QMGR
    </res-ref-name>
    <res-type>
        javax.jms.ConnectionFactory
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jms/QMGR</mapped-name>
</resource-ref>
<resource-ref id="ResourceRef_1271699443228">
    <description>
    </description>
    <res-ref-name>
        jms/SVC.MDB.APP
    </res-ref-name>
    <res-type>
        javax.jms.Queue
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jms/SVC.MDB.APP</mapped-name>
</resource-ref> 
</web-app>

非常感谢您的帮助。 杰里米

I just recently started having issues while deploying EARS within websphere. The error I get after I install the apps is provided below.

------Start of DE processing------ = [7/18/10 10:51:19:309 CDT] , key = javax.management.MBeanException com.ibm.ws.management.AdminServiceImpl.invoke 679
Exception = javax.management.MBeanException
Source = com.ibm.ws.management.AdminServiceImpl.invoke
probeid = 679
Stack Dump = javax.management.MBeanException: Exception thrown in RequiredModelMBean while trying to invoke operation startApplication
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1119)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:973)
...
...
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.NullPointerException
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:955)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1437)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4191)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4289)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1442)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
...
...
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:271)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1092)
... 64 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:884)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
... 79 more
Caused by: java.lang.NullPointerException
at com.ibm.ws.wswebcontainer.webapp.WebAppConfigurationHelper.constructServletMappings(WebAppConfigurationHelper.java:406)
at com.ibm.ws.wswebcontainer.webapp.WebAppConfigurationHelper.createConfiguration(WebAppConfigurationHelper.java:148)
at com.ibm.ws.webcontainer.metadata.WebMetaDataFactory.createMetaData(WebMetaDataFactory.java:180)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaDataFromFactories(MetaDataMgrImpl.java:172)
at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaData(MetaDataMgrImpl.java:306)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:581)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:834)
... 80 more

Dump of callerThis = 
Object type = com.ibm.ws.management.AdminServiceImpl$1
com.ibm.ws.management.AdminServiceImpl$1@60726072
parm[0] =     WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=cc503216Node02,version=6.1.0.29,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=cc503216Node02Cell,spec=1.0
==> Performing default dump from com.ibm.ws.management.dm.JmxDM  = Sun Jul 18 10:51:19 CDT 2010
Dump of callerThis = 
Object type = com.ibm.ws.management.AdminServiceImpl$1
val$origName = 
oldSerialVersionUID = -5467795090068647408
newSerialVersionUID = 1081892073854801359
oldSerialPersistentFields = [Ljava.io.ObjectStreamField;@7b127b12
newSerialPersistentFields = {}
serialVersionUID = 1081892073854801359
serialPersistentFields = this.val$origName.newSerialPersistentFields
compat = false
_Empty_property_array = {}
_EmptyPropertyList = java.util.Hashtable@7e287e28
_canonicalName = WebSphere:cell=cc503216Node02Cell,mbeanIdentifier=ApplicationManager,name=ApplicationManager,node=cc503216Node02,platform=proxy,process=server1,spec=1.0,type=ApplicationManager,version=6.1.0.29
_kp_array = [Ljavax.management.ObjectName$Property;@57a257a2
_ca_array = [Ljavax.management.ObjectName$Property;@57be57be
_domain_length = 9
_propertyList = java.util.Hashtable@60846084
_domain_pattern = false
_property_pattern = false
val$operationName = startApplication
val$params = 
[0] = CommercialWSIntegration
val$signature = 
[0] = java.lang.String
  this$0 = com.ibm.ws.management.AdminServiceImpl@9bc09bc

+Data for directive [defaultjmx] obtained. = 
==> Dump complete for com.ibm.ws.management.dm.JmxDM  = Sun Jul 18 10:51:19 CDT 2010

I believe this has something to do with the resource bindings within the web.xml, but I'm not sure. I have not created the ibm proprietary binding files and included those in the EAR, but rather am expecting that to be done as part of the deployment process. In order to accomplish that I have tried telling it to generate new bindings while overwriting the existing ones, and other combination of bindings settings, but I always seem to get the error above. I have provided my web.xml below. Can you identify anything that looks wrong? I have tried removing the id attribute for the resource-ref elements, but that didn't seem to help.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>
    CommercialWSIntegrationWARProject
</display-name>
<context-param>
    <param-name>
        log4jConfigLocation
    </param-name>
    <param-value>
        /WEB-INF/log4j.xml
    </param-value>
</context-param>


<!-- Reads request input using UTF-8 encoding -->
<filter>
    <filter-name>
        characterEncodingFilter
    </filter-name>
    <filter-class>
        org.springframework.web.filter.CharacterEncodingFilter
    </filter-class>
    <init-param>
        <param-name>
            encoding
        </param-name>
        <param-value>
            UTF-8
        </param-value>
    </init-param>
    <init-param>
        <param-name>
            forceEncoding
        </param-name>
        <param-value>
            true
        </param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>
        characterEncodingFilter
    </filter-name>
    <url-pattern>
        /*
    </url-pattern>
</filter-mapping>

<listener>
    <listener-class>
        org.springframework.web.util.Log4jConfigListener
    </listener-class>
</listener>

<servlet>
    <description>
    </description>
    <display-name>
        CommercialPDInitServlett
    </display-name>
    <servlet-name>
        CommercialPDInitServlett
    </servlet-name>
    <servlet-class>
        com.inscompany.cqp.integration.CommercialPDInitServlett
    </servlet-class>
    <load-on-startup>
        -1
    </load-on-startup>
</servlet>

<servlet>
    <servlet-name>
        Spring MVC Dispatcher Servlet
    </servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
        <param-name>
            contextConfigLocation
        </param-name>
        <param-value>
            /WEB-INF/spring/app-config.xml
        </param-value>
    </init-param>
    <load-on-startup>
        1
    </load-on-startup>
</servlet>


<servlet-mapping>
    <servlet-name>
        default
    </servlet-name>
    <url-pattern>
        /css/*.css
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        default
    </servlet-name>
    <url-pattern>
        /js/*.js
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        CommercialPDInitServlett
    </servlet-name>
    <url-pattern>
        /Initialize
    </url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>
        Spring MVC Dispatcher Servlet
    </servlet-name>
    <url-pattern>
        /rest/*
    </url-pattern>
</servlet-mapping>

<resource-ref id="ResourceRef_1191955667160">
    <description>
    </description>
    <res-ref-name>
        url/pdProps
    </res-ref-name>
    <res-type>
        java.net.URL
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>url/pdProps</mapped-name>
</resource-ref>

<resource-ref id="ResourceRef_1191957500691">
    <description>
    </description>
    <res-ref-name>
        jdbc/CCDB2
    </res-ref-name>
    <res-type>
        javax.sql.DataSource
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jdbc/CCDB2</mapped-name>
</resource-ref>
<resource-ref id="ResourceRef_1271699412761">
    <description>
    </description>
    <res-ref-name>
        jms/QMGR
    </res-ref-name>
    <res-type>
        javax.jms.ConnectionFactory
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jms/QMGR</mapped-name>
</resource-ref>
<resource-ref id="ResourceRef_1271699443228">
    <description>
    </description>
    <res-ref-name>
        jms/SVC.MDB.APP
    </res-ref-name>
    <res-type>
        javax.jms.Queue
    </res-type>
    <res-auth>
        Container
    </res-auth>
    <res-sharing-scope>
        Shareable
    </res-sharing-scope>
    <mapped-name>jms/SVC.MDB.APP</mapped-name>
</resource-ref> 
</web-app>

Thank you very much for your assistance.
Jeremy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

山有枢 2024-09-17 08:52:08

该问题是由两个具有相同名称的不同 servlet 引起的。一旦我取出下面提供的物品,我就能够再次成功启动应用程序。

<servlet-mapping> 
  <servlet-name> 
    default 
  </servlet-name> 
  <url-pattern> 
    /css/*.css 
  </url-pattern> 
</servlet-mapping> 

<servlet-mapping> 
  <servlet-name> 
    default 
  </servlet-name> 
  <url-pattern> 
    /js/*.js 
  </url-pattern> 
</servlet-mapping> 

我希望这可以帮助其他人。

The problem was caused by having two different servlets with the same name. Once I took out the items provided below I was able to start the application successfully again.

<servlet-mapping> 
  <servlet-name> 
    default 
  </servlet-name> 
  <url-pattern> 
    /css/*.css 
  </url-pattern> 
</servlet-mapping> 

<servlet-mapping> 
  <servlet-name> 
    default 
  </servlet-name> 
  <url-pattern> 
    /js/*.js 
  </url-pattern> 
</servlet-mapping> 

I hope this helps others out.

红玫瑰 2024-09-17 08:52:08

检查您是否要安装已在 WAS 中安装的相同耳朵(具有不同名称)。

对于上述问题,我遇到了类似的异常

Check if you are going to install the same ear (with different name) which already installed in WAS.

I was getting a similar exception for the above issue

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文