geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo Samples > Running Hudson on Geronimo v3.0
Date Tue, 30 Nov 2010 03:11:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=GMOxSAMPLES&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxSAMPLES/Running+Hudson+on+Geronimo+v3.0">Running
Hudson on Geronimo v3.0</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxSAMPLES/Apache+Geronimo+v3.0+Samples"><img border='0'
align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxSAMPLES/Apache+Geronimo+v3.0+Samples">Apache Geronimo v3.0
Samples</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;</td></tr></table></div>
<p><a name="RunningHudsononGeronimov3.0-top"></a></p>

<p>This short document is about the steps to deploy <a href="https://hudson.dev.java.net/"
class="external-link" rel="nofollow">Hudson</a> onto Apache Geronimo v3.0. Hudson
is a easy-to-use integration system. You can go and read the details on its <a href="https://hudson.dev.java.net/"
class="external-link" rel="nofollow">web site</a>. No need to duplicate their stuff
here.</p>

<h1><a name="RunningHudsononGeronimov3.0-Theplan"></a>The plan<a name="RunningHudsononGeronimov3.0-plan"></a></h1>

<p>The plan configures a security realm <b>hudson-realm</b> as well as <b>/hudson</b>
as a context for <tt>hudson.war</tt>. </p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>&gt;hudson-realm.xml</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>
encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
<span class="code-tag">&lt;module xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
	<span class="code-tag">&lt;environment&gt;</span>
		<span class="code-tag">&lt;moduleId&gt;</span>
			<span class="code-tag">&lt;groupId&gt;</span>console.realm<span
class="code-tag">&lt;/groupId&gt;</span>
			<span class="code-tag">&lt;artifactId&gt;</span>hudson-realm<span
class="code-tag">&lt;/artifactId&gt;</span>
			<span class="code-tag">&lt;version&gt;</span>1.0<span class="code-tag">&lt;/version&gt;</span>
			<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
		<span class="code-tag">&lt;/moduleId&gt;</span>
		<span class="code-tag">&lt;dependencies&gt;</span>
			<span class="code-tag">&lt;dependency&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.framework<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>j2ee-security<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
			<span class="code-tag">&lt;/dependency&gt;</span>
		<span class="code-tag">&lt;/dependencies&gt;</span>
	<span class="code-tag">&lt;/environment&gt;</span>
	&lt;gbean name=<span class="code-quote">"hudson-realm"</span>
		class=<span class="code-quote">"org.apache.geronimo.security.realm.GenericSecurityRealm"</span>
		xsi:type=<span class="code-quote">"dep:gbeanType"</span> <span class="code-keyword">xmlns:dep</span>=<span
class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>
		<span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>&gt;
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"realmName"</span>&gt;</span>hudson-realm<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;attribute name=<span class="code-quote">"global"</span>&gt;</span>false<span
class="code-tag">&lt;/attribute&gt;</span>
		<span class="code-tag">&lt;reference name=<span class="code-quote">"ServerInfo"</span>&gt;</span>
			<span class="code-tag">&lt;name&gt;</span>ServerInfo<span class="code-tag">&lt;/name&gt;</span>
		<span class="code-tag">&lt;/reference&gt;</span>
		<span class="code-tag">&lt;xml-reference name=<span class="code-quote">"LoginModuleConfiguration"</span>&gt;</span>
			<span class="code-tag">&lt;log:login-config <span class="code-keyword">xmlns:log</span>=<span
class="code-quote">"http://geronimo.apache.org/xml/ns/loginconfig-2.0"</span>&gt;</span>
				&lt;log:login-module control-flag=<span class="code-quote">"REQUIRED"</span>
					wrap-principals=<span class="code-quote">"false"</span>&gt;
					<span class="code-tag">&lt;log:login-domain-name&gt;</span>hudson-realm<span
