...
Tomcat-Native beállítása JBoss alatt
http://community.jboss.org/wiki/UsingJBossWithTomcatNativeAndSSL![]()
context.xml és hatásai JBoss Web Context alatt
Platforms
The table below is a comparison of locations a context.xml can be used in Tomcat and JBossAS. The base directory, CATALINA_HOME, is defined in JBossAS as:
- JBossAS 4.2.3 GA - JBOSS_HOME/server/config/deploy/jboss-web.deployer
- JBossAS 4.3 GA - JBOSS_HOME/server/config/deploy/jboss-web.deployer
- JBossAS 5.0.0 GA - JBOSS_HOME/server/config/deploy/jbossweb.sar
Location | Tomcat 5.5.x | JBossAS 4.3 | Tomcat 6.x | JBossAS 5.0.0 | ||
|---|---|---|---|---|---|---|
CATALINA_HOME/server.xml (Server/Host/Context) | - | + | - | + | ||
CATALINA_HOME/conf/server.xml (Server/Host/Context) | + | - | + | - | ||
CATALINA_HOME/context.xml | - | - | - | - | ||
CATALINA_HOME/conf/context.xml | + | - | + | - | ||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2962ca07-4b12-4593-96b5-7a0cdf723b23"><ac:plain-text-body><![CDATA[ | CATALINA_HOME/conf/[Engine]/[Host]/context.xml | + | - | + | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4cc633fa-7098-4e85-ab76-f5c1f652cd26"><ac:plain-text-body><![CDATA[ | CATALINA_HOME/conf/[Engine]/[Host]/context.xml.default | + | - | + | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0cfbfbb9-2ee0-4594-83cc-997ca29e2f93"><ac:plain-text-body><![CDATA[ | CATALINA_HOME/conf/[Engine]/[Host]/[ctxPath].xml | + | - | + | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ada5b24f-a0b8-4a27-a667-edfe7ff2d9a0"><ac:plain-text-body><![CDATA[ | JBOSS_HOME/server/[config]/conf/[Engine]/[Host]/context.xml | - | - | - | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="50bd52b6-02e1-4168-8056-1ac00ccde14d"><ac:plain-text-body><![CDATA[ | JBOSS_HOME/server/[config]/conf/[Engine]/[Host]/[ctxPath].xml | - | - | - | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b5fafb34-6ab8-4efb-bcef-b715c2b5bed6"><ac:plain-text-body><![CDATA[ | [deployed-web-app]/META-INF/context.xml | + | - | + | - | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4e9c785f-17ed-4a1f-9bdd-773ddb2e5881"><ac:plain-text-body><![CDATA[ | [deployed-web-app]/WEB-INF/context.xml | - | + | - | + | ]]></ac:plain-text-body></ac:structured-macro> |
Location Effects
This list explains the effect of each location
Wiki Markup \[deployed-web-app\]/WEB-INF/context.xml - Applies only to the web appWiki Markup \[deployed-web-app\]/META-INF/context.xml \- Applies only to the web appWiki Markup CATALINA_HOME/conf/\[Engine\]/\[Host\]/context.xml.default - Applies to all web apps deployed on \[Host\] by default. A context.xml deployed with a web app will over-ride.Wiki Markup CATALINA_HOME/server.xml (Server/Host/Context)\- Applies to all web apps deployed on \[Host\]. Can be overridden by context.xml deployed with web app.Wiki Markup CATALINA_HOME/conf/server.xml (Server/Host/Context) - Applies to all web apps deployed on \[Host\]. Can be overridden by context.xml deployed with a web app.Wiki Markup CATALINA_HOME/conf/context.xml - Applies to all web apps deployed on \[Host\]. Can be overridden by context.xml deployed with a web app.\\
Deploying a custom context in JBossAS
Deploy a custom context by following these points:
- A custom context must extend o.a.catalina.core.StandardContext
- The custom context class must be deployed with a corresponding mbeans-descriptors.xml
Wiki Markup The custom context and mbeans-descriptor.xml must be deployed in a JAR to JBOSS_HOME/server/\[config\]/lib- The o.a.catalina.startup.ContextConfig must be extended if context configuration needs customization.
- JBossAS 5.0
Wiki Markup Edit JBOSS_HOME/server/\[config\]/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml- Within the element <mbean name="WarDeployer" add the following properties
- Mandatory: <property name="contextMBeanCode">org.your.project.CustomContext<property>
- Optional: <property name"contextConfigMBeanCode">org.your.project.CustomContextConfig<property>
- JBossAS 4.3
Wiki Markup Edit JBOSS_HOME/server/\[config\]/deploy/jboss-web.deployer/META-INF/jboss-service.xml- Within <mbean code="org.jboss.web.tomcat.service.JBossWeb" name="jboss.web:service=WebServer"
- Add <attribute name="ContextMBeanCode">org.your.project.CustomContext<attribute>
- Prepare a mbeans-descriptors.xml and include it in a jar file along with your custom context class.
Wiki Markup Deploy the jar file in JBOSS_HOME/server/\[config\]/lib