java.lang.RuntimeException Cannot find FacesContext

java.lang.RuntimeException: Cannot find FacesContext Thus, the JSF <f:xxx> and <h:xxx> tags are complaining that FacesContext cannot be found. The FacesServlet is the one responsible for creating the faces context. The faces servlet is invoked when the request URL matches its URL pattern, which is in your particular case *.jsf. So, when you open the index.jsp … Read more

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’ in android studio

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_79\bin\java.exe” finished with non-zero exit value 1 The upper error occure due to lot of reason. So I can put why this error occure and how to solve it. REASON 1 : Duplicate of class file name SOLUTION : when your … Read more

Differences between Runtime/Checked/Unchecked/Error/Exception

Since I am a new Java developer, I have also faced some difficulties for distinguishing and dealing with different types of exceptions. That is why I have made a short note on this topic, and whenever I get confused I go through it. Here it is with the image of the Throwable class hierarchy: [image … Read more

Checked vs Unchecked exception

Unchecked exceptions are those that extend RuntimeException class. Compiler will never force you to catch such exception or force you to declare it in the method using throws keyword. All other exception types (that do not extend RuntimeException) are checked and therefore must be declared to be thrown and/or catched. Checked exceptions are used when … Read more

Can’t create handler inside thread which has not called Looper.prepare()

The error is self-explanatory… doInBackground() runs on a background thread which, since it is not intended to loop, is not connected to a Looper. You most likely don’t want to directly instantiate a Handler at all… whatever data your doInBackground() implementation returns will be passed to onPostExecute() which runs on the UI thread. mActivity = … Read more

Unable instantiate android.gms.maps.MapFragment

In IntelliJ IDEA (updated for IntelliJ 12): Create a file ~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/src/dummy.java containing class dummy {}. File->Import Module-> ~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib Create Module from Existing Sources Next->Next->Next->Next->Finish File->Project Structure->Modules->YourApp +->Module Dependency->Google-play-services_lib (The + button is in the top right corner of the dialog.) +->Jars or directories->~/android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar Use the up/down arrows to move <Module source> to the bottom of … Read more