TCP hole punching 모듈이 있어서 테스트 하려고 다운받으니 jar로 되어 있다.


홈페이지에서 하라는대로 다 하고 android에서 실행하려니 Exception 발생


03-27 16:10:46.123: E/AndroidRuntime(16929): FATAL EXCEPTION: main

03-27 16:10:46.123: E/AndroidRuntime(16929): java.lang.ExceptionInInitializerError

03-27 16:10:46.123: E/AndroidRuntime(16929): at com.ahope.test_tcp_hole.MainActivity.onClick(MainActivity.java:34)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.view.View.performClick(View.java:4114)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.view.View$PerformClick.run(View.java:17097)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.os.Handler.handleCallback(Handler.java:615)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.os.Handler.dispatchMessage(Handler.java:92)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.os.Looper.loop(Looper.java:137)

03-27 16:10:46.123: E/AndroidRuntime(16929): at android.app.ActivityThread.main(ActivityThread.java:4885)

03-27 16:10:46.123: E/AndroidRuntime(16929): at java.lang.reflect.Method.invokeNative(Native Method)

03-27 16:10:46.123: E/AndroidRuntime(16929): at java.lang.reflect.Method.invoke(Method.java:511)

03-27 16:10:46.123: E/AndroidRuntime(16929): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)

03-27 16:10:46.123: E/AndroidRuntime(16929): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)

03-27 16:10:46.123: E/AndroidRuntime(16929): at dalvik.system.NativeStart.main(Native Method)

03-27 16:10:46.123: E/AndroidRuntime(16929): Caused by: java.lang.ExceptionInInitializerError

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)

03-27 16:10:46.123: E/AndroidRuntime(16929): at de.htwg_konstanz.in.uce.hp.parallel.target.HolePunchingTarget.<clinit>(HolePunchingTarget.java:51)

03-27 16:10:46.123: E/AndroidRuntime(16929): ... 12 more

03-27 16:10:46.123: E/AndroidRuntime(16929): Caused by: java.lang.VerifyError: org/apache/log4j/config/PropertySetter

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:772)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)

03-27 16:10:46.123: E/AndroidRuntime(16929): at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)

03-27 16:10:46.123: E/AndroidRuntime(16929): ... 16 more


apache의 log4j를 android에서 사용할 수 없다는 것인데...


찾아보니 android에서 직접 사용하는것에 대한 예제와 해결방법은 많은데 내가 원하는것은 없었다..



java 소스를 git로 받아서 로그 출력하는 부분을 주석처리 할까 하다가, jar에 있는 class파일을 변경하면 되지 않을까란 생각이 들었다.


http://www.slf4j.org/download.html 사이트에서 수정된 jar파일을 받아 class파일을 원래 jar에 적용하니 잘 작동한다.






+ Recent posts