class="code-tag">&lt;/log:login-domain-name&gt;</span>
					<span class="code-tag">&lt;log:login-module-class&gt;</span>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule
					<span class="code-tag">&lt;/log:login-module-class&gt;</span>
					<span class="code-tag">&lt;log:option name=<span class="code-quote">"usersURI"</span>&gt;</span>var/security/users.properties
					<span class="code-tag">&lt;/log:option&gt;</span>
					<span class="code-tag">&lt;log:option name=<span class="code-quote">"groupsURI"</span>&gt;</span>var/security/groups.properties
					<span class="code-tag">&lt;/log:option&gt;</span>
				<span class="code-tag">&lt;/log:login-module&gt;</span>
			<span class="code-tag">&lt;/log:login-config&gt;</span>
		<span class="code-tag">&lt;/xml-reference&gt;</span>
	<span class="code-tag">&lt;/gbean&gt;</span>
<span class="code-tag">&lt;/module&gt;</span>
</pre>
</div></div>

<p>The plan filters out <b>org.apache.commons.lang.</b> package that comes
with Apache Commons Lang 2.5 in Geronimo 3.0. As of Hudson 1.160, Apache Commons Lang 2.4
is required and is already included in the war file.</p>

<p>It appears that Hudson uses a customized version of Apache JEXL made specifically
for itself, so filtering the package from the web classloader is required.</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>hudson-geronimo-plan.xml</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>
encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
<span class="code-tag">&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"</span>&gt;</span>
	<span class="code-tag">&lt;environment xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
		<span class="code-tag">&lt;moduleId&gt;</span>
			<span class="code-tag">&lt;groupId&gt;</span>net.java.dev.hudson<span
class="code-tag">&lt;/groupId&gt;</span>
			<span class="code-tag">&lt;artifactId&gt;</span>hudson<span class="code-tag">&lt;/artifactId&gt;</span>
			<span class="code-tag">&lt;version&gt;</span>1.386<span class="code-tag">&lt;/version&gt;</span>
			<span class="code-tag">&lt;type&gt;</span>war<span class="code-tag">&lt;/type&gt;</span>
		<span class="code-tag">&lt;/moduleId&gt;</span>
		<span class="code-tag">&lt;dependencies&gt;</span>
			<span class="code-tag">&lt;dependency&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.framework<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>j2ee-security<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
			<span class="code-tag">&lt;/dependency&gt;</span>
			<span class="code-tag">&lt;dependency&gt;</span>
				<span class="code-tag">&lt;groupId&gt;</span>console.realm<span
class="code-tag">&lt;/groupId&gt;</span>
				<span class="code-tag">&lt;artifactId&gt;</span>hudson-realm<span
class="code-tag">&lt;/artifactId&gt;</span>
				<span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
			<span class="code-tag">&lt;/dependency&gt;</span>
		<span class="code-tag">&lt;/dependencies&gt;</span>
		<span class="code-tag">&lt;hidden-classes&gt;</span>
			<span class="code-tag">&lt;filter&gt;</span>org.apache.commons.lang.<span
class="code-tag">&lt;/filter&gt;</span>
			<span class="code-tag">&lt;filter&gt;</span>org.apache.commons.jexl.<span
class="code-tag">&lt;/filter&gt;</span>
		<span class="code-tag">&lt;/hidden-classes&gt;</span>
	<span class="code-tag">&lt;/environment&gt;</span>

	<span class="code-tag">&lt;context-root&gt;</span>/hudson<span class="code-tag">&lt;/context-root&gt;</span>
	<span class="code-tag">&lt;security-realm-name&gt;</span>hudson-realm<span
class="code-tag">&lt;/security-realm-name&gt;</span>
	<span class="code-tag">&lt;security&gt;</span>
		<span class="code-tag">&lt;default-principal realm-name=<span class="code-quote">"hudson-realm"</span>&gt;</span>
			&lt;principal name=<span class="code-quote">"anonymous"</span>
				class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"</span>
/&gt;
		<span class="code-tag">&lt;/default-principal&gt;</span>
		<span class="code-tag">&lt;role-mappings&gt;</span>
			<span class="code-tag">&lt;role role-name=<span class="code-quote">"admin"</span>&gt;</span>
				<span class="code-tag">&lt;realm realm-name=<span class="code-quote">"hudson-realm"</span>&gt;</span>
					&lt;principal name=<span class="code-quote">"AdminGroup"</span>
						class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"</span>
