微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 openliberty 上启用和运行 sipservlets pom.xml 编译依赖server.xml 功能配置注意事项进一步阅读旧文档

如何解决在 openliberty 上启用和运行 sipservlets pom.xml 编译依赖server.xml 功能配置注意事项进一步阅读旧文档

我正在考虑使用 openliberty,因为您似乎支持 sipservlet 模块。

查看您的文档,它仅在参考部分中描述,没有提供任何使用示例。

假设它遵循标准,我尝试运行一个简单的示例。

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.sip.*;

public class SimpleSIPServlet extends SipServlet {
    protected void doMessage(SipServletRequest req)
            throws servletexception,IOException
    {
        SipServletResponse res = req.createResponse(200);
        res.send();
    }
}

不过基本导入javax.servlet.sip.*;因无法解决而失败。

将它作为一个特性添加到 server.xml 但仍然忽略它,所以按照最后的说明将它添加一个特性清单文件,但它没有说明如何做到这一点或把它放在哪里。 尝试将其添加到 target/liberty/wlp/lib/features/com.ibm.websphere.appserver.servlet-3.1.mf 但再次收效甚微。

参考文献没有提到向 pom 添加任何内容,因此不确定这是如何引入的。

如何启用此功能,是否有使用示例?

这是问题的跟踪日志

