<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>e-beyond</title>
	<atom:link href="http://ebeyond01.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ebeyond01.wordpress.com</link>
	<description>somewhere, anywhere, nowhere</description>
	<lastBuildDate>Fri, 27 Jan 2012 15:34:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ebeyond01.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>e-beyond</title>
		<link>http://ebeyond01.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ebeyond01.wordpress.com/osd.xml" title="e-beyond" />
	<atom:link rel='hub' href='http://ebeyond01.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Maven: Mixed Projects with Java and Scala</title>
		<link>http://ebeyond01.wordpress.com/2011/09/10/maven-mixed-projects-with-java-and-scala/</link>
		<comments>http://ebeyond01.wordpress.com/2011/09/10/maven-mixed-projects-with-java-and-scala/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 12:11:05 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.e-beyond.de/?p=158</guid>
		<description><![CDATA[Playing around with maven, scala and java I&#8217;ve found it useful to have both, java and scala, in one project. After searching for a while I&#8217;ve found several sources which helped me solving this point. Everything which is needed is &#8230; <a href="http://ebeyond01.wordpress.com/2011/09/10/maven-mixed-projects-with-java-and-scala/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=158&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Playing around with maven, <a href="http://www.scala-lang.org/">scala</a> and java I&#8217;ve found it useful to have both, java and scala, in one project. After searching for a while I&#8217;ve found several sources which helped me solving this point.<span id="more-158"></span></p>
<p>Everything which is needed is a standard quickstart project of <a href="http://maven.apache.org">maven</a>. The folder structure has to be extended by the both directories:<br />
<code><br />
src/main/scala<br />
</code> and<code><br />
src/test/scala<br />
</code><br />
After that you&#8217;ve got to add the following lines to the pom.xml of the maven project:</p>
<p>To use scala in the project you&#8217;ve got to add an additional repository:<br />
<code><br />
...<br />
&lt;repository&gt;<br />
&lt;id&gt;scala-tools.org&lt;/id&gt;<br />
&lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;<br />
&lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;<br />
&lt;/repository&gt;<br />
&lt;repository&gt;<br />
&lt;id&gt;scala-tools.org&lt;/id&gt;<br />
&lt;name&gt;Scala-tools Maven2 Repository&lt;/name&gt;<br />
&lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;<br />
&lt;/repository&gt;<br />
...<br />
</code><br />
Within the dependency-section you&#8217;ll need to add the needed library:<br />
<code><br />
...<br />
&lt;dependencies&gt;<br />
&lt;groupId&gt;org.scala-lang&lt;/groupId&gt;<br />
&lt;artifactId&gt;scala-library&lt;/artifactId&gt;<br />
&lt;version&gt;2.9.0-1&lt;/version&gt;<br />
&lt;/dependencies&gt;<br />
...<br />
</code></p>
<p>After that I had to add the maven-scala-plugin to the build-lifecycle.<br />
<code><br />
...</code></p>
<p>org.scala-tools<br />
maven-scala-plugin</p>
<p>scala-compile-first<br />
process-resources</p>
<p>add-source<br />
compile</p>
<p>scala-test-compile<br />
process-test-resources</p>
<p>testCompile</p>
<p>&#8230;</p>
<p>After that it was possible to use scala and java in one project (of course in diffrent directories).<br />
Some other people put the maven-compiler-plugin below the maven-scala-plugin to define the order of execution.<br />
If there are any Eclipse-Users outside: There is a <a href="http://alchim31.free.fr/m2e-scala/update-site/">m2e-scala connector</a> which connects the lifecycle of the maven-scala-plugin to m2e. This makes the development on Eclipse much easier.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=158&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2011/09/10/maven-mixed-projects-with-java-and-scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>
	</item>
		<item>
		<title>Netbeans and Glassfish remote deployments</title>
		<link>http://ebeyond01.wordpress.com/2011/06/22/netbeans-and-glassfish-remote-deployments/</link>
		<comments>http://ebeyond01.wordpress.com/2011/06/22/netbeans-and-glassfish-remote-deployments/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 08:30:01 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://blog.e-beyond.de/?p=138</guid>
		<description><![CDATA[Using Netbeans together with GlassFish works like a charm. Especially when using the preconfigured GlassFish. There is one point which isn&#8217;t mentioned often: You can also work with an remote GlassFish. When planning to use this feature you&#8217;ll have to &#8230; <a href="http://ebeyond01.wordpress.com/2011/06/22/netbeans-and-glassfish-remote-deployments/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=138&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://netbeans.org">Netbeans</a> together with <a href="http://glassfish.java.net/">GlassFish</a> works like a charm. Especially when using the preconfigured GlassFish. There is one point which isn&#8217;t mentioned often: You can also work with an remote GlassFish.<span id="more-138"></span></p>
<p>When planning to use this feature you&#8217;ll have to switch to the &#8220;Services&#8221; window in Netbeans. Within this you should choose a new GlassFish-Instance to be added to the servers.</p>
<p><a href="http://ebeyond01.files.wordpress.com/2011/06/1.png"><img class="aligncenter size-medium wp-image-139" title="Glassfish: Choose Glassfish" src="http://ebeyond01.files.wordpress.com/2011/06/1.png?w=300&#038;h=207#038;h=207" alt="" width="300" height="207" /></a></p>
<p>Within the next page of the following dialogs you&#8217;ve got to choose a locally installed instance:</p>
<p><a href="http://ebeyond01.files.wordpress.com/2011/06/2.png"><img class="aligncenter size-medium wp-image-141" title="Glassfish: Choose a locally installed instance" src="http://ebeyond01.files.wordpress.com/2011/06/2.png?w=300&#038;h=169#038;h=169" alt="" width="300" height="169" /></a></p>
<p>This is needed so Netbeans can use the libraries provided by GlassFish. It shoud be the same version of GlassFish as the one on the webserver to avoid any problems.</p>
<p>The next step is the one where the remote instance is choosen. By default the local instance is choosen, but we&#8217;ll choose the other now:</p>
<p><a href="http://ebeyond01.files.wordpress.com/2011/06/3.png"><img class="aligncenter size-medium wp-image-144" title="Glassfish: Choose the remote one" src="http://ebeyond01.files.wordpress.com/2011/06/3.png?w=300&#038;h=169#038;h=169" alt="" width="300" height="169" /></a>Now just hit finished. Nearly everything is done to use the remote GlassFish. After finishing the dialog you got another dialog which requests the credentials for the GlassFish:</p>
<p><a href="http://ebeyond01.files.wordpress.com/2011/06/4.png"><img class="aligncenter size-medium wp-image-146" title="Glassfish: Credentials for the remote glassfish" src="http://ebeyond01.files.wordpress.com/2011/06/4.png?w=300&#038;h=135#038;h=135" alt="" width="300" height="135" /></a>After entering the informations everything should be fine, but there is still one step. Due to security restrictions the remote administration of the GlassFish isn&#8217;t enabled. So when you klick on Ok you will receive the following dialog:</p>
<p><a href="http://ebeyond01.files.wordpress.com/2011/06/5.png"><img class="aligncenter size-medium wp-image-147" title="Glassfish: You should enable remote administration" src="http://ebeyond01.files.wordpress.com/2011/06/5.png?w=300&#038;h=96#038;h=96" alt="" width="300" height="96" /></a>This dialog gives you a hint on what to do next: You have to execute <em>&#8220;asadmin enable-secure-admin&#8221;</em> on the remote server:</p>
<p>[webserver]# asadmin enable-secure-admin<br />
Enter admin user name&gt; Â [your admin-user, default: "admin"]<br />
Enter admin password for user &#8220;admin&#8221;&gt; Â [the password of this user]<br />
Command enable-secure-admin executed successfully.</p>
<p>Now you can try again, but you will still receive the same error. Due to the <a href="http://wikis.sun.com/display/GlassFish/3.1SecureAdminTraffic#3.1SecureAdminTraffic-enablesecureadmin">documentation</a> <a href="http://grizzly.java.net/">Grizzly</a> needs a reload to apply these setting.</p>
<p>After you&#8217;ve got enabled-secure-admin you will be asked to confirm a new certificate (on the console, which you should do). This command enables secure access to the admin functions. Which means that the admin-gui (on port 4848) is now running via https and is no longer avaliable using http. The communication between asadmin and GlassFish is now secured.</p>
<p>After stopping and starting GlassFish again, everything works fine. And you can work with the remote GlassFish.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=138&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2011/06/22/netbeans-and-glassfish-remote-deployments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>

		<media:content url="http://ebeyond01.files.wordpress.com/2011/06/1.png?w=300&#38;h=207" medium="image">
			<media:title type="html">Glassfish: Choose Glassfish</media:title>
		</media:content>

		<media:content url="http://ebeyond01.files.wordpress.com/2011/06/2.png?w=300&#38;h=169" medium="image">
			<media:title type="html">Glassfish: Choose a locally installed instance</media:title>
		</media:content>

		<media:content url="http://ebeyond01.files.wordpress.com/2011/06/3.png?w=300&#38;h=169" medium="image">
			<media:title type="html">Glassfish: Choose the remote one</media:title>
		</media:content>

		<media:content url="http://ebeyond01.files.wordpress.com/2011/06/4.png?w=300&#38;h=135" medium="image">
			<media:title type="html">Glassfish: Credentials for the remote glassfish</media:title>
		</media:content>

		<media:content url="http://ebeyond01.files.wordpress.com/2011/06/5.png?w=300&#38;h=96" medium="image">
			<media:title type="html">Glassfish: You should enable remote administration</media:title>
		</media:content>
	</item>
		<item>
		<title>JAAS &amp; JBoss: Client Authentication</title>
		<link>http://ebeyond01.wordpress.com/2010/04/18/jaas-jboss-client-authentication/</link>
		<comments>http://ebeyond01.wordpress.com/2010/04/18/jaas-jboss-client-authentication/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 13:14:42 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.e-beyond.de/?p=64</guid>
		<description><![CDATA[This is the second part of my articles about JBoss Security. The first part of this series shows how to configure a JBossAS to use security in the beans and how to connect them from a remote client using RMI.

In this small article I show you the diffrent types of connecting from a client to the deployed sessionbean from part 1. In the first part I had choosen a really simple way to authorize the client. But there are more ways to achieve this. All of them manage the same but differs in the complexity or in the use case where and when to use. <a href="http://ebeyond01.wordpress.com/2010/04/18/jaas-jboss-client-authentication/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=64&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the second part of my articles about <a href="http://www.jboss.org/" target="_blank">JBoss</a> Security. The <a href="http://www.e-beyond.de/2010/04/16/jaas-jboss-authentication-1/" target="_blank">first part</a> of this series shows how to configure a JBossAS to use security in the beans and how to connect them from a remote client using RMI.<span id="more-64"></span></p>
<p>In this small article I show you the diffrent types of connecting from a client to the deployed sessionbean from <a href="http://www.e-beyond.de/2010/04/16/jaas-jboss-authentication-1/" target="_blank">part 1</a>. In the first part I had choosen a really simple way to authorize the client. But there are more ways to achieve this. All of them manage the same but differs in the complexity or in the use case where and when to use.</p>
<p>The standard way to access an secured sessionbean is using the <a href="http://java.sun.com/javase/6/docs/api/javax/security/auth/login/LoginContext.html" target="_blank">LoginContext</a> and the related <a href="http://java.sun.com/javase/6/docs/api/javax/security/auth/callback/CallbackHandler.html" target="_blank">CallbackHandler</a>. I name it the<em> &#8216;standard way&#8217;</em> because it&#8217;s the way which is explained by Sun/Oracle in their JAAS documentation.</p>
<p><strong>LoginContext &amp; CallbackHandler</strong></p>
<p>At first we&#8217;re creating the CallbackHandler. This CallbackHandler is needed by the LoginContext to authenticate. Why it&#8217;s done this way? &#8211; It&#8217;s easy to explain: The login should be as flexible as possible. That means that you should be able to retrieve you&#8217;r username and password in a way that best suites your needs. In my projects I found it more usable to provide the credentials using the constructor or using setters and getters.</p>
<p><pre class="brush: java;"> import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;

public class MyCallbackHandler implements CallbackHandler {

public MyCallbackHandler(String username, char[] password) {
this.username = username;
this.password = password;
}

public MyCallbackHandler(String username, String password) {
this.username = username;
this.password = password.toCharArray();
}

String username;

char[] password;

public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (Callback callback : callbacks) {
System.out.println("Handling callbacks");
if (callback instanceof NameCallback) {
System.out.println("Handling NameCallback");
NameCallback nc = (NameCallback) callback;
nc.setName(username);
} else if (callback instanceof PasswordCallback) {
System.out.println("Handling PasswordCallback");
PasswordCallback pc = (PasswordCallback) callback;
pc.setPassword(password);
}
}
}
</pre></p>
<p>To use the CallbackHandler you have to modify the client as shown below.</p>
<p><pre class="brush: java;"> import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.security.auth.login.LoginContext;
import myea.beans.SayHello;

public class Main {
public static void main(String[] args) throws Exception {

Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");
MyCallbackHandler myCbHandler = new MyCallbackHandler("myuser", "123456");
System.out.println("Preparing LoginContext.");
LoginContext lctx = new LoginContext("my-security-client", myCbHandler);
System.out.println("Logging in...");
lctx.login();
System.out.println("Calling sessionbean...");
InitialContext ctx = new InitialContext(env);
SayHello h = (SayHello) ctx.lookup("SayHelloBean/remote");
System.out.println(h.sayHello("Marc"));
}
}
}
</pre></p>
<p>Now you can execute the client. But there is an exception:</p>
<p><pre class="brush: java;">
Exception in thread "main" java.lang.SecurityException: Unable to locate a login configuration.
... (some more stacktrace) ...
</pre></p>
<p>This exception tells us that there is an login configuration missing. This login configuration defines the used LoginModule for authenticating the client. We&#8217;ve to provide this configuration. There are two ways to provide the configuration. The mostly used way to handle it is using a file:</p>
<p><pre class="brush: java;">
my-security-client {
org.jboss.security.ClientLoginModuleÃ‚Â  required;
};
</pre></p>
<p>The format of this file is explained in depth in the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/tutorials/LoginConfigFile.html" target="_blank">LoginConfigFile-section</a> of the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/tutorials/" target="_blank">JAAS-Tutorial</a>. I&#8217;ll only explain the parts of theÃ‚Â  login config file which we&#8217;re using:</p>
<p><em>my-security-client</em> is the name for the following configuration. If the LoginContext is initialized it reads the file and uses the configuration which is named like the first parameter of the LoginContext-constructor. Within the configuration there is a classname followed by <em>required</em>. The classname (the first in the row) is the name of the LoginModule. This one is a provided by JBoss. This LoginModule is followed by &#8216;required&#8217;. In login config files which contains entries with only one LoginModule it&#8217;s usually the required one. If you&#8217;ve got more than one LoginModule it can have other values, such as: &#8220;<em>requisite</em>&#8220;, &#8220;<em>sufficient</em>&#8220;, &#8220;<em>optional</em>&#8221; and of course &#8220;<em>required</em>&#8220;.Ã‚Â  There are some more configuration options such as &#8216;debug=true&#8217; which you can append to the line, they&#8217; re explained on the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/tutorials/" target="_blank">JAAS-Tutorial</a>.</p>
<p>After creating this file we&#8217;ve got to specify that we&#8217;re using this file. Therefore we&#8217;ve got to specify this paramter when starting the application:</p>
<p><pre class="brush: java;">
-Djava.security.auth.login.config=./conf/auth.conf
</pre></p>
<p>I&#8217;ve put my auth.conf file (you can name it as you want, as I mentioned before) in a directory named conf. Of course you can choose another location.</p>
<p>After that modification your client should connect successfully. But there is one thing to note when you&#8217;re looking at the output of the client:</p>
<p><pre class="brush: java;">
Preparing LoginContext.
Logging in...
Handling callbacks
Handling NameCallback
Handling callbacks
Handling PasswordCallback
Calling sessionbean...
Hello Marc
</pre></p>
<p>As you can see the Callback is called when the login() method of the LoginContext is called.Ã‚Â  If you try to execute the client you&#8217;ll notice that the login procedures will run without connecting to the AS (the exception occures after &#8220;Calling sessionbean&#8230;&#8221;. That means that you&#8217;ll see that the login is correct or incorrect on the first call to a secured sessionbean. So you&#8217;ve got to check the success or failure of a login on a first call to the server.</p>
<p>Above there is shown the login configuration file. But there is another way to handle the login configuration. You can avoid writing this file if you write the configuration in your class:</p>
<p><pre class="brush: java;">
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;
import javax.security.auth.login.LoginContext;
import myea.beans.SayHello;

public class Main {

public static void main(String[] args) throws Exception {

Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");
MyCallbackHandler myCbHandler = new MyCallbackHandler("myuser", "123456");
System.out.println("Preparing LoginContext.");
Configuration conf = new Configuration() {

@Override
public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
AppConfigurationEntry entry = new AppConfigurationEntry("org.jboss.security.ClientLoginModule",AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, new java.util.HashMap());
return new AppConfigurationEntry[] {entry};
}

};
LoginContext lctx = new LoginContext("my-security-client",null , myCbHandler, conf);
System.out.println("Logging in...");
lctx.login();
System.out.println("Calling sessionbean...");
InitialContext ctx = new InitialContext(env);
SayHello h = (SayHello) ctx.lookup("SayHelloBean/remote");
System.out.println(h.sayHello("Marc"));

}
}
</pre></p>
<p>The important part is the Configuration and the initialization of the LoginContext. The Configuration shows in the method getAppConfigurationEntry the representation of the contents of the file. Normally this method is called with the configuration name (in our case &#8220;my-security-client&#8221;). But we&#8217;ll ignore it here and provide the same login configuration for all callers.</p>
<p>If you&#8217;d like to avoid creating these both classes you can choose one of the following. You can use the SimpleClient which is provided by the JBossAS client libraries or you can use the JndiLoginInitialContext as the Context.INITIAL_CONTEXT_FACTORY.</p>
<p><strong>SecurityClient</strong></p>
<p>The SecurityClient (org.jboss.security.client.SecurityClient) is the simplest way to connect to session bean.Ã‚Â  Under the hood the SecurityClient should handle three diffrent types: JAAS Authentication, SASL and SimpleAuthentication. In fact currently only JAAS and SimpleAuthentication is provided. The SASLAuthentication throws currently a RuntimeException &#8220;Not implemented&#8221;. The default behaviour for the SecurityClient is the SimpleAuthentication. The SecurityClient uses the SecurityContext directly to set the credentials.</p>
<p>For convenience I&#8217;ll show you the sourcecode from <a href="http://www.e-beyond.de/2010/04/16/jaas-jboss-authentication-1/" target="_blank">part 1</a> again:</p>
<p><pre class="brush: java;">
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import myea.beans.SayHello;
import org.jboss.security.client.SecurityClient;
import org.jboss.security.client.SecurityClientFactory;

public class Main {

public static void main(String[] args) throws Exception {
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");

SecurityClient client = SecurityClientFactory.getSecurityClient();
client.setSimple("myuser", "123456");
client.login();

InitialContext ctx = new InitialContext(env);
SayHello h = (SayHello) ctx.lookup("SayHelloBean/remote");
System.out.println(h.sayHello("Marc"));
}
}
</pre></p>
<p>The important part is this one:</p>
<p><pre class="brush: java;">
SecurityClient client = SecurityClientFactory.getSecurityClient();
client.setSimple("myuser", "123456");
client.login();
</pre></p>
<p>This authenticates the client. Or better: it prepares the client to authenticate on the next call to an secured bean on the AS. As mentioned above it&#8217;s possible to change the behavior of SimpleAuthentication to JAAS-authentication. For this kind of authentication you&#8217;ll have to change from setSimple to setJAAS. In this case you&#8217;ll need again the Callback and the login configuration from the first example.</p>
<p>It would look like that:</p>
<p><pre class="brush: java;">
SecurityClient client = SecurityClientFactory.getSecurityClient();
client.setJAAS("my-security-client", myCbHandler);
client.login();
</pre></p>
<p><strong>JndiLoginInitialContextFactory</strong></p>
<p>JBoss also provides an InitialContextFactory which should combine both worlds: The creation of the initial context and the authentication. It&#8217;s mentioned on the <a href="http://community.jboss.org/wiki/JndiLoginInitialContextFactory" target="_blank">JBoss wiki</a>.</p>
<p>On the wiki there is this example:</p>
<p><pre class="brush: java;">
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");
env.setProperty(Context.SECURITY_PRINCIPAL, "username");
env.setProperty(Context.SECURITY_CREDENTIALS, "password");
InitialContext ctx = new InitialContext(env);
</pre></p>
<p>I&#8217;ve tried that but that doesn&#8217;t work. This JndiLoginContextFactory is meant for authentication of remote clients on the <a href="http://community.jboss.org/wiki/LoginInitialContextFactory" target="_blank">LoginInitialContextFactory page</a> of the JBoss Wiki.</p>
<p>After using this InitialContextFactory I&#8217;ve received the following exception:</p>
<p><pre class="brush: java;">
Exception in thread "main" javax.ejb.EJBAccessException: Caller unauthorized
</pre></p>
<p>This issue (<a href="https://jira.jboss.org/jira/browse/JBAS-7010" target="_blank">JBAS-7010</a>) is known and is already fixed in JBoss 6.0.0.M1.</p>
<p><em> </em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=64&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2010/04/18/jaas-jboss-client-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>
	</item>
		<item>
		<title>JAAS &amp; JBoss: Authentication</title>
		<link>http://ebeyond01.wordpress.com/2010/04/16/jaas-jboss-authentication-1/</link>
		<comments>http://ebeyond01.wordpress.com/2010/04/16/jaas-jboss-authentication-1/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 23:15:38 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[jaas]]></category>
		<category><![CDATA[rmi]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.e-beyond.de/?p=36</guid>
		<description><![CDATA[Currently I&#8217;m working on a project which uses the authentication in JBoss. I would say that&#8217;s not a very large project but it&#8217;s not an hello-world-project. In this project I was confronted with some issues. The most problematic is that &#8230; <a href="http://ebeyond01.wordpress.com/2010/04/16/jaas-jboss-authentication-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=36&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Currently I&#8217;m working on a project which uses the authentication in <a href="http://www.jboss.org" target="_blank">JBoss</a>. I would say that&#8217;s not a very large project but it&#8217;s not an hello-world-project. In this project I was confronted with some issues. The most problematic is that there isn&#8217;t much documentation in the web which covers the issues beyond a standard <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html" target="_blank">JAAS</a> Authentication.Ã‚Â  I mean such points as: securing an Queue, Topic, Service, how to connect to these from an messagedriven- or sessionbean (and of course: what works and what doesn&#8217;t). Based upon these experiences I thought of a small series of articles which might help others. To make a long story short &#8211; here is the first part:</p>
<p><span id="more-36"></span></p>
<p>When using JBoss security you&#8217;re typically confronted with <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html" target="_blank">JAAS</a>: The <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html" target="_blank">Java Authentication and Authorization Service</a>. This service is the standard mechanism to secure JavaEE applications in an applicationserver. Of course you can try to use spring-security to achieve this goal too but a) this can&#8217;t be used to secure the whole process in the applicationserver (for example: webapp-&gt;slsb-&gt;queue-&gt;mdb) and b) this is out of scope.</p>
<p>At first you&#8217;ll need an JBossAS 5.1.0. You can download it here. I&#8217;m currently using the 5.1 in my project so my experiences (especially the issues/pitfalls) base on this version. The issues which I&#8217;m reporting about might be in other versions as well or might already be fixed in following versions. The most explanations are more general so I expect that they&#8217;ll be correct for other versions of the JBoss as well.</p>
<p>After downloading the archive you&#8217;ll find a file called login-conf.xml in the <em>[jboss_home]/server/default/conf/</em> directory. This file contains the security-domains which are available on the AS, such as: web-console, jmx-console and many others.</p>
<p><pre class="brush: xml;">

my-users.properties
my-roles.properties

</pre></p>
<p>This example entry is an application-policy. This policy contains the login-module <em>UsersRolesLoginModule</em>. This module is responsible for authenticating a user based on the provided password. It also provides the roles based on the authenticated principle. A <em>principal </em>is the provided username in the terminology of jaas, it is also named <em>identity</em>. There are some login-modules provided by JBoss, for example a DatabaseLoginModule, which authenticates/authorizes against a database. Some other allows a ldap-server as a backend or the authentication using certificates.</p>
<p>This UserRolesLoginModule uses files to authenticate and authorize the user. One is the my-users.properties and the other the my-roles.properties. Both are standard properties files with the format <em>key = value</em>. The first of them, the my-users.properties expects that the entries look like <em>username = password</em>:</p>
<p><pre class="brush: java;">
myuser = 123456
</pre></p>
<p>The second one expects the following format: <em>username = role1,role2,role3,&#8230;,rolen</em></p>
<p><pre class="brush: java;">
myuser = testrole1, testrole2
</pre></p>
<p>These both files have to be located in the <em>[jboss_home]/server/default/conf/</em>. The entries for the files in the login-conf.xml can be changed, but keep in mind that they&#8217;re relative to the <em>&#8230;/conf/</em> directory.</p>
<p>If you put this entry in login-conf.xml and the files in place you can start the JBossAS. If everything is okay you shouldn&#8217;t see any stacktraces. If there are errors have a look into the login-conf.xml. When the exception occures when starting the AS it&#8217;s only the login-conf.xml which could be wrong. The other both files are only accessed when an secured resource is accessed and related credentials are provided.</p>
<p>Now we have a JBossAS with a configured security domain. But we&#8217;ve got nothing to protect. The simplest way is to deploy a simple session bean with the needed annotations. At first we&#8217;ll create a standard and not secured sessionbean to see that everything works as expected:</p>
<p>Our sessionbean will just take one argument (your name) and will return a string <em>&#8220;Hello [your_name]&#8220;</em>.</p>
<p>The sessionbean:<br />
<pre class="brush: java;">
import javax.ejb.Remote;
import javax.ejb.Stateless;

@Stateless
@Remote(SayHello.class)
public class SayHelloBean {
public String sayHello(String name) {
return "Hello " + name;
}
}
</pre></p>
<p>The related remote interface:<br />
<pre class="brush: java;">
public interface SayHello {
public String sayHello(String name);
}
</pre></p>
<p>After deploying the bean and the interface in a jar to the deploy directory of the AS, it should show no exceptions.</p>
<p>The log or the console of the AS should show something similar to this:<br />
<pre class="brush: java;">
23:52:06,370 INFOÃ‚Â  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

SayHelloBean/remote - EJB3.x Default Remote Business Interface
SayHelloBean/remote-myea.beans.SayHello - EJB3.x Remote Business Interface
</pre></p>
<p>Now that your Bean is deployed successful we&#8217;ll switch to the client.</p>
<p><pre class="brush: java;">
...
public static void main(String[] args) throws Exception {
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");
InitialContext ctx = new InitialContext(env);
SayHello h = (SayHello) ctx.lookup("SayHelloBean/remote");
System.out.println(h.sayHello("Marc"));
}
...
</pre></p>
<p>This code should produce <em>&#8220;Hello Marc&#8221;</em>. If there are any failures please check if all the needed libraries are in the classpath or the settings are correct. Especially have a look on the <em>PROVIDER_URL</em> the wrong address is often a problem. Most people bind JBossAS to another IP-address to avoid binding errors for the 1099 port on windows systems which are connected to a domain.</p>
<p>If that&#8217;s successful we&#8217;ll try it &#8216;with security&#8217;. The sessionbean have to be changed:</p>
<p>The sessionbean with security:<br />
<pre class="brush: java;">
import javax.annotation.security.RolesAllowed;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import org.jboss.ejb3.annotation.SecurityDomain;

@Stateless
@Remote(SayHello.class)
@SecurityDomain("my-security")
@RolesAllowed({"testrole2"})
public class SayHelloBean {
public String sayHello(String name) {
return "Hello " + name;
}
}
</pre></p>
<p>The only changes are the both annotations: <em>@SecurityDomain(&#8220;my-security&#8221;)</em> and <em>@RolesAllowed({&#8220;testrole2&#8243;})</em>. The first activates security for this bean and connects to the &#8220;my-security&#8221; authentication-module. The next annotation define which roles have access to this class. It&#8217;s written in {} because it can contain several roles comma-seperated: <em>{&#8220;testrole1&#8243;,&#8221;testrole2&#8243;}</em></p>
<p>If you&#8217;re using an IDE it might be the case that the IDE can&#8217;t find the annotation SecurityDomain. This is an extension aside the ejb3-spec made by JBoss. To use it you have to add the <em>jboss-ejb3-ext-api.jar</em> from the <em>[jboss_home]/commons/lib/</em> folder. This jar contains several other very useful extensions to the ejb3-spec. But be warned, since this point you&#8217;re leaving the compliance to the ee-spec and you&#8217;ll tie yourself/your project to the JBossAS.</p>
<p>When you now try to connect using the client above it will result in this:</p>
<p><pre class="brush: java;">
Exception in thread "main" javax.ejb.EJBAccessException: Caller unauthorized
... (some more stacktrace) ...
</pre></p>
<p>Now we&#8217;ve got to modify the client as well:</p>
<p><pre class="brush: java;">
public static void main(String[] args) throws Exception {
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");

SecurityClient client = SecurityClientFactory.getSecurityClient();
client.setSimple("myuser", "123456");
client.login();

InitialContext ctx = new InitialContext(env);
SayHello h = (SayHello) ctx.lookup("SayHelloBean/remote");
System.out.println(h.sayHello("Marc"));
}
</pre></p>
<p>This client should produce the same output like the client without authorization. In this case I&#8217;ve used a very simple way to manage the authentication. Within one of the next parts of this article series I&#8217;ll show you the different ways to connect to a secured JBossAS.</p>
<p>Now you&#8217;ve made the first step in JBoss &amp; Security.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=36&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2010/04/16/jaas-jboss-authentication-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>
	</item>
		<item>
		<title>Clean-install of Liferay Portal Community Edition</title>
		<link>http://ebeyond01.wordpress.com/2010/01/05/clean-install-of-liferay-portal-community-edition/</link>
		<comments>http://ebeyond01.wordpress.com/2010/01/05/clean-install-of-liferay-portal-community-edition/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 10:32:48 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Liferay]]></category>
		<category><![CDATA[Portal]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.e-beyond.de/?p=17</guid>
		<description><![CDATA[The clean install of Liferay Portal Community Edition (V. 5.2.3) is fairly straight forward. At first you&#8217;ll need the portal. You can obtain it for free from the liferay-website. There you&#8217;ll find two versions on the download page: The Enterprise &#8230; <a href="http://ebeyond01.wordpress.com/2010/01/05/clean-install-of-liferay-portal-community-edition/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=17&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The clean install of Liferay Portal Community Edition (V. 5.2.3) is fairly straight forward.</p>
<p>At first you&#8217;ll need the portal. You can obtain it for free from the <a href="http://www.liferay.com/" target="_blank">liferay-website</a>. There you&#8217;ll find two versions on the <a href="http://http://www.liferay.com/web/guest/downloads/portal" target="_blank">download page</a>: The Enterprise Edition and the Community Edition. For this tutorial I&#8217;ll use the community edition.</p>
<p>After downloading the edition you&#8217;ll extract it to your favorite place.</p>
<p>When extracted you&#8217;ll find a liferay folder and within this folder you&#8217;ll find a tomcat folder. Within the webapps folder of the tomcat directory are two webapps: sevencogs-hook and sevencogs-theme. These both should be deleted. They belong to the demo-data which we didn&#8217;t want to install.</p>
<p>After removing these webapps you&#8217;ll change to the WEB-INF/classes of the ROOT webapp. Which is also located in the webapps folder of the tomcat. Within this folder you should create an portal-ext.properties. And fill it with these settings:</p>
<blockquote><p>jdbc.default.driverClassName=com.mysql.jdbc.Driver<br />
jdbc.default.url=jdbc:mysql://localhost/liferay?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false<br />
jdbc.default.username=liferay<br />
jdbc.default.password=&lt;password&gt;<br />
schema.run.enabled=true<br />
schema.run.minimal=true</p></blockquote>
<p>The first four lines define the database connection. The mentioned database and (of course) the user have to be created before starting the portal. Please adjust the database-settings for your needs. That means change databasename, host, username, password, etc. to the values you&#8217;ve got on your platform.</p>
<p>The last two lines are settings for the portal. The first activates the schema generation (tables etc. should be created) and the second is the setting which tells the portal only to insert only the minimal data for the portal. This setting set to true avoids that the demo-data is inserted in the database.</p>
<p>Now, that everything is done, you can start the portal using the startup script in the tomcat-&lt;version&gt;/bin/ directory.</p>
<p>After starting you can sign in using the default user/pass of liferay. Now you&#8217;ve got a clean installation of the &#8220;Liferay Portal Community Edition&#8221;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=17&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2010/01/05/clean-install-of-liferay-portal-community-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>
	</item>
		<item>
		<title>Copying objects recursively</title>
		<link>http://ebeyond01.wordpress.com/2008/05/08/copying-objects-recursively/</link>
		<comments>http://ebeyond01.wordpress.com/2008/05/08/copying-objects-recursively/#comments</comments>
		<pubDate>Thu, 08 May 2008 13:20:01 +0000</pubDate>
		<dc:creator>mende</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.e-beyond.de/?p=8</guid>
		<description><![CDATA[Dozer is a javabean to javabean mapper which recursively copies data from one object to another. Which is great if you have mappings from hibernate and want to &#8220;convert&#8221; the object to an dto.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=8&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://dozer.sourceforge.net/">Dozer</a> is a javabean to javabean mapper which recursively copies data from one object to another. Which is great if you have mappings from hibernate and want to &#8220;convert&#8221; the object to an dto.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ebeyond01.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ebeyond01.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ebeyond01.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ebeyond01.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ebeyond01.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ebeyond01.wordpress.com&amp;blog=32038926&amp;post=8&amp;subd=ebeyond01&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ebeyond01.wordpress.com/2008/05/08/copying-objects-recursively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/91081059e6b630adee1d9c66fd1f3770?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mende</media:title>
		</media:content>
	</item>
	</channel>
</rss>
