Jūs esate


Docker on Ubuntu - not working

Today I've installed Docker into my Ubuntu Linux 15.04 according to official documentation (note here: after installation I've executed  sudo usermod -aG docker <my_username_here> because I want to execute Docker as a non-root user).

However, when I tried to do docker docker run hello-world I got:

ernestas@ernestas-VirtualBox:~$ docker run hello-world

Keytool: Most Common Commands

I'm using Java's keytool command for working with keystores and Public-Private keys. So, I found a very good site about keytool command:

The Most Common Java Keytool Keystore Commands

java.lang.ClassNotFoundException: javax.servlet.AsyncContext

I updated my project to Spring 4 and got error:

java.lang.ClassNotFoundException: javax.servlet.AsyncContext

After some googling I found the problem: AsyncContext was introduced into Servlet API 3.0, but I was using Servlet API 2.5. So, the solution is simple - add the following Maven dependency:

Could not find the required version of the Java(TM) 2 Runtime Environment

Today I wanted to install Java EE 7 SDK. I downloaded installer from Oracle's website and when I wanted to run it - I got an error, saying "Could not find the required version of the Java(TM) 2 Runtime Environment".
Ok, I know that I must have Java JRE to run installer of Java EE. But I have Java JRE... So... After some googling I found a solution - to run installation with option -j :

> java_ee_sdk-7-jdk7-windows-x64.exe -j "C:\Program Files\Java\jdk1.7

How to generate public/private keypair with RSA?

I'm developing several projects which use public/private key cryptography. So, the question is simple: how to generate public/private key pair?

As for me, I use OPENSSL to generate RSA key pair. It's simple:

openssl genrsa -out mykey.pem 2048

And public key can be generated like this:

openssl rsa -in mykey.pem -pubout > mykey.pub

OCJAP 7. Tip 1: int ArrayList is valid name for variable

I'm currently preparing for Oracle Certified Associate, Java SE 7 Programmer (OCJAP 7) exam So, I would like to post some tips for myself and probably others.

Tip for today is quite simple: any class name might be used as variable name. For instance:

[geshifilter-java] // These are valid identifiers int ArrayList; boolean Boolean; char String; // ... public class TestSimple {} double TestSimple; [/geshifilter-java]

How to load Spring Application context for jUnit from WEB-INF?

I'm using jUnit for writing unit tests for my applications.

It's easy to load applicationContext.xml when it's in classpath:

[geshifilter-java] @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath*:applicationContext.xml"}) public abstract class DefaultApplicationContext { // Code [/geshifilter-java]

But how to load application context not from classpath, but from custom directory, for example WEB-INF?

Solution is to use Maven's path:

Default log4j.properties file

I have a problem - I always forget how to initialize Log4 module.

So, I always do some googling and always land at the same page: Short introduction to Log4j.

To save some time, here is example configuration for log4j.properties:

Spring login form

I want to create a simple Spring application with login form. So, I'm looking for web sites which could help me. Here are they:
http://teja.tejakantamneni.com/2008/08/spring-security-using-custom.html - custom Spring authentication.
http://blog.richardadamdean.com/?p=213 - another example of custom Spring authentication.

HTML5's <video> tag and web browsers

HTML5 is becoming more and more popular technology on the Internet. You won’t need Adobe Flash anymore :) HTML5 has <video> tag which lets you play video in your web browser. So, lets play some videos!

Video tag
Usage of HTML5 <video> tag is very simple - just define the name of your video file in src tag ant that’s it :) For example:

<video width="320" height="240" controls="controls">
  <source src="movie.mp4" type="video/mp4" />
 Your browser does not support the video tag.


Subscribe to Programavimas