*******************************************************************************
product = Open Liberty 21.0.0.4 (wlp-1.0.51.cl210420210407-0944)
wlp.install.dir = /home/sysadmin/src-ccmnext/guide-getting-started/start/target/liberty/wlp/
java.home = /usr/lib/jvm/java-11-openjdk-amd64
java.version = 11.0.10
java.runtime = OpenJDK Runtime Environment (11.0.10+9-Ubuntu-0ubuntu1.18.04)
os = Linux (4.15.0-136-generic; amd64) (en_US)
process = 27080@u18dev
trace.specification = *=info:com.ibm.ws.sip.container.parser.*=all
********************************************************************************
[4/27/21,16:24:04:986 UTC] 0000001c id=00000000 com.ibm.ws.logging.internal.TraceSpecification               I TRAS0018I: The trace state has been changed. The new trace state is *=info:com.ibm.ws.sip.container.parser.*=all.
[4/27/21,16:24:05:577 UTC] 00000001 id=00000000 com.ibm.ws.kernel.launch.internal.FrameworkManager           I CWWKE0002I: The kernel started after 3.845 seconds
[4/27/21,16:24:05:665 UTC] 00000020 id=00000000 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0007I: Feature update started.
[4/27/21,16:24:08:010 UTC] 00000016 id=00000000 .apache.cxf.cxf.core.3.2:1.0.51.cl210420210407-0944(id=185)] I Aries Blueprint packages not available. So namespaces will not be registered
[4/27/21,16:24:08:363 UTC] 00000014 id=00000000 com.ibm.ws.security.ready.internal.SecurityReadyServiceImpl  I CWWKS0007I: The security service is starting...
[4/27/21,16:24:08:874 UTC] 00000015 id=00000000 com.ibm.ws.app.manager.internal.monitor.DropinMonitor        A CWWKZ0058I: Monitoring dropins for applications.
[4/27/21,16:24:09:827 UTC] 00000018 id=00000000 com.ibm.ws.cache.ServerCache                                 I DYNA1001I: WebSphere Dynamic Cache instance named baseCache initialized successfully.
[4/27/21,16:24:09:832 UTC] 00000018 id=00000000 com.ibm.ws.cache.ServerCache                                 I DYNA1071I: The cache provider default is being used.
[4/27/21,16:24:09:834 UTC] 00000018 id=00000000 com.ibm.ws.cache.CacheServiceImpl                            I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[4/27/21,16:24:12:073 UTC] 00000014 id=00000000 ibm.ws.security.authentication.internal.jaas.JAASServiceImpl I CWWKS1123I: The collective authentication plugin with class name NullCollectiveAuthenticationPlugin has been activated. 
[4/27/21,16:24:12:132 UTC] 00000025 id=00000000 com.ibm.ws.security.token.ltpa.internal.LTPAKeyCreateTask    I CWWKS4105I: LTPA configuration is ready after 0.170 seconds.
[4/27/21,16:24:14:339 UTC] 0000001c id=00000000 com.ibm.ws.ssl.config.WSKeyStore                             A cwpKI0820A: The default keystore has been created using the 'keystore_password' environment variable.
[4/27/21,16:24:14:764 UTC] 0000001c id=00000000 com.ibm.ws.ssl.config.WSKeyStore                             I Successfully loaded default keystore: /home/sysadmin/src-ccmnext/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer/resources/security/key.p12 of type: PKCS12
[4/27/21,16:24:14:965 UTC] 00000014 id=00000000 SessionMgrComponentImpl                                      I initialize SESN8501I: The session manager did not find a persistent storage location; HttpSession objects will be stored in the local application server's memory.
[4/27/21,16:24:15:322 UTC] 00000014 id=00000000 SystemOut                                                    O SipContainerMBean activated
[4/27/21,16:24:15:335 UTC] 00000014 id=00000000 om.ibm.ws.microprofile.metrics.monitor.MonitorMetricsHandler I cwpMI2003I: Monitoring metrics can be retrieved through mpMetrics.
[4/27/21,16:24:16:419 UTC] 00000024 id=00000000 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application guide-getting-started.
[4/27/21,16:24:16:424 UTC] 00000024 id=00000000 bm.ws.app.manager.war.internal.WARDeployedAppInfoFactoryImpl I CWWKZ0134I: The guide-getting-started application is using the loose application deFinition at the /home/sysadmin/src-ccmnext/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer/apps/guide-getting-started.war.xml location.
[4/27/21,16:24:17:072 UTC] 00000025 id=00000000 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: PublicMicroProfileMetrics.
[4/27/21,16:24:17:066 UTC] 00000027 id=00000000 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: health.
[4/27/21,16:24:17:073 UTC] 00000021 id=00000000 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: ibm/api.
[4/27/21,16:24:17:074 UTC] 00000027 id=00000000 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost              I addWebApplication SRVE0250I: Web Module health has been bound to default_host.
[4/27/21,16:24:17:076 UTC] 00000021 id=00000000 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost              I addWebApplication SRVE0250I: Web Module ibm/api has been bound to default_host.
[4/27/21,16:24:17:074 UTC] 00000025 id=00000000 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost              I addWebApplication SRVE0250I: Web Module PublicMicroProfileMetrics has been bound to default_host.
[4/27/21,16:24:17:085 UTC] 00000027 id=00000000 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://u18dev:9080/health/
[4/27/21,16:24:17:089 UTC] 00000025 id=00000000 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://u18dev:9080/metrics/
[4/27/21,16:24:17:096 UTC] 00000021 id=00000000 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://u18dev:9080/ibm/api/
[4/27/21,16:24:17:166 UTC] 00000024 id=00000000 com.ibm.ws.sip.stack.transaction.SIPTransactionStack         I CWSCT0321I: SIP stack init configuration
[4/27/21,16:24:17:299 UTC] 00000024 id=00000000 com.ibm.ws.sip.stack.transaction.SIPTransactionStack         I CWSCT0322I: SIP stack init transport.
[4/27/21,16:24:17:302 UTC] 00000024 id=00000000 com.ibm.ws.sip.stack.transaction.SIPTransactionStack         I CWSCT0323I: SIP stack init finished.
[4/27/21,16:24:17:359 UTC] 00000022 id=00000000 SessionContextRegistryImpl                                   I getSessionContext SESN0176I: A new session context will be created for application key default_host/metrics
[4/27/21,16:24:17:359 UTC] 00000026 id=00000000 SessionContextRegistryImpl                                   I getSessionContext SESN0176I: A new session context will be created for application key default_host/ibm/api
[4/27/21,16:24:17:357 UTC] 00000023 id=00000000 SessionContextRegistryImpl                                   I getSessionContext SESN0176I: A new session context will be created for application key default_host/health
[4/27/21,16:24:17:426 UTC] 00000021 id=00000000 m.ibm.ws.sip.stack.transaction.transport.SIPConnectionsModel I CWSCT0328I: SIP starting to listen on sip:u18dev:5060;udp.
[4/27/21,16:24:17:427 UTC] 00000021 id=00000000 com.ibm.ws.sip.container.protocol.SipProtocolLayer           I CWSCT0028I: SIP Container Listening Point u18dev:5,060/udp
[4/27/21,16:24:17:522 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.SipContainer                        I CWSCT0001I: SIP Container initialization completed.
[4/27/21,16:24:17:523 UTC] 00000022 id=00000000 IDGeneratorImpl                                              I IDGeneratorImpl SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[4/27/21,16:24:17:523 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.SipContainer                        I CWSCT0002I: SIP Container Version: 8.0
[4/27/21,16:24:17:527 UTC] 00000021 id=00000000 com.ibm.ws.udpchannel.internal.UDPChannel                    I CWWKO0400I: UDP Channel UDP_InboundUDPChain_defaultSipEndpoint is listening on host *  (IPv4) port 5060.
[4/27/21,16:24:17:545 UTC] 00000023 id=00000000 IDGeneratorImpl                                              I IDGeneratorImpl SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[4/27/21,16:24:17:554 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 setDescription  description = 
[4/27/21,16:24:17:557 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 Setting main siplet: SimpleSIPServlet for applciation: SemafonesSRGateway old name: null
[4/27/21,16:24:17:562 UTC] 00000021 id=00000000 m.ibm.ws.sip.stack.transaction.transport.SIPConnectionsModel I CWSCT0328I: SIP starting to listen on sip:u18dev:5060;tcp.
[4/27/21,16:24:17:562 UTC] 00000021 id=00000000 com.ibm.ws.sip.container.protocol.SipProtocolLayer           I CWSCT0028I: SIP Container Listening Point u18dev:5,060/tcp
[4/27/21,16:24:17:567 UTC] 00000026 id=00000000 IDGeneratorImpl                                              I IDGeneratorImpl SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[4/27/21,16:24:17:589 UTC] 00000021 id=00000000 m.ibm.ws.sip.stack.transaction.transport.SIPConnectionsModel I CWSCT0328I: SIP starting to listen on sips:u18dev:5061;tls.
[4/27/21,16:24:17:590 UTC] 00000021 id=00000000 com.ibm.ws.sip.container.protocol.SipProtocolLayer           I CWSCT0028I: SIP Container Listening Point u18dev:5,061/tls
[4/27/21,16:24:17:601 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 Setting main siplet: SimpleSIPServlet for applciation: SemafonesSRGateway old name: SimpleSIPServlet
[4/27/21,16:24:17:601 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 addSipServlets  addSipServlet - getRootURI = null
[4/27/21,16:24:17:602 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true
[4/27/21,16:24:17:827 UTC] 00000023 id=00000000 com.ibm.ws.cache.CacheServiceImpl                            I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[4/27/21,16:24:17:945 UTC] 00000023 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               I init SRVE0242I: [com.ibm.ws.microprofile.health.2.0] [/health] [HealthCheckReadinessServlet]: Initialization successful.
[4/27/21,16:24:17:953 UTC] 00000023 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               I init SRVE0242I: [com.ibm.ws.microprofile.health.2.0] [/health] [HealthCheckServlet]: Initialization successful.
[4/27/21,16:24:17:955 UTC] 00000023 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               I init SRVE0242I: [com.ibm.ws.microprofile.health.2.0] [/health] [HealthCheckLivenessServlet]: Initialization successful.
[4/27/21,16:24:18:003 UTC] 00000024 id=00000000 org.jboss.weld.bootstrap.WeldStartup                         I <clinit> WELD-000900: 3.1.4 (Final)
[4/27/21,16:24:18:159 UTC] 00000022 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               I init SRVE0242I: [com.ibm.ws.microprofile.metrics.public] [/metrics] [PublicmetricsRESTProxyServlet]: Initialization successful.
[4/27/21,16:24:18:202 UTC] 00000027 id=00000000 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /home/sysadmin/src-ccmnext/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer/logs/state/plugin-cfg.xml.
[4/27/21,16:24:19:723 UTC] 00000024 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 setWebApp   setWebApp = com.ibm.ws.webcontainer40.osgi.webapp.WebApp40@2cd3b769[guide-getting-started#guide-getting-started.war]
[4/27/21,16:24:19:725 UTC] 00000024 id=00000000 com.ibm.ws.webcontainer.osgi.webapp.WebGroup                 I SRVE0169I: Loading Web Module: Liberty Project.
[4/27/21,16:24:19:725 UTC] 00000024 id=00000000 com.ibm.ws.webcontainer.osgi.DynamicVirtualHost              I addWebApplication SRVE0250I: Web Module Liberty Project has been bound to default_host.
[4/27/21,16:24:19:726 UTC] 00000024 id=00000000 com.ibm.ws.http.internal.VirtualHostImpl                     A CWWKT0016I: Web application available (default_host): http://u18dev:9080/
[4/27/21,16:24:19:731 UTC] 00000025 id=00000000 SessionContextRegistryImpl                                   I getSessionContext SESN0176I: A new session context will be created for application key default_host/
[4/27/21,16:24:19:732 UTC] 00000025 id=00000000 IDGeneratorImpl                                              I IDGeneratorImpl SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[4/27/21,16:24:19:755 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 setIsDuringWebAppInitialization  isDuringWebAppInitialization = true
[4/27/21,16:24:19:755 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 setWasInitialized  wasInitialized = true
[4/27/21,16:24:19:856 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 ServletsInstanceHolder  ServletsInstanceHolder constructor
[4/27/21,16:24:19:860 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.appqueue.Messagedispatcher          I CWSCT0433I: SIP Container queues stats print mode= 0 . 1 = only when overloaded,2 = always. once every 1,000 msec.
[4/27/21,16:24:19:897 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 setRootURI  /
[4/27/21,16:24:19:897 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   > setIsdistributed Entry  
                                                                                                               false
[4/27/21,16:24:19:899 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   > setApplicationKeyMethod,@SipApplicationKey not defined Entry 
[4/27/21,16:24:19:920 UTC] 00000022 id=00000000 com.ibm.ws.webcontainer.osgi.mbeans.PluginGenerator          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /home/sysadmin/src-ccmnext/guide-getting-started/start/target/liberty/wlp/usr/servers/defaultServer/logs/state/plugin-cfg.xml.
[4/27/21,16:24:19:926 UTC] 00000025 id=00000000 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application guide-getting-started started in 3.507 seconds.
[4/27/21,16:24:19:984 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.servlets.SipSessionsUtilImpl        E Error retrieving application descriptor for application name: Liberty Project
[4/27/21,16:24:19:989 UTC] 00000025 id=00000000 SystemOut                                                    O Init SIP Servlet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[4/27/21,16:24:19:995 UTC] 00000025 id=00000000 SystemOut                                                    O SIP Factory set.
[4/27/21,16:24:19:996 UTC] 00000025 id=00000000 SystemOut                                                    O init. OutboundInterfaceList:
[4/27/21,16:24:20:004 UTC] 00000025 id=00000000 SystemOut                                                    O     OutboundInterface:sip:u18dev:5060;transport=udp
[4/27/21,16:24:20:006 UTC] 00000025 id=00000000 SystemOut                                                    O     OutboundInterface:sip:u18dev:5060;transport=tcp
[4/27/21,16:24:20:008 UTC] 00000025 id=00000000 SystemOut                                                    O     OutboundInterface:sip:u18dev:5060;transport=tcp
[4/27/21,16:24:20:009 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 addSipletInstance  appName[Liberty Project] class[io.openliberty.sample.system.SimpleSIPServlet] instance[io.openliberty.sample.system.SimpleSIPServlet@64fd8a6a]
[4/27/21,16:24:20:009 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 addSipletInstance  found sipAppDesc [null]
[4/27/21,16:24:20:059 UTC] 00000020 id=00000000 com.ibm.ws.tcpchannel.internal.TCPPort                       I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is Now listening for requests on host *  (IPv6) port 9080.
[4/27/21,16:24:20:064 UTC] 00000020 id=00000000 com.ibm.ws.tcpchannel.internal.TCPPort                       I CWWKO0219I: TCP Channel defaultHttpEndpoint-ssl has been started and is Now listening for requests on host *  (IPv6) port 9443.
[4/27/21,16:24:20:065 UTC] 00000020 id=00000000 com.ibm.ws.tcpchannel.internal.TCPPort                       I CWWKO0219I: TCP Channel TCP_InboundTCPChain_defaultSipEndpoint has been started and is Now listening for requests on host *  (IPv6) port 5060.
[4/27/21,16:24:20:066 UTC] 00000020 id=00000000 com.ibm.ws.tcpchannel.internal.TCPPort                       I CWWKO0219I: TCP Channel TCP-ssl_InboundTLSChain_defaultSipEndpoint has been started and is Now listening for requests on host *  (IPv6) port 5061.
[4/27/21,16:24:20:089 UTC] 00000020 id=00000000 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [cdi-2.0,distributedMap-1.0,jaxrs-2.1,jaxrsClient-2.1,jndi-1.0,json-1.0,jsonp-1.1,monitor-1.0,mpConfig-1.4,mpHealth-2.2,mpMetrics-2.3,servlet-4.0,sipServlet-1.1,ssl-1.0].
[4/27/21,16:24:20:090 UTC] 00000020 id=00000000 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 14.511 seconds.
[4/27/21,16:24:20:090 UTC] 00000020 id=00000000 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The defaultServer server is ready to run a smarter planet. The defaultServer server started in 18.363 seconds.
[4/27/21,16:24:20:223 UTC] 00000025 id=00000000 com.ibm.ws.logging.internal.impl.IncidentImpl                I FFDC1015I: An FFDC Incident has been created: "java.lang.NullPointerException com.ibm.ws.webcontainer.servlet.ServletWrapper.init 181" at ffdc_21.04.27_16.24.20.0.log
[4/27/21,16:24:20:230 UTC] 00000025 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               E init SRVE0271E: Uncaught init() exception created by servlet [SimpleSIPServlet] in application [guide-getting-started]: java.lang.NullPointerException
    at com.ibm.ws.sip.container.parser.ServletsInstanceHolder.addSipletInstance(ServletsInstanceHolder.java:100)
    at com.ibm.ws.sip.container.servlets.SipServletUtilImpl.initSiplet(SipServletUtilImpl.java:32)
    at javax.servlet.sip.SipServlet.init(SipServlet.java:752)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:298)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1400)
    at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:1201)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1169)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1067)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6687)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:470)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:465)
    at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1179)
    at com.ibm.ws.webcontainer.osgi.WebContainer.access$100(WebContainer.java:110)
    at com.ibm.ws.webcontainer.osgi.WebContainer$3.run(WebContainer.java:976)
    at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:238)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

[4/27/21,16:24:20:290 UTC] 00000025 id=00000000 com.ibm.ws.webcontainer.webapp.WebApp                        E doLoadOnStartupActions SRVE0276E: Error while initializing Servlet [SimpleSIPServlet]: javax.servlet.servletexception: SRVE0207E: Uncaught initialization exception created by servlet
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:367)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1400)
    at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:1201)
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:1169)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1067)
    at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6687)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:470)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:465)
    at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1179)
    at com.ibm.ws.webcontainer.osgi.WebContainer.access$100(WebContainer.java:110)
    at com.ibm.ws.webcontainer.osgi.WebContainer$3.run(WebContainer.java:976)
    at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:238)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException
    at com.ibm.ws.sip.container.parser.ServletsInstanceHolder.addSipletInstance(ServletsInstanceHolder.java:100)
    at com.ibm.ws.sip.container.servlets.SipServletUtilImpl.initSiplet(SipServletUtilImpl.java:32)
    at javax.servlet.sip.SipServlet.init(SipServlet.java:752)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:298)
    ... 16 more

