Sunday, September 27, 2015

Create execute file java wrrapper



#!/bin/sh

cd $(dirname $0)
java  -cp jar1_path:jar2_path MainClassOfJar $@

Friday, September 11, 2015

Caused by: net.sf.ehcache.CacheException: Can't assign requested address

If you using Mac, Payara or Glassfish, when you use EHCache, maybe this error occurs:

Caused by: net.sf.ehcache.CacheException: Can't assign requested address

Solution:
add

-Djava.net.preferIPv4Stack=true

to JVM Options

That's all!

Good luck!

Friday, August 14, 2015

Install Tor proxy on Mac

1. Install latest Command Line Tools from Apple Store at https://developer.apple.com/downloads

2. Install libevent from http://libevent.org
  • Download libevent compressed file
  • Extract and point to folder
  • compile using command: ./configure && make
  • install using command: sudo make install
3. Install Tor
  • download Tor source from  https://www.torproject.org/download/download (choose Source Code section)
  • extract and point to folder
  • compile using command: ./configure && make
  • run using command: src/or/tor
You can config all network using Tor proxy by config SOCK proxy on Network section for current internet interface.

Thursday, July 23, 2015

Connect internet when VPN



Open Network Connections Manager, choose your VPN connection, click on Routes... button



If your VPN network in 10.x.x.x you can setup like this


Disconnect VPN and reconnect, you can access internet with it.

Monday, July 13, 2015

Default iptables rules when install ireadmail

When I install iredmail, the default iptables rule file has created in /etc/default/iptables

Please careful when edit it because it can block access to your system.


Sunday, June 28, 2015

Blank screen when access web admin on Payara

When you config Realm on Payara, sometimes it add default-principal="admin" into tag <security service> look like

<security-service default-principal-password="yourpasswordherer" default-principal="admin">


remove default-principal="admin" and issue will be gone

correct line:
<security-service default-principal-password="yourpasswordherer">

Good luck

Monday, February 9, 2015

WELD-001408 Unsatisfied dependencies ...

Problem

Can not deploy web application, web server raise error: WELD-001408: Unsatisfied dependencies for type SessionBean with qualifiers @Default ....

Cause

Lack of file beans.xml (I cannot why that file must exist for resolving issue). This is one of popular purposes to resolve.

Solution

Create file beans.xml and put it same location of web.xml

The content of beans.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
   
</beans>
That's all.

Reference

http://docs.jboss.org/weld/reference/latest/en-US/html/injection.html