This discussion is archived
4 Replies Latest reply: Apr 1, 2010 12:25 PM by 843798 RSS

Refelction with JNLP launched app

843798 Newbie
Currently Being Moderated
This code runs fine when running in Eclipse, or double clicking the jar file. However when I launch using jnlp, I get an error.
          String cname = "dbObjects.DBO_"+sel;
          ClassLoader cl = ClassLoader.getSystemClassLoader(); 
          try {
               Class myClass = Class.forName( cname, false, cl ); //cl.loadClass(cname);
               Object obj = myClass.newInstance(); 
java.lang.ClassNotFoundException: dbObjects.DBO_ZipCodes
     at$ Source)
     at Method)
     at Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at GUI.PnlAdmin.onSelChange(
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for Tmgr Download -->
<jnlp spec="1.0+" codebase="" href="tmgr.jnlp">
       <vendor>Simple Software</vendor>
       <description kind="short">tmgr Download</description>
       <icon href="TMgr.png" />
       <icon kind="splash" href="TMgr.png" />
       <shortcut online="false">
            <desktop />

       <j2se version="1.6.0_10+" href="" />
       <jar href="tmgr.jar"/>
     <application-desc main-class="TMgr">
        <!-- <argument>...</argument> -->
I checked the jar file and the class files are there.