/&gt;
				<span class="code-tag">&lt;/realm&gt;</span>
				&lt;principal name=<span class="code-quote">"system"</span>
					class=<span class="code-quote">"org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"</span>
/&gt;
			<span class="code-tag">&lt;/role&gt;</span>
		<span class="code-tag">&lt;/role-mappings&gt;</span>
	<span class="code-tag">&lt;/security&gt;</span>
<span class="code-tag">&lt;/web-app&gt;</span>
</pre>
</div></div>

<h1><a name="RunningHudsononGeronimov3.0-StartingGeronimo"></a>Starting
Geronimo</h1>

<p>Run Geronimo with <tt>./bin/geronimo.sh run -vv</tt> command.<br/>
<font color="white"><div class="preformatted panel" style="background-color: #000000;border-style:
solid;border-width: 1px;"><div class="preformattedContent panelContent" style="background-color:
#000000;">
<pre>jeffchi@jeffchi-laptop:~/Geronimo/3.0$ ./bin/startup
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
Using GERONIMO_OUT:    /home/jeffchi/Geronimo/3.0/var/log/geronimo.out

Geronimo started in background. PID: 13075
</pre>
</div></div></font></p>

<h1><a name="RunningHudsononGeronimov3.0-Deployinghudsonrealm"></a>Deploying
hudson-realm</h1>

<p><font color="white"><div class="preformatted panel" style="background-color:
#000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent"
style="background-color: #000000;">
<pre>jeffchi@jeffchi-laptop:~/Geronimo/3.0
$ ./bin/deploy.sh -u system -p manager deploy hudson-realm.xml
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
    Deployed console.realm/hudson-realm/1.0/car @ /hudson
</pre>
</div></div></font></p>

<h1><a name="RunningHudsononGeronimov3.0-Deployinghudson.war"></a>Deploying
hudson.war</h1>

<p>Download hudson.war from <a href="http://java.net/projects/hudson/downloads" class="external-link"
rel="nofollow">its releases web page</a>.</p>

<p>You can deploy hudson.war from the web console of Geronimo, but there's another way
to do the same - executing <b>deploy</b> command on the command line.<br/>
<font color="white"><div class="preformatted panel" style="background-color: #000000;border-style:
solid;border-width: 1px;"><div class="preformattedContent panelContent" style="background-color:
#000000;">
<pre>jeffchi@jeffchi-laptop:~/Geronimo/3.0
$ ./bin/deploy.sh -u system -p manager deploy hudson.war hudson-geronimo-plan.xml
Using GERONIMO_HOME:   /home/jeffchi/Geronimo/3.0
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME:        /opt/sun/jdk6_22/jre
    Deployed hudson/hudson/1.386/war @ /hudson
</pre>
</div></div></font><br/>
The Geronimo console shows deployment progress as follows:<br/>
<font color="white"><div class="preformatted panel" style="background-color: #000000;border-style:
solid;border-width: 1px;"><div class="preformattedContent panelContent" style="background-color:
#000000;">
<pre>.....
</pre>
</div></div></font></p>
<h1><a name="RunningHudsononGeronimov3.0-Runningthewebapp"></a>Running the
webapp</h1>

<p>Point the browser of your choice to <a href="http://localhost:8080/hudson" class="external-link"
rel="nofollow">http://localhost:8080/hudson</a>. You should see hudson's welcome
page.</p>

<p><span class="error">Unable to render embedded object: File (hudson-on-geronimo.png)
not found.</span></p>

<p>Setting up a new Maven2 job in hudson works fine too.</p>

<p><span class="error">Unable to render embedded object: File (hudson-new-maven2-project.png)
not found.</span></p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/GMOxSAMPLES/Running+Hudson+on+Geronimo+v3.0">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/GMOxSAMPLES/Running+Hudson+on+Geronimo+v3.0?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message