【问题标题】:How to deploy webservice on jboss 4.0.4 application server hosted on solaris 10 with a specific port?如何在具有特定端口的 solaris 10 上托管的 jboss 4.0.4 应用程序服务器上部署 web 服务?
【发布时间】:2014-09-18 07:53:41
【问题描述】:

我对 JBOSS 4.0.4 应用服务器和 Solaris 10 完全陌生。 我已经使用 Eclipse 开发了我的 webservice WAR 文件,需要将其部署在托管在 Solaris(版本 10)上的远程 jboss Web 服务器(版本 4.0.4)上,并且需要为其分配端口 8088。 我的意思是我的客户需要通过以下方式访问我的网络服务:http://test.com:8088/myWebService?wsdl

我怎样才能做到这一点? 为了使它成为可能,我应该做哪些配置? 我的一位朋友告诉我,JBOSS 4.0.4 版仅使用一个端口号托管每个 http 请求,即所有 JSP 和 Web 服务都将具有相同的端口号,该端口号在 /export/home/app/jboss/server/default/deploy 中定义/jbossweb-tomcat55.sar/server.xml 在我的开发服务器上,server.xml 如下所示:

<Server>
  <Service name="jboss.web"
  className="org.jboss.web.tomcat.tc5.StandardService">
  <!-- A HTTP/1.1 Connector on port 8080 -->
  <Connector port="8090" address="${jboss.bind.address}"
     maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
     emptySessionPath="true"
     enableLookups="false" redirectPort="8443" acceptCount="100"
     connectionTimeout="20000" disableUploadTimeout="true"/>
  <!-- Add this option to the connector to avoid problems with 
      .NET clients that don't implement HTTP/1.1 correctly 
     restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
  -->
  <!-- A AJP 1.3 Connector on port 8009 -->
  <Connector port="8009" address="${jboss.bind.address}"
     emptySessionPath="true" enableLookups="false" redirectPort="8443" 
     protocol="AJP/1.3"/>
  <Engine name="jboss.web" defaultHost="localhost">
     <Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
        certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
        allRolesMode="authOnly"
        />
     </Host>
  </Engine>

对吗? 谢谢

【问题讨论】:

    标签: java eclipse web-services jboss solaris


    【解决方案1】:

    我找到了我猜想的答案:实际上 jboss 4.0.4 使用的是 tomcat 作为它的网络服务器,它包含 server.xml 可配置为监听不同的端口,如本文所述: http://www.mulesoft.com/tcat/tomcat-connectors

    实际上我应该在 server.xml 中定义不同的连接器和引擎元素,然后就完成了。 正如我所说,我修改了我的 server.xml 如下:

        <Server>
    
      <!-- Use a custom version of StandardService that allows the
       connectors to be started independent of the normal lifecycle
       start to allow web apps to be deployed before starting the
       connectors.
       -->
      <Service name="jboss.web"
         className="org.jboss.web.tomcat.tc5.StandardService">
    
        <!-- A HTTP/1.1 Connector on port 8080 -->
        <Connector port="8090" address="${jboss.bind.address}"
           maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
           emptySessionPath="true"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true"/>
    
        <!-- Add this option to the connector to avoid problems with 
              .NET clients that don't implement HTTP/1.1 correctly 
             restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
          -->
    
        <!-- A AJP 1.3 Connector on port 8009 -->
        <Connector port="8009" address="${jboss.bind.address}"
           emptySessionPath="true" enableLookups="false" redirectPort="8443"
           protocol="AJP/1.3"/>
    
        <!-- SSL/TLS Connector configuration using the admin devl guide keystore
          <Connector port="8443" address="${jboss.bind.address}"
               maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
               emptySessionPath="true"
               scheme="https" secure="true" clientAuth="false" 
               keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
               keystorePass="rmi+ssl" sslProtocol = "TLS" />
          -->
    
        <Engine name="jboss.web" defaultHost="localhost">
          <Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
             certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
             allRolesMode="authOnly"
                />
    
          <Host name="localhost"
             autoDeploy="false" deployOnStartup="false" deployXML="false">
    
          </Host>
    
        </Engine>
    
      </Service>
    
      <Service name="jboss.webservice"
        className="org.jboss.web.tomcat.tc5.StandardService">
    
        <!-- A HTTP/1.1 Connector on port 8080 -->
        <Connector port="8099" address="${jboss.bind.address}"
           maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
           emptySessionPath="true"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true"/>
    
        <Engine name="jboss.webservice" defaultHost="localhost">
          <Realm className="org.jboss.web.tomcat.security.JBossSecurityMgrRealm"
             certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
             allRolesMode="authOnly"
                />
    
          <Host name="localhost"
             autoDeploy="false" deployOnStartup="false" deployXML="false">
    <Context path="/"></Context>
          </Host>
    
        </Engine>
    
      </Service>
    
    </Server>
    

    如您所见,我添加了一个新的服务标签并将其命名为“jboss.webservice”。我认为 xml 代码的其余部分是声明性的,无需其他解释即可理解。 无论如何不要忘记在 SOLARIS 中杀死 jboss 进程并再次运行它。 我尝试了这些命令,在 jboss 再次启动后,我能够远程登录到该端口。 :)

    #ps -ef | grep 0.0.0
    //here I get the process id of jboss, assume i get 1234
    #kill -9 1234
    //here I kill it
    #cd /export/home/app/jboss/bin
    //here i go to my jboss bin directory to run it
    #nohup ./run.sh &
    //here jboss is run
    //now telnet
    # telnet myIpadd 8099
    

    就是这样。 希望有帮助。

    【讨论】:

      猜你喜欢
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-28
      相关资源
      最近更新 更多