Page 1 of 2 12 LastLast
Results 1 to 20 of 31
  1. #1
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default java.lang.reflect.InvocationTargetException

    My new GUI runs perfectly in NetBeans. I enabled web start and put this in my html file:

    <applet code="classname.ClassName" width="480" height="320" archive="ClassName.jar"></applet>

    When I load the html file in a browser, I get java.lang.reflect.InvocationTargetException

    I don't know where to begin to solve the problem. If someone can point me in the right direction, I've been doing well solving my Java problems with Google.

    Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: java.lang.reflect.InvocationTargetException

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    Can you post the full text of the error message from the java console?
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    The console shows:

    Java Plug-in 10.4.0.22
    Using JRE version 1.7.0_04-b22 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Dissonance
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------

    When I click on details, it shows:

    RuntimeException
    java.lang.reflect.InvocationTargetException

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    I have not seen that error. Where is it shown?
    If you don't understand my response, don't ignore it, ask a question.

  6. #6
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    RuntimeException
    java.lang.reflect.InvocationTargetException

    shows up when I press the details button in the Java console.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    Where is it shown? A new window? In the applet's window? In the status area? ???

    I've never seen the "details button" in the java console.

    java.lang.reflect.InvocationTargetException-javaconsole.png
    Last edited by Norm; 05-30-2012 at 01:46 AM.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    Sorry about that. The empty spot for the applet in the browser says, "Error. Click here for details." When I click it, a little Application Error pops up that has the details button, which brings up the Java console.

    java.lang.reflect.InvocationTargetException-apperror.jpg

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    I haven't seen that way of displaying an error message.
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    Could the error message be displaying that way because I have a class that uses JMF?

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    Sorry, I haven't seen it done that way.
    If you don't understand my response, don't ignore it, ask a question.

  12. #12
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    I realized that you have to set the trace level in the Java console. I'm getting this error:

    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter .runOnEDTAndWait(Unknown Source)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter .instantiateApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.initAppletAdapte r(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    I read on oracle.com that the most common cause of this during web start is from malformed xml. It suggests running the xml sytax checker. How do I do that?

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    I thought you were having problems loading an html page into a browser. If you are using JNLP then there are a lot more things involved. Have you tried the simple test of loading the html page into a browser?

    I have very little experience with JNLP.
    If you don't understand my response, don't ignore it, ask a question.

  14. #14
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    The problem only occurs when I run the applet through a browser. It works fine when I run in NetBeans or when I double click on the jar file. The oracle link where I read the above material says it's a web start issue.

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    How does the web start get involved when you are using an html file and a browser? There is no xml used there.
    If you don't understand my response, don't ignore it, ask a question.

  16. #16
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: java.lang.reflect.InvocationTargetException

    Quote Originally Posted by Norm View Post
    How does the web start get involved when you are using an html file and a browser?
    Probably by Embedding JNLP File in Applet Tag (The Java™ Tutorials > Deployment > Deployment In-Depth)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  17. #17
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    I don't entirely understand this.

    When I embed the JNLP file, the applet pops up in a window and runs just fine. When I embed the JAR file, I get the error. I would like the applet to display in the web page instead of popping up in a new window. If I can do this while embedding the JNLP file my problem should be solved. Are there parameters for this?

  18. #18
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    What happens if you only use an html file and the jar file? No JNLP.
    If you don't understand my response, don't ignore it, ask a question.

  19. #19
    Dissonance is offline Programming Again
    Join Date
    May 2012
    Location
    Eugene, OR
    Posts
    55
    Rep Power
    0

    Default Re: java.lang.reflect.InvocationTargetException

    When embedding the JAR file in the HTML file, the applet tries to load in the web page, but I get the error.

    When embedding the JNLP file in the HTML file, the applet loads just fine in a new window.

    When executing the JAR file from the command line or by double clicking on it, it runs just fine.

  20. #20
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: java.lang.reflect.InvocationTargetException

    When embedding the JAR file in the HTML file, the applet tries to load in the web page, but I get the error.
    Please post the html file contents and the full text of the error message.
    If you don't understand my response, don't ignore it, ask a question.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 10-30-2011, 03:38 PM
  2. How to unwrap java.lang.reflect.InvocationTargetException
    By iamlearning in forum Advanced Java
    Replies: 0
    Last Post: 09-28-2011, 04:03 PM
  3. Problems with java.lang.reflect
    By Boreeas in forum New To Java
    Replies: 9
    Last Post: 08-07-2011, 11:22 PM
  4. Replies: 13
    Last Post: 07-09-2010, 05:50 AM
  5. Replies: 0
    Last Post: 01-06-2010, 01:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •