Results 1 to 14 of 14
- 07-09-2010, 04:25 AM #1
java.lang.reflect.InvocationTargetException - help!!!
Hello
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
http://www.filefactory.com/file/b279...artApplet.javaLast edited by gafa; 07-09-2010 at 04:33 AM.
- 07-09-2010, 04:30 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 07-09-2010, 05:09 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 07-09-2010, 05:24 AM #9
- 07-09-2010, 05:27 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
That's why I told you to use the notepad++, it's capable of searching the zip folders and all such packages. Give a try and see.
- 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
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I'm not sure that using NetBeans search it's possible to dig into packages. I think it's possible, with the extension.
- 07-09-2010, 05:50 AM #14
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
java.lang.NoSuchMethodError: org.apache.log4j.Logger.log(Ljava/lang/String;Lorg/apach
By rameshraj in forum JDBCReplies: 5Last Post: 03-17-2011, 02:26 PM -
sun.reflect
By koxy in forum NetworkingReplies: 1Last Post: 03-22-2010, 02:51 PM -
Problem with java.lang.reflect.InvocationTargetException
By George R. in forum NetBeansReplies: 0Last Post: 01-06-2010, 01:19 PM -
[SOLVED] [newbie] getting the constructors of a class (java.lang.reflect)
By jon80 in forum New To JavaReplies: 1Last Post: 05-19-2009, 11:03 PM -
How to reflect the changes
By priyanka_t in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-05-2007, 01:34 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks