Questions tagged [runtimeexception]

RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Virtual Machine.

RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Virtual Machine.

1062 questions
13
votes
5 answers

Uncaught RuntimeException and finally clause: which comes first?

A RuntimeException is thrown in try block without being caught, while the finally clause invokes System.exit(). public static void main(String[] args) { try { Integer.valueOf("NotANumber"); } finally { …
chance
  • 6,307
  • 13
  • 46
  • 70
13
votes
5 answers

Send Object from Service to Activity (Can't marshal non-Parcelable)

I'm trying to send data from my activity to a service and receive some information back, but i'm getting: java.lang.RuntimeException: Can't marshal non-Parcelable objects across processes. The code from activity looks like this: Message msg =…
cmg_george
  • 309
  • 1
  • 2
  • 9
13
votes
4 answers

getActivity() call causes RuntimeException: Could not launch intent Intent act=android.intent.action.MAIN

Updated #1: more info added to the end of this post I'm new to Android development and testing. I have three Espresso tests. First test passes, but the second one will not run because the call to getActivity() in setUp() method before the second…
bmv2143
  • 734
  • 1
  • 8
  • 17
12
votes
5 answers

BluetoothAdapter.getDefaultAdapter() throwing RuntimeException while not in Activity

When I'm trying to get default bluetooth adapter while i'm NOT in Activity, but in TimerTask (created inside Service) by using: BluetoothAdapter.getDefaultAdapter(); I get the following exception: Exception while invoking…
Kocus
  • 1,613
  • 17
  • 31
12
votes
3 answers

UnsupportedOperationException is thrown with Lombok Builder annotation

I am using Lombok for my project. My model looks like: @Builder @Data @AllArgsConstructor public class ScreenDefinitionDTO { @Singular private List screens; } I want to do next operation: String screenName =…
catch23
  • 17,519
  • 42
  • 144
  • 217
12
votes
1 answer

Is it correct behaviour that `lazy val` acts like `def` in case of exception?

I've noticed that lazy val repeats computation several times (in case of exception): scala> lazy val aaa = {println("calc"); sys.error("aaaa")} aaa: Nothing = scala> aaa calc java.lang.RuntimeException: aaaa at…
dk14
  • 22,206
  • 4
  • 51
  • 88
12
votes
8 answers

Popup Menu in custom ListView

What I want to achieve: I have a custom ListView adapter. To each Listitem I want to add a popup menu, pretty similar to the ListView in the current Google Play application. This is what I tried: Most of my code comes from this Android sample…
Al0x
  • 917
  • 2
  • 13
  • 30
12
votes
12 answers

Google Espresso java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN

I am new to Espresso UI testing. I am getting this error while running tests (ADT Eclipse IDE ). The app is already developed and there are lots of request going on while launching the app. it is not possible to rewrite the app. but i need to find…
user3241003
  • 121
  • 1
  • 1
  • 4
12
votes
2 answers

Why this Error occurred? java.lang.RuntimeException: ImageLoader must be init with configuration before using

I have downloaded one ImageDownloader code from gitHub(from Here) Now when I am trying to download the image from my webservice I am getting this Runtime Exception "ImageLoader must be init with configuration before using". I am not able to figure…
AndroidLearner
  • 4,500
  • 4
  • 31
  • 62
11
votes
3 answers

Resources Not Found Exception (Unable to find resource ID) even though resources exist in drawable folder

I'm getting this crash report in Crashlytics: Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.activities.TabActivity}: android.view.InflateException: Binary XML file line #27:…
11
votes
2 answers

java.lang.RuntimeException: Cannot initialize effect engine for type: 0bed4300-ddd6-11db-8f34-0002a5d5c51b Error: -3

I am getting the following error in my equalizer app on Android MarshMellow, OnePlus. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app.name/com.my.app.name.activity.MainActivity}: java.lang.RuntimeException: Cannot…
varunkr
  • 5,364
  • 11
  • 50
  • 99
11
votes
4 answers

SEVERE: Unable to create initial connections of pool - tomcat 7 with context.xml file

I tried to run project on tomcat 7.0.52 and initialize to DB through context.xml file. But it throws bunch of exceptions, I couldn't figure out what is wrong there. Here is console output: java.sql.SQLException: com.mysql.jdbc.Driver at…
catch23
  • 17,519
  • 42
  • 144
  • 217
10
votes
4 answers

How to verify that all own thrown runtime exceptions are covered in Javadoc?

I throw a bunch of custom runtime exceptions in my code and I want to make sure that in all public methods, I document which runtime exception might be thrown (by myself) and why. This would be very hulpful since I'm maintaining a library which is…
Benny Bottema
  • 11,111
  • 10
  • 71
  • 96
10
votes
8 answers

Unable to connect to Command Metric Stream for Hystrix Dashboard with Spring Cloud

I have microservices project with Spring Cloud, the snippet from parent: org.springframework.boot spring-boot-starter-parent
catch23
  • 17,519
  • 42
  • 144
  • 217
10
votes
2 answers

Please explain RuntimeException in Java and where it should be used

I am following this great discussion at SO, titled: The case against checked exceptions , but I am unable to follow where exactly RuntimeException should be used and how it is different from normal Exceptions and its subclasses. Googling gave me a…
euphoria83
  • 14,768
  • 17
  • 63
  • 73