Questions tagged [invocationtargetexception]

InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor.

InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor.

233 questions
48
votes
2 answers

Enable/disable data connection in android programmatically

I want to enable/disable the data connection programmatically. I've used the following code: void enableInternet(boolean yes) { ConnectivityManager iMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); Method iMthd =…
JiTHiN
  • 6,548
  • 5
  • 43
  • 69
35
votes
4 answers

Java Heap Dump error - Metadata does not appear to be polymorphic

I get this Stacktrace when trying to take a heap dump from a running Java process. What causes this and what do I have to do to make a proper heap dump? Dumping heap to dump.bin ... Exception in thread "main"…
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
19
votes
1 answer

Why am I getting an InvocationTargetException? Android 2D game

I am making a 2D game in Android with Cocos2D, written in Java. Here is my code for the main stuff: public void gameLoop(float dt) { //Player Gravity if(canExecuteMovement(0, 6)) { guy.moveY(6); } //Player Movement …
Qasim
  • 1,686
  • 4
  • 27
  • 51
10
votes
4 answers

When is InvocationTargetException.getCause() null?

As per the javadocs, InvocationTargetException.getCause() can be null: Returns the cause of this exception (the thrown target exception, which may be null). But the documentation also says that it wraps an existing…
Miserable Variable
  • 28,432
  • 15
  • 72
  • 133
8
votes
5 answers

Re-throw an InvocationTargetException target exception

How does one re-throw the target exception of an InvocationTargetException. I have a method which uses reflection to call the invoke() method within one of my classes. However, if there is an Exception thrown within my code, I am not concerned about…
Vincent Catalano
  • 2,259
  • 4
  • 22
  • 29
7
votes
0 answers

How to prevent Error inflating class com.google.android.exoplayer2.ui.PlayerView?

Exoplayer2 is working fine in devices like Samsung, Vivo, Xiaomi, etc on both release and debug build. But when I have released my app on the play store, it is throwing errors on some devices like nexus, pixel phones. Crashlytics showing this error:…
7
votes
1 answer

getting java.lang.reflect.InvocationTargetException while adding a button to layout

I am totally new in javafx!! I tried a very very simple code and I got stuck. when I tried to add a button to the layout It does not work. I know this question may be too simple but I really do not know how to fix it. I would appreciated if you…
Mehdi
  • 73
  • 1
  • 1
  • 5
7
votes
1 answer

Breakpoints and Exceptions stopped working properly, xamarin android

I am developing app in Xamarin Android and have a very strange problem: Breakpoints and Exceptions have stopped working properly. When I set a breakpoint it never gets hit. I have set breakpoints all over my project but none of them were hit. This…
Nika Kurdadze
  • 2,502
  • 4
  • 18
  • 28
4
votes
1 answer

I'm getting an java.lang.reflect.InvocationTargetException exception in JavaFX app and I have no idea how to fix it

I'm building a small D&D side project, but having trouble navigating my way through JavaFX. I'm attempting to move through several scenes while remaining on the same stage. I'm using an MVC design and passing though the primaryStage whenever the…
4
votes
0 answers

Java web start InvocationTargetException with java 9 ea

We have a java web start application that's working on java 8, but when running on Java 9 it crashes. The application loads a new JavaFx scene that contains a webview which shows a web page that contains a menu, that menu contains different buttons,…
4
votes
1 answer

Javadoc error - java.lang.reflect.InvocationTargetException

I am trying to generate the uml diagram from yDoc library. It basically uses Javadoc to parse tha Java source files. However, when I am trying to execute the command from terminal(OS X), I am getting following error: javadoc: error - In doclet…
codeblues
  • 71
  • 1
  • 8
4
votes
2 answers

Exception thrown by the target of an invocation : Null reference. No details

I am trying to add buttons dynamically in a named StackPanel, according to a JSON response that I get from my Node.js API. I parse this JSON array into an object array, object having their class to put all the attributes in the good place. Then, in…
4
votes
2 answers

java.lang.reflect.invocationtargetexception in android

I am getting a problem , my xml file is as follow
Priya Singh
  • 75
  • 1
  • 2
  • 8
3
votes
2 answers

why must I import InvocationTargetException since it's in java.lang?

I'm trying to catch InvocationTargetException in my file, but I get this error if I do not explicitly write the import statement for it. Since it's under a sub package of java.lang, I don't know why I have to import it. //this is the import…
SteamboatTMR
  • 65
  • 1
  • 7
3
votes
1 answer

Internal NPE when launching JavaFX Application

So basically I began a dummy JavaFX project just to achieve a minimalistic example for my actual problem. But now I am not even able to run that minimalistic project anymore and do not receive enough error information to actually google it myself…
1
2 3
15 16