[4/27/21,16:24:20:300 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   > setVirtualHost Entry  
                                                                                                               default_host
                                                                                                               [*:9443,*:-1,*:9080]
[4/27/21,16:24:20:301 UTC] 00000025 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   < setVirtualHost = Port = 9080 _Host = * Exit 
[4/27/21,16:24:24:412 UTC] 00000021 id=00000000 com.ibm.ws.sip.dar.ApplicationRepositoryFactory              I CWSCT0405I: The application router is configured to select applications by its start.
[4/27/21,16:24:24:417 UTC] 00000021 id=00000000 com.ibm.ws.sip.dar.ApplicationRepositoryFactory              I CWSCT0424I: Loading default application router,start order strategy.
[4/27/21,16:24:24:418 UTC] 00000021 id=00000000 com.ibm.ws.sip.dar.DefaultApplicationRouter                  I CWSCT0401I: Default application router has been initialized.
[4/27/21,16:24:24:443 UTC] 00000021 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true
[4/27/21,16:24:24:487 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true
[4/27/21,16:24:24:608 UTC] 00000022 id=00000000 SystemOut                                                    O Init SIP Servlet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[4/27/21,16:24:24:609 UTC] 00000022 id=00000000 SystemOut                                                    O SIP Factory set.
[4/27/21,16:24:24:610 UTC] 00000022 id=00000000 SystemOut                                                    O init. OutboundInterfaceList:
[4/27/21,16:24:24:610 UTC] 00000022 id=00000000 SystemOut                                                    O     OutboundInterface:sip:u18dev:5060;transport=udp
[4/27/21,16:24:24:612 UTC] 00000022 id=00000000 SystemOut                                                    O     OutboundInterface:sip:u18dev:5060;transport=tcp
[4/27/21,16:24:24:613 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 addSipletInstance  appName[Liberty Project] class[io.openliberty.sample.system.SimpleSIPServlet] instance[io.openliberty.sample.system.SimpleSIPServlet@64fd8a6a]
[4/27/21,16:24:24:613 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 addSipletInstance  found sipAppDesc [null]
[4/27/21,16:24:24:613 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       E addSipletInstance: can not add listeners
[4/27/21,16:24:24:614 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.ServletsInstanceHolder       3 triggerSipletinitServlet  found sipAppDesc [null]
[4/27/21,16:24:24:614 UTC] 00000022 id=00000000 com.ibm.ws.webcontainer.servlet.ServletWrapper               I init SRVE0242I: [guide-getting-started] [/] [SimpleSIPServlet]: Initialization successful.
[4/27/21,16:24:24:615 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true
[4/27/21,16:24:24:616 UTC] 00000022 id=00000000 SystemOut                                                    O OPTIONS Request from null
[4/27/21,16:24:24:617 UTC] 00000022 id=00000000 SystemOut                                                    O OPTION PING received!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[4/27/21,16:24:24:624 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true
[4/27/21,16:24:24:642 UTC] 00000022 id=00000000 com.ibm.ws.sip.container.parser.SipAppDesc                   3 isJSR289Application: m_app_name = SemafonesSRGateway  =  true

解决方法

pom.xml 编译依赖

        <dependency>
            <groupId>io.openliberty.features</groupId>
            <artifactId>sipServlet-1.1</artifactId>
            <type>esa</type>
            <version>21.0.0.3</version>
            <scope>provided</scope>
        </dependency>

server.xml 功能配置

<server description="Sample Liberty server">
    <featureManager>
        <feature>sipServlet-1.1</feature>
    </featureManager>

功能配置文档 reference

注意事项

您通常可以使用此 esa 类型的依赖结构(版本是 Open Liberty 运行时版本号)声明对提供 API 的任何功能的依赖。不过,我们的许多功能都是 Jakarta/MicroProfile 平台 API 的一部分,因此更容易通过这些平台的聚合 API 引入。

进一步阅读

WebSphere Liberty 中的 SIP(​​猜测它与 Open Liberty 中的故事非常相似):
https://www.ibm.com/docs/en/was-liberty/base?topic=overview-session-initiation-protocol-sip

旧文档

最后,不打算担保这些,但您也可以从这些链接中获得一些背景信息:

  1. WebSphere traditional 中的 SIP - 不确定其中有多少与 Open Liberty 相关,但我猜有一些?
  2. 与 SIP 相关的 sample。 Maven 构建和使用自由-Maven-插件是旧的,不推荐。最好在较新的 Open Liberty Guides 示例中使用模式。不过,也许这里有一些东西可以学习?
,

似乎在您的 servlet 中抛出了 NPE。尝试如下更改init方法的内容,看看是否仍然抛出异常。在 in init 文件中查找 messages.log 消息。如果您仍然遇到相同的错误,请提供您的 war 文件的内容。

@Override
public void init() throws ServletException {
    System.out.println("in init");
}
,

您是否获得了与以前相同的 NPE?似乎在 init 方法中抛出了 NPE。尝试将 init 方法的内容替换为

System.out.println("UAS has been initialized");

重新部署您的应用程序并重新启动服务器。您是否仍然遇到相同的错误?您是否在 UAS has been initialized 中看到 messages.log 消息?

,

此 NPE 的原因之一是 @SipServlet 注释中缺少属性。 您能否验证一下您是否设置了 description 属性? 例如:

@javax.servlet.sip.annotation.SipServlet(
        description = "My servlet",name = MySipServlet",loadOnStartup=1)

如果没有,请添加缺少的属性,重新部署应用程序,重新启动服务器,看看问题是否仍然可以重现。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。