Questions tagged [illegalargumentexception]

An exception that indicates that the arguments supplied to a method or function are not valid for their intended purpose, or are different to the format expected by the method.

An exception that indicates that the arguments supplied to a method or function are not valid for their intended purpose, or are different to the format expected by the method.

This could occur as a result of many different actions, such as...

  1. You are calling a method that accepts a low-level object type for an argument (such as Object) but you're passing an object that is not one of the types expected by the method. For example, the method might be declaring the argument as an Object so that it can capture a range of different objects in the one method, but the code implementation of the method only allows objects of certain types (such as expecting a Number-based object, and you're passing a String).
  2. You're using methods that are building a dynamic structure for use in a different context, and the argument that you're passing is not valid for the other context. For example, you might be building an SQL statement, and you're passing an argument as a String for a database field that expects a Number. The database context would detect the error and report back the exception.

This type of exception may be hard to predict, as it won't be detected at compile-time, and may only show up under certain circumstances.

965 questions
3
votes
1 answer

Android: Unable to pause activity : java.lang.IllegalArgumentException: Service not registered:

I got this error when I pressed the Home button in Android Emulator. java.lang.RuntimeException: Unable to pause activity {com.thesis.dic_ta_han/com.thesis.dic_ta_han.MainActivity}: java.lang.IllegalArgumentException: Service not registered:…
3
votes
2 answers

ElasticSearch Illegal Argument Exception

I'm using Elasticsearch latest version on Ubuntu 16.04 and I'm having a little issue on putting data on it. here is my json document (relevant part of it) { "products" : { "232CDFDW89ENUXRB" : { "sku" : "232CDFDW89ENUXRB", …
3
votes
2 answers

Caused by: java.lang.IllegalArgumentException: unknown reserved key '_typeConverter'

I am getting the below error while I am trying to login to my Struts application. This is occurring after upgrading my Struts libraries to latest. Please share any information which will help me fix this. Previous version of Struts was 2.3.10. The…
3
votes
2 answers

Android broadcast receiver not registered error

I have used Intent to open Location Settings menu to enable gps in my Activity.After calling Intent I have used a Service to listen to the location updates.I sent two BroadcastReceivers from Service to Activity.In the onResume() method of the…
jobin
  • 1,489
  • 5
  • 27
  • 52
3
votes
0 answers

Failure(java.lang.IllegalArgumentException: Illegal base64 when decoding jwt token with jwtCirce

I am currently trying to build an oAuth 2 authentication inside some akka-http service. I want to use jwt-scala with jwtCirce for decoding a web token. When trying it out in the console (as well as inside my tests) I get the error…
Stoecki
  • 585
  • 1
  • 3
  • 16
3
votes
0 answers

Titan -- java.lang.IllegalArgumentException - creating relationship

I am trying to create relationships in titan and trying to give an array with the properties at creation. while (startNode.hasNext()) { Vertex tempVertex = startNode.next(); while (endNode.hasNext()) { …
raycons
  • 735
  • 12
  • 26
3
votes
1 answer

Java program won't throw the desired exception

I'm trying to develop a Card Validation program in Java. The isCardValid method basically checks if a given Card number is valid or not. I have specified a condition there that should throw an IllegalArgumentException, but it doesn't & the program…
Auro
  • 1,578
  • 3
  • 31
  • 62
3
votes
1 answer

Glide error: java.lang.IllegalArgumentException - You must call this method on a background thread

I'm using glide to load an image using its resource ID into a bitmap, and I want to pass the bitmap to a member function of a custom view class. This is my code: try { Bitmap bm=Glide. with(getApplicationContext()). …
3
votes
1 answer

java.lang.IllegalArgumentException: Cannot set to com.sun.proxy.$Proxy

I am working on a web-app with Spring MVC. This is the exception I am getting: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException:…
3
votes
2 answers

java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name

When I try run my project I get error Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name dispatcher at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3156) at…
Narkan
  • 31
  • 1
  • 1
  • 2
3
votes
3 answers

Unable to destroy activity: java.lang.IllegalArgumentException: No view found for id () for fragment

I have an activity YYYY (which inflates a fragment) that extends a base activity XXXX which in turn extends ActionBarActivity. I now call finish() in onCreate() method of XXXX (at the very top), based on some condition. But I get the exception…
Henry
  • 17,490
  • 7
  • 63
  • 98
3
votes
2 answers

IllegalArgumentException - WindowManagerGlobal.java

I catch many crashes in crashlitycs, but I dont know - where did these crashes? Help please, becouse its big problem for me.
MyNameIs
  • 832
  • 1
  • 8
  • 19
3
votes
2 answers

HHH000122: IllegalArgumentException in class: ConsumerAgentAccount, getter method of property: id

Help! After a lot of research on this site and on the internet in general, I have been unable to find a solution. I have a Hibernate 4.3.6/Glassfish 4.0 project that deploys fine, but throws an IllegalArgumentException when I try to persist a new…
javaeeguy
  • 51
  • 1
  • 7
3
votes
1 answer

ViewPager: java.lang.IllegalArgumentException: pointerIndex out of range

I am writing an code to handle touch event based on what suggested here. I am using ViewPager as an ViewGroup and ListView(I know #thisbad) as child view of Fragment. This is what I wanted to achieve: Detect multitouch event on child view then…
CoDe
  • 11,056
  • 14
  • 90
  • 197
3
votes
2 answers

Spinner Error "Spinner adapter view type count must be 1"

I am using Parse.com in my application when I use ParseQueryAdapter in fragment to retrieve data and pass to a spinner an error as java.lang.IllegalArgumentException: Spinner adapter view type count must be 1 and application stops. However if I try…