2015-06-30 65 views
2

我目前正在基於Mobicents SIP Servlets和JBoss 7.2開發一個項目。我使用Mobicents Eclipse Plugin爲我提供的模板在Eclipse中創建了一個新的Dynamic Web Project,然後對其進行了簡化。然後我在Eclipse中創建了一個指向我的Mobicents Jboss安裝的JBoss服務器。當我現在部署我的servlet時,我看到了Jboss安裝中的爆炸式戰爭,並且日誌表示它已部署,但我沒有看到它記錄了任何內容。SIP Servlet不能從Eclipse中的JBOSS 7.2開始

我非常基本的servlet:

package org.example.servlet.sip; 

import javax.servlet.ServletException; 
import javax.servlet.sip.SipServlet; 

import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 

@SuppressWarnings("serial") 
public class MySipServlet extends SipServlet { 

    private static Log logger = LogFactory.getLog(MySipServlet.class); 

    @Override 
    public void init() throws ServletException { 
     logger.info("the HelloSipWorld servlet has been started");  
    } 

} 

登錄:

12:54:12,102 INFO [org.jboss.modules] (main) JBoss Modules version 1.2.0.CR1 
12:54:12,315 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA 
12:54:12,378 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss AS 7.2.0.Final "Janus" starting 
12:54:13,392 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found test-as.war in deployment directory. To trigger deployment create a file called test-as.war.dodeploy 
12:54:13,426 INFO [org.xnio] (MSC service thread 1-5) XNIO Version 3.0.7.GA 
12:54:13,430 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http) 
12:54:13,435 INFO [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.0.7.GA 
12:54:13,453 INFO [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 3.2.14.GA 
12:54:13,533 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem 
12:54:13,546 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem. 
12:54:13,570 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2] 
12:54:13,575 INFO [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem 
12:54:13,619 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activating WebServices Extension 
12:54:13,635 INFO [org.jboss.as.security] (MSC service thread 1-3) JBAS013170: Current PicketBox version=4.0.15.Final 
12:54:13,677 INFO [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.15.Final) 
12:54:13,686 INFO [org.jboss.as.naming] (MSC service thread 1-6) JBAS011802: Starting Naming Service 
12:54:13,691 INFO [org.jboss.as.mail.extension] (MSC service thread 1-8) JBAS015400: Bound mail session [java:jboss/mail/Default] 
12:54:13,777 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 
12:54:13,958 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.1.3.Final 
12:54:14,080 INFO [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003001: Coyote HTTP/1.1 initializing on : http-localhost/127.0.0.1:8080 
12:54:14,093 INFO [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003000: Coyote HTTP/1.1 starting on: http-localhost/127.0.0.1:8080 
12:54:14,357 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS] 
12:54:14,467 INFO [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on 127.0.0.1:4447 
12:54:14,469 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on 127.0.0.1:9999 
12:54:14,472 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /home/jck/Desktop/ngncc/as/mobicents/mss-2.1.547-jboss-as-7.2.0.Final/standalone/deployments 
12:54:14,507 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "media-jsr309-servlet.war" (runtime-name: "media-jsr309-servlet.war") 
12:54:14,508 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "test-as.war" (runtime-name: "test-as.war") 
12:54:14,509 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "click2call.war" (runtime-name: "click2call.war") 
12:54:14,507 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "jolokia.war" (runtime-name: "jolokia.war") 
12:54:14,525 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sip-servlets-management.war" (runtime-name: "sip-servlets-management.war") 
12:54:14,528 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "websockets-sip-servlet.war" (runtime-name: "websockets-sip-servlet.war") 
12:54:15,139 INFO [org.jboss.web] (ServerService Thread Pool -- 51) JBAS018210: Register web context: /test-as 
12:54:15,140 INFO [org.jboss.web] (ServerService Thread Pool -- 53) JBAS018210: Register web context: /websockets-sip-servlet 
12:54:15,143 INFO [org.jboss.web] (ServerService Thread Pool -- 50) JBAS018210: Register web context: /jolokia 
12:54:15,145 INFO [org.jboss.web] (ServerService Thread Pool -- 52) JBAS018210: Register web context: /sip-servlets-management 
12:54:15,373 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jolokia]] (ServerService Thread Pool -- 50) jolokia-agent: No access restrictor found at classpath:/jolokia-access.xml, access to all MBeans is allowed 
12:54:15,754 INFO [org.jboss.web] (ServerService Thread Pool -- 50) JBAS018210: Register web context: /media-jsr309-servlet 
12:54:16,014 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "sip-servlets-management.war" (runtime-name : "sip-servlets-management.war") 
12:54:16,015 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "test-as.war" (runtime-name : "test-as.war") 
12:54:16,016 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "jolokia.war" (runtime-name : "jolokia.war") 
12:54:16,016 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "websockets-sip-servlet.war" (runtime-name : "websockets-sip-servlet.war") 
12:54:16,016 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "click2call.war" (runtime-name : "click2call.war") 
12:54:16,017 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "media-jsr309-servlet.war" (runtime-name : "media-jsr309-servlet.war") 
12:54:16,018 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report 
JBAS014775: New missing/unsatisfied dependencies: 
     service jboss.security.security-domain.sip-servlets (missing) dependents: [service jboss.web.deployment.default-host./click2call.realm] 

12:54:16,118 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management 
12:54:16,119 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990 
12:54:16,119 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.2.0.Final "Janus" started (with errors) in 4413ms - Started 368 of 443 services (3 services failed or missing dependencies, 71 services are passive or on-demand) 

什麼我做錯了高度讚賞的任何提示。我在JBoss 7.2上使用SIP Servlets 2.1.547。

回答

4

確保在配置中選擇standalone-sip.xml作爲配置文件。 SIP Servlet的容器​​使用一個特定的配置,當你通過Eclipse的啓動是不是默認的,我相信

+0

我改變了服務器的RuntimeConfiguration到-Mp「/家/ JCK /桌面/ ngncc /爲/ mobicents/mss-2.1.547-jboss-as-7.2.0.Final/modules「-jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -b localhost --server-config = standalone-sip.xml -Djboss .server.base.dir =/home/jck/Desktop/ngncc/as/mobicents/mss-2.1.547-jboss-as-7.2.0.Final/standalone,但我仍然得到相同的結果 – reindeer

+1

我刪除了所有相關內容到Eclipse和mobicents,然後從頭開始完全。在創建新的服務器實例時,我發現可以在創建過程中選擇standalone-sip.xml。我最後一次錯過了。現在它像一個魅力。 – reindeer

1
  1. 你在\服務器\ DEFAULT \的conf \ jboss的-的log4j.xml

    <category name="org.example.servlet"> 
        <priority value="INFO"/></category> 
    
    添加以下類別
  2. 如果您不打算測試click2call用例,爲什麼不從您的jboss的deploy文件夾中刪除這場戰爭。

+0

我刪除了click2call(默認情況下,並且在重新安裝JBoss之後,我再也沒有打擾過了)。我沒有在我的安裝中找到「jboss-log4j.xml」。 – reindeer

+0

我已經使用過JBoss 5並使用jboss-log4j.xml來定製日誌記錄。我認爲在Joss 7中,你可以通過standalone.xml控制它。請看看並在其中添加以下內容: ... ... –

2

註釋你的servlet與@SipServlet:

@SuppressWarnings("serial") 
@javax.servlet.sip.annotation.SipServlet 
public class MySipServlet extends SipServlet { 

添加SIP的依賴,如:

<dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>sip-api</artifactId> 
    <version>1.0</version> 
</dependency> 

確保Maven依賴存在於WEB-INF/lib目錄下。如果不是,請轉至 您的項目>屬性>部署程序集>單擊添加..並選擇「構建路徑條目」,然後選擇「Maven依賴關係」。

而且你在你的日誌錯誤,那麼你肯定是缺少一些依賴關係:

JBAS014775: New missing/unsatisfied dependencies: 
     service jboss.security.security-domain.sip-servlets (missing) dependents: [service jboss.web.deployment.default-host./click2call.realm] 
+0

我從JBoss中刪除了click2call(默認情況下,我沒有任何關係)。依賴關係全部滿足,一切都乾淨利落,所以這也不是原因。 – reindeer

+0

@SipServlet – outdev

+0

那也沒有改變的東西。 – reindeer