Author: 똘켓

Java

[JAVA] 세션정보(session)를 가져오는 방법

1. 세션정보 가져오는 방법  ServletRequestAttributes servletRequestAttribute = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpSession httpSession = servletRequestAttribute.getRequest().getSession(true);   2. 스프링 시큐리티 사용중인 경우 세션정보...
Android

Caused by: java.lang.SecurityException: Permission Denial: startForeground from pid=6412, uid=10599 requires android.permission.FOREGROUND_SERVICE

2019-04-06 23:57:25.081 6412-6419/? E/eusingvibratio: Failed to send DDMS packet REAQ to debugger (-1 of 20): Broken pipe 2019-04-06 23:57:34.693 6412-6412/ddolcatmaster.bodymassageusingvibration E/AndroidRuntime: FATAL EXCEPTION: main     Process: ddolcatmaster.bodymassageusingvibration, PID: 6412     java.lang.RuntimeException: Unable to create service ddolcatmaster.bodymassageusingvibration.BatteryNotificationService: java.lang.SecurityException: Permission Denial: startForeground from pid=6412, uid=10599 requires android.permission.FOREGROUND_SERVICE         at android.app.ActivityThread.handleCreateService(ActivityThread.java:3587)         at android.app.ActivityThread.access$1300(ActivityThread.java:204)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1674)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:193)         at android.app.ActivityThread.main(ActivityThread.java:6853)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)      Caused by: java.lang.SecurityException: Permission Denial: startForeground from pid=6412, uid=10599 requires android.permission.FOREGROUND_SERVICE         at android.os.Parcel.createException(Parcel.java:1950)         at android.os.Parcel.readException(Parcel.java:1918)         at android.os.Parcel.readException(Parcel.java:1868)         at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:5080)         at android.app.Service.startForeground(Service.java:695)         at ddolcatmaster.bodymassageusingvibration.BatteryNotificationService.onCreate(BatteryNotificationService.java:34)...