2016.01.18 18:41

Exception on batch processing UnexpectedRollbackException - Transaction rolled back

ServiceA에 @Transactional 설정. ServiceB에 @Transactional 설정.

Controller -> ServiceA -> ServiceB 호출.

ServiceB에서 exception throw, ServiceA에서 try-catch로 예외를 잡아서 처리.

Controller에서 "transaction rolled back because it has been marked as rollback-only" 예외 발생.

구글링 결과 propagation required가 문제(스프링은 기본값으로 required).

결과적으로 ServiceB의 @Transactional을 삭제. 정상적으로 동작하는 것 확인!


[참고] Exception on batch processing UnexpectedRollbackException - Transaction rolled back

Trackback 0 Comment 0
2015.12.15 11:09

윈도우에서 사용중인 포트 확인 후 죽이기

포트 확인


PID 찾기


프로세스 죽이기 (관리자 권한으로 실행)


[출처] Windows 사용 중인 포트 확인 후 죽이기

Trackback 0 Comment 0
2015.10.15 17:55

아파치 SSL 인증서에서 비밀번호 삭제하기

Every once in a while I run across an SSL Cert with an included password. Although the security is great automating an environment or an Apache restart with required interaction is problematic.


Here is an example of the interaction with a password included SSL Cert:

---------------------------------------------------------------

[root@w2 conf.d]# /etc/init.d/httpd restart

Stopping httpd:                                            [  OK  ]

Starting httpd: Apache/2.2.8 mod_ssl/2.2.8 (Pass Phrase Dialog)

Some of your private key files are encrypted for security reasons.

In order to read them you have to provide the pass phrases.

Server chrisschuld.com:443 (RSA)

Enter pass phrase:

OK: Pass Phrase Dialog successful.


And here is how you remove the password:

---------------------------------------------------------------

[root@w2 conf]# openssl rsa -in chrisschuld.com.key -out chrisschuld.com.key.nopass


[출처] REMOVING THE PASSWORD ON AN APACHE SSL CERTIFICATE

Trackback 0 Comment 0
2015.10.02 09:17

이미지를 url을 통해 load 하기

1. 이미지를 load하는 asynctask 추가

private class DownloadImageTask extends AsyncTask {
	ImageView bmImage;

	public DownloadImageTask(ImageView bmImage) {
		this.bmImage = bmImage;
	}

	protected Bitmap doInBackground(String... urls) {
		String urldisplay = urls[0];
		Bitmap mIcon11 = null;
		try {
			InputStream in = new java.net.URL(urldisplay).openStream();
			mIcon11 = BitmapFactory.decodeStream(in);
		} catch (Exception e) {
			Log.e("Error", e.getMessage());
			e.printStackTrace();
		}
		return mIcon11;
	}

	protected void onPostExecute(Bitmap result) {
		bmImage.setImageBitmap(result);
	}
}


2. ListView의 getView에서 호출

new DownloadImageTask(imageView).execute("url.....");


[출처] Load image from url

Trackback 0 Comment 0
2015.08.06 17:11

안드로이드 투명도 코드

투명도 적용전

<color name="black">#000000</color>

투명도 적용후

<color name="black">#99000000</color> 


Hex Code

100% — FF

95% — F2

90% — E6

85% — D9

80% — CC

75% — BF

70% — B3

65% — A6

60% — 99

55% — 8C

50% — 80

45% — 73

40% — 66

35% — 59

30% — 4D

25% — 40

20% — 33

15% — 26

10% — 1A

5% — 0D

0% — 00

Trackback 0 Comment 0