I created one object using reflection and then try to save that object in the Vector , I have got InvocationTargetException , however while storing it into the reference type of that object , it works fine.
Before storing it into the vector , I printed out the object created , and it shows the classname@hashcode means that object is created successfully.
I tried storing it in Vector,ArrayList and static arry of that objects but no luck.
Can someone help me in debugging this issue . I understand the information provide by me may be vague but still if someone has any idea or encountered the same issue , please help me out.
Could you post a code snippet showing how you're creating the object and adding it to the Vector? Also, what is the cause of your InvocationTargetException? You can call the <exception>.getCause() method to find out for certain.
Try this: InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor.
As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "target exception" that is provided at construction time and accessed via the getTargetException() method is now known as the cause, and may be accessed via the Throwable.getCause() method, as well as the aforementioned "legacy method."
Anyway Thanks and if you have any idea how it worked , please share
Paul is right, without more information we have no idea. If using the method local variable solves your problem, that's cool. But if you still need to get it to work with your instance variable, you'll need to post some code and/or more details on the exception your getting. [ April 18, 2007: Message edited by: Scott Escue ]
That is a really big piece of pie for such a tiny ad: