Results 1 to 14 of 14
- 07-09-2010, 04:25 AM #1
java.lang.reflect.InvocationTargetException - help!!!
I am trying to write a simple program but for some reason I cannot run it.
This is applet.
The only thing I get it is java.lang.reflect.InvocationTargetException and nothing more.
The whole applet code is too long so I want to show you just the class which extends JApplet because the exception happens right in the init() method.
I know the problem is somewhere in classes imports but I cannot find it. :confused:
Please watch my attached file
Last edited by gafa; 07-09-2010 at 04:33 AM.
- 07-09-2010, 04:30 AM #2
Normally this error occurs when java compiler finds two different classes with same name in two different packages. When you are importing both classes at a time and create object of that class it throws InvocationTargetException. Did you do that in your application?
Simple solution for this is, when you want to create the object of the class use package name also along with class name. So that compiler can clearly identify them.
- 07-09-2010, 04:36 AM #3
- 07-09-2010, 04:48 AM #4
Write a simple Java class to read all the file names in your project folder and list them on the console. Simply you can find the matching.
- 07-09-2010, 04:51 AM #5
It's greate, Eranga, but i am not sure how :confused:
the project contains so many subfolders...
Is there some standard way?
- 07-09-2010, 04:56 AM #6
what if the problem class is in the libs' jars?
- 07-09-2010, 05:07 AM #7
- 07-09-2010, 05:09 AM #8
- 07-09-2010, 05:24 AM #9
- 07-09-2010, 05:27 AM #10
- 07-09-2010, 05:28 AM #11
- 07-09-2010, 05:31 AM #12
Is there an IDE function to look for these duplicated classes?
- 07-09-2010, 05:44 AM #13
- 07-09-2010, 05:50 AM #14
- By rameshraj in forum JDBCReplies: 5Last Post: 03-17-2011, 03:26 PM
- By koxy in forum NetworkingReplies: 1Last Post: 03-22-2010, 03:51 PM
- By George R. in forum NetBeansReplies: 0Last Post: 01-06-2010, 02:19 PM
- By jon80 in forum New To JavaReplies: 1Last Post: 05-19-2009, 11:03 PM
- By priyanka_t in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-05-2007, 02:34 PM