<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Java - Tag - Arkadios Tsamourliadis</title><link>http://arkadios.me/tags/java/</link><description>Java - Tag - Arkadios Tsamourliadis</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 18 Aug 2015 00:00:00 +0000</lastBuildDate><atom:link href="http://arkadios.me/tags/java/" rel="self" type="application/rss+xml"/><item><title>Habit@weave Java AAL app</title><link>http://arkadios.me/post/Habit@weave-Java-application-for-OpenShift/</link><pubDate>Tue, 18 Aug 2015 00:00:00 +0000</pubDate><author>Arkadios Tsamourliadis</author><guid>http://arkadios.me/post/Habit@weave-Java-application-for-OpenShift/</guid><description><![CDATA[<p>OpenShift is Red Hat&rsquo;s Platform-as-a-Service (PaaS) that allows developers to quickly develop, host, and scale applications in a cloud environment. It has decent documentation and relatively steep learning curve. It also provides free hosting + free MySQL DB up to 1 GB, which is aweosome!</p>
<p>After installing <code>Ruby</code> and <code>RHC</code> - Openshift&rsquo;s client tool, by following <a href="https://developers.openshift.com/en/getting-started-overview.html" target="_blank" rel="noopener noreffer ">these</a> steps, you can start creating a Java web application following <a href="https://developers.openshift.com/en/tomcat-getting-started.html" target="_blank" rel="noopener noreffer ">these</a> steps.</p>
<h1 id="habitweave">Habit@weave</h1>
<p>Habit@weave is a web application for the control and monitoring smart homes and wearable devices.
The power consumption graphs and the capability to schedule actions can help the user to make the right decisions for efficient energy saving at home, while the calorie consumption and sleep quality charts may contribute to adoption of habits that improve heath. The user can use the application from a PC, as well as from any other portable device with access to the Internet. It is an initial effort towards a functional Ambient Assisted Living system.
It&rsquo;s also a good starting point for any Java web application with Hibernate JPA and Shiro security frameworks.</p>
<h2 id="demo">Demo</h2>
<p>A demo of the application&rsquo;s runs here <a href="http://habitat-atsamour.rhcloud.com" target="_blank" rel="noopener noreffer ">http://habitat-atsamour.rhcloud.com</a>.
To try the application use these credentials:</p>
<ul>
<li>E-mail: <code>test2@gmail.com</code></li>
<li>Password: <code>1234</code></li>
</ul>
<h2 id="source">Source</h2>
<p>The application&rsquo;s git repo is <a href="https://github.com/atsamour/Habit-at-weave_openshift-MySQL" target="_blank" rel="noopener noreffer ">here</a>.
You can find the sample database used in the application at the <a href="https://s3-eu-west-1.amazonaws.com/atsamourfiles/awesomedb%28openshift-MySQL-5.5%29.zip" target="_blank" rel="noopener noreffer ">amazon cloud</a> (add a database named <code>awesomedb</code> to the OpenShift MySQL Cartridge and import tables there).</p>
<p>The folders are organized as a Maven project. Backend is written in Java using javax.servlet API, frontend is based on Bootstrap and implemented with JSP views.</p>
<p>

</p>
]]></description></item><item><title>Heroku Java example</title><link>http://arkadios.me/post/heroku-java-example/</link><pubDate>Mon, 10 Aug 2015 00:00:00 +0000</pubDate><author>Arkadios Tsamourliadis</author><guid>http://arkadios.me/post/heroku-java-example/</guid><description><![CDATA[<p>Here <a href="https://github.com/atsamour/Heroku-java-example" target="_blank" rel="noopener noreffer ">https://github.com/atsamour/Heroku-java-example</a> you can find a sample Java web project for <a href="https//www.heroku.com" rel="">Heroku</a> PaaS cloud. You can also run it locally with only JRE and Maven installed, as it doesn&rsquo;t requre a seperate application container. It evaluates Heroku&rsquo;s <a href="http://github.com/jsimone/webapp-runner" target="_blank" rel="noopener noreffer ">open source</a> with embedded Tomcat.</p>
<h2 id="to-run-locally">To run locally</h2>
<p>First you have to git pull the repo to your PC, then build the application running this command from the local project folder:</p>
<pre><code>:::term
$ mvn package
</code></pre>
<p>And then you just run the application by using the java command:</p>
<pre><code>:::term
$ java -jar target/dependency/webapp-runner.jar target/*.war
</code></pre>
<p>If everything worked correctly, your application should be accessible at <code>localhost:8080</code>.</p>
<h2 id="to-run-on-heroku-cloud">To run on Heroku cloud</h2>
<p>First create a Heroku account, install Heroku Toolbelt as described <a href="https://devcenter.heroku.com/articles/getting-started-with-java#set-up" target="_blank" rel="noopener noreffer ">here</a>, then deploy the app on Heroku as described <a href="https://devcenter.heroku.com/articles/getting-started-with-java#deploy-the-app" target="_blank" rel="noopener noreffer ">here</a>.
If everything worked correctly, your should see the application in your browser.</p>
<h3 id="to-deploying-a-jar-filer-that-doesnt-exist-at-maven-repository">To deploying a jar filer that doesn&rsquo;t exist at Maven repository</h3>
<p>Download and put the .jar (e.g.) file to the project&rsquo;s folder (e.g. C:\Users\username\Dropbox\heroku-examples\appfolder)
Then call mvn deploy:deploy-file to actually deploy the jar to <code>repo</code> folder:</p>
<pre><code>:::term
mvn deploy:deploy-file -Durl=file:///C:\Users\username\Dropbox\heroku-examples\appfolder\repo\ -Dfile=json-taglib-0.4.1.jar -DgroupId=atg.taglib.json -DartifactId=json-taglib -Dpackaging=jar -Dversion=0.4.1
</code></pre>
<p>You are ready to add this dependancy to your main pom file as any other.
more info here: <a href="https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html" target="_blank" rel="noopener noreffer ">https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html</a>, <a href="https://devcenter.heroku.com/articles/local-maven-dependencies" target="_blank" rel="noopener noreffer ">https://devcenter.heroku.com/articles/local-maven-dependencies</a>s</p>
]]></description></item></channel></rss>