使用jboss服务器时遇到的相关有关问题

使用jboss服务器时遇到的相关问题
Eclipse启动Jboss服务器,如何指定JVM虚拟内存大小?
答:
在eclipse下:
window——>preferences——>Myeclipse——>servers——>JBoss4.x——>JDK
右边有个Optional java VM arguments:在该框中加上参数-Xms1024m -Xmx1024m

在linux系统上修改jboss的jvm的大小方式:
修改$jboss/bin/run.conf文件,找到“#JAVA_OPTS=”,如果没有该字符串,请添加,并去掉最前面的“#”,修改该字符串(含双引号)为JAVA_OPTS="-server -Xms512m -Xmx1024m”,
这是分配JVM的最小和最大内存,取决于硬件物理内存的大小,建议均设为物理内存的一半。


怎么在eclipse设置JDK?
答:
在Eclipse中点----->Window---->Preferences--->Java--->Installed JREs
右边可以添加你安装的JDK,(只用选择JRE目录)。



怎么设置eclipse中JBOSS的JDK?
答:
eclipse中JBOSS设置JDK,找到菜单栏中的window-->preferences-->MyEclipse-->Servers-->找到你要用的服务名称(如tomcat4.x,jboss4.x)-->JDK-->在右边的下拉菜单中选择jdk保存,即可。



怎么设置jboss服务器绑定ip地址?
答:方法有二,如下:
1.在eclispe IDE中修改参数:
在windows—>Preferences配置jboss,选择你的jboss版本进行配置

               首先 Enable

               设置jboss home directory:例:D:\jboss-4.2.3.GA-jdk6\jboss-4.2.3.GA

               设定server name:默认为default 也可以选择为all

               设置Optional program arguments: 选择程序的参数,例如启动时绑定到本机ip地址 -b IP地址

               Optional shutdown arguments:默认为--shutdown,一般不需要修改

点击apply按钮应用。
2.在jboss的配置文件中修改参数:
在按照默认配置的情况下,访问本地JBOSS服务器主页面只能通过HTTP://localhost:8080/或者HTTP://127.0.0.1:8080/来访问,无法对本机IP进行绑定,同时任何一台局域网内的机器都无法远程访问服务器,通过JBOSS启动界面中的参数信息可以得到证实 

16:33:25,218 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080 

16:33:25,281 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 16:33:25,484 INFO [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 1m:57s:797ms 


     也就是说,[Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080这条信息绑定了JBOSS的IP访问归属,当前默认为127.0.0.1,如果修改为一个可以在局域网内*访问的IP,那么任何一台内网机器都可以远程访问了,当然包括了本机,具体修改方式为: 

在 JBOSS的安装目录(如D:\jboss-4.2.0)下的server\default\deploy\jboss-web.deployer\server.xml中找到Connector port="8080" address="${jboss.bind.address}"配置项,将其中的address的属性值改为自定义的IP地址,如Connector port="8080" address="192.168.0.1",修改保存后重新启动JBOSS,在重启后的界面参数中可以看到 
 

16:33:25,218 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-192.168.0.1-8080 16:33:25,281 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 16:33:25,484 INFO [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 1m:57s:797ms 
 

这时,任何一台局域网的机器都可以通过HTTP://192.168.0.1:8080来访问JBOSS服务器的主页了。


jboss的数据库连接池文件存放目录是?
答:web数据库连接池文件一般位于deploy目录下(JBOSS)或者webapps目录下(tomcat)的oracle-ds.xml(oracle的配置文件),这是项目的外部连接池配置;但是有的项目需要使用内部连接池,文件是放在deploy目录下的web程序\WEB-INF\classes的applicationContext.xml。

在windows系统中jboss启动时,站用的端口有哪些?这些端口分别在什么文件中配置的?

答:
Jboss通常占用的端口是1098,1099,4444,4445,8080,8009,8083,8093这几个,
默认端口是8080 
在windows系统中:
 1098、1099、4444、4445、8083端口在\jboss\server\default\conf\jboss-service.xml中
 8080端口在\jboss\server\default\deploy\jboss-web.deployer\server.xml中
 8093端口在\jboss\server\default\deploy\jms\uil2-service.xml中

在jboss服务器上,怎么设置虚拟目录?
%JBOSS_HOME%\server\default\deploy\jboss-web.deployer
         <Host name="localhost" 
            autoDeploy="false" deploy deployXML="false"> 
            <!-- Uncomment to enable request dumper. This Valve "logs interesting 
                 contents from the specified Request (before processing) and the 
                 corresponding Response (after processing). It is especially useful 
                 in debugging problems related to headers and cookies." 
            --> 
            <!-- 
            <Valve className="org.apache.catalina.valves.RequestDumperValve" /> 
            --> 

            <!-- Access logger --> 
            <!-- 
            <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve" 
                prefix="localhost_access_log." suffix=".log" 
                pattern="common" directory="${jboss.server.home.dir}/log" 
                resolveHosts="false" /> 
            --> 
            <!-- Uncomment to enable single sign-on across web apps 
deployed to this host. Does not provide SSO across a cluster.     
             
                If this valve is used, do not use the JBoss ClusteredSingleSignOn 
                valve shown below. 
             --> 
            <!-- 
            <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> 
            --> 
            <!-- Uncomment to enable single sign-on across web apps 
               deployed to this host AND to all other hosts in the cluster 
               with the same virtual hostname. 
             
               If this valve is used, do not use the standard Tomcat SingleSignOn 
               valve shown above. 
             
               This valve uses JGroups to communicate across the cluster. The 
               JGroups Channel used for this communication can be configured 
               by editing the "sso-channel.xml" file found in the same folder 
               as this file. If this valve is running on a machine with multiple 
               IP addresses, configuring the "bind_addr" property of the JGroups 
               UDP protocol may be necessary. Another possible configuration 
               change would be to enable encryption of intra-cluster communications. 
               See the sso-channel.xml file for more details. 
             
               Besides the attributes supported by the standard Tomcat 
SingleSignOn valve (see the Tomcat docs), this version also supports 
               the following attribute: 
             
               partitionName     the name of the cluster partition in which 
                                 this node participates. If not set, the default 
                                 value is "sso-partition/" + the value of the 
                                 "name" attribute of the Host element that 
                                 encloses this element (e.g. "sso-partition/localhost") 
            --> 
            <!-- 
            <Valve className="org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn" /> 
            --> 
         
            <!-- Uncomment to check for unclosed connections and transaction terminated checks 
                 in servlets/jsps. 
                 Important: You need to uncomment the dependency on the CachedConnectionManager 
                            in META-INF/jboss-service.xml 
            <Valve className="org.jboss.web.tomcat.tc5.jca.CachedConnectionValve" 
                cachedC 
                transacti /> 
            --> 
           <!--部署虚拟目录-->
          <!-- <Context path="/test" docBase="E:\workspace\myweb\WebRoot" reloadable="true" debug="0"> </Context>-->
	  
</Host>