Category Archives: Java

Maven: install local jar to repository

Adding local jar to maven repository.

Syntax: 

Example:

 

Install Oracle JDK 7 on Ubuntu 13.10

Install JDK from repository (oracle-java7-installer from this ppa is JDK)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Set this version to be used by default
sudo update-java-alternatives -s java-7-oracle
Set up environment variables
sudo apt-get install oracle-java7-set-default

Glassfish 4 and Postgresql 9.3 driver

Today I configured another development stend for our team. This time I added Postgresql 9.3 ODBC driver support to our Glassfish 4 server. What should I do to repeat this actions:

Put Postgresql driver to Glassfish domain lib folder

This link contains the latest PostgreSql driver: http://jdbc.postgresql.org/download.html  I got the postgresql-9.3-1100.jdbc41 one. 
Copy downloaded driver to GLASSFISH_HOME/domains/YOUR_DOMAIN/lib, for example to /opt/glassfish4/domains/domain1/lib
Restart Glassfish

Continue reading

How to install JBoss AS on Ubuntu

Today I installed JBoss AS 7.1 on our Ubuntu 13.04 stend. I'm sure it is not the last time when I prepare JBoss application server, so I decided to memorize my steps in this post.

The installation procedure is:

Install JDK 7

Install JDK from repository (oracle-java7-installer from this ppa is JDK)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Set this version to be used by default
sudo update-java-alternatives -s java-7-oracle
Set up environment variables
sudo apt-get install oracle-java7-set-default

Continue reading

Spring MVC 3.1.1 and Apache Tiles 2 on JBoss AS 7.1 with Hibernate and JTA

Last week I spent some time to bring together Spring MVC, Apache Tiles, Hibernate+JPA with JTA. 

My EAR application consists of two modules: WAR and EJB project. 

WAR project: Spring MVC 3.1.1, Apache Tiles,Maven

EJB project: Hibernate through JPA, Spring 3.1.1, JBoss AS 7.1, JTA data source, Maven.

Configuration artifacts are:

Pom.xml in war project

Contains Spring MVC and Apache Tiles dependencies

Continue reading

JFreeChart: CandlestickChart example

From time to time I use JFreeChart library. This is a CandlestickChart sample to copy paste from here in future.

Maven dependencies in pom.xml

<dependency>
   <groupId>jfree</groupId>
   <artifactId>jcommon</artifactId>
   <version>1.0.16</version>
</dependency>
<dependency>
   <groupId>jfree</groupId>
   <artifactId>jfreechart</artifactId>
   <version>1.0.13</version>
</dependency>
 

 

Continue reading