Applet - Class.forName..

I have an applet which is loading fine but my combo boxes aren't getting populated - I'm getting "Failed to load JBDC/ODBC driver" because of the following:
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch(Exception e){
System.out.println("Failed to load JBDC/ODBC driver");
Any ideas?
Jacintha

What are you actually trying to do? Are you connecting through a Servlet/JSP or is it a standalone applet? Seems like you are using Windows. Use ODBC Datasources in the Control Panel to set a DSN. Which database are you using? Which Platform are you working on and what is the objective of your applet?
I have an application and when you click a particular button on a jsp - you are directed to the html file that loads the applet. I'm using an Oracle database. When the applet loads ( a swing applet) the buttons etc comes up but the combo boxes are not populated - should be populated from the database - I have been looking through this forum and some have mentioned to sign the applet - I am in the process of doing this - I don't know if you know anything about this. I have got as far as signing the jar file and exporting the public key certificate - but now it goes into details about the code receiver which I'm getting puzzled about. I am using the following site: http://java.sun.com/docs/books/tutorial/security1.2/toolsign/index.html. I don't know what direction to go now!

Similar Messages

  • Trouble w/ multiple applets dynamically starting and Class.forName()

    I'm trying to start applets dynamically and I see strange behavior on some systems it works fine and gets the applet class from the jar file. On other systems it makes an http request back to the server to try and get the class. I don't know where in the Class or ClassLoader it's deciding whether to get this class from the jarfile or from the server and all of these classes are contained in the jarfile? Any suggestions?
    Here's the method to start new applets
    public Component startApplet( String className ) {
    System.out.println("Starting applet "+className);
    Class appletClass = null;
    JApplet japplet = null;
    try {
    appletClass = Class.forName("com.actsolar.ui.applet."+className);
    System.out.println(appletClass);
    japplet = (JApplet)appletClass.newInstance();
    japplet.init();
    } catch (Exception e) {
    System.out.println("startapplet Exception: "+e.getMessage());
    return japplet;
    thanks,
    andrew

    Hi,
    I have seen the same problem when I mix up small letters and BIG LETTERS.
    Ex :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <applet code="Function3.class"width="100" height="100">
    </applet>
    </html>
    will work with Function3.class
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <applet code="function3.class"width="100" height="100">
    </applet>
    </html>
    Will NOT work.
    Maybe this will help you , I am also new on JAVA so maybe you make the same mistake like I did ?
    Best Regards,
    Didier.

  • How does Class.forName() get a driver registered with DriverManager

    From the documentation, Class.forName() tends to loads the specified class via the class loader. But if we use it to load the class of a jdbc connection driver, how does it get automatically registered with DriverManager?
    Neerav

    yorkroad wrote:
    No. Class.ForName("whatever") intializes the class. As for registering it with the DriverManager, this is from the API:
    When the method getConnection is called, the DriverManager will attempt to locate a suitable driver from amongst those loaded at initialization and those loaded explicitly using the same classloader as the current applet or application.
    You could use DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); which does it all in one. (Although keep in mind that will require an Oracle import in your code!)
    m
    Edited by: yorkroad on Nov 4, 2009 3:42 PMNo, loading the Class with Class.forName already registers the driver, as already said. Where DriverManager "searches" is among those registered classes. The method detailed above does not do anything more than simply calling Class.forName() with the added drawback that the Driver jarfile must be present at compile time, and, in order to change DBs you would have to change and recompile your code.

  • Class.forName("com.proj.someclass").newInstance()

    This works fine if "someclass" is in classpath but doesn't work if "someclass" is in jar file. How to make it work with classes packed into jar?

    Hi Mike.
    I think you need to write your own customized ClassLoader. Haven't done it myself, but I know the question has been up before, and ansered, and problem solved... Do some search. And maybee you coud be more specific about what you want to achive. Is this an applet or an application? And why do you need to use Class.forName? And why do you want the class to be in a .jar file?
    Ragnvald Barth
    Software enigneer

  • "Bad Applet class name" error while recording on Oracle Forms 11g through OpenScript (JRE 1.7.0_17)

    Hi,
    I am trying to record automation functional test script on Oracle Forms 11g using OpenScript.
    Able to open the browser, but after accessing application URL, getting application error as "Bad Applet class name"
    Java Plug-in 10.17.2.02
    Using JRE version 1.7.0_17-b02 Java HotSpot(TM) Client VM
    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>
    SSV dialog is suppressed........
    cracked oracle.forms.engine.Main
    Loading cached Forms Jars ...
    Is this version (Oracle forms 11g, JRE 1.7.0_17) supported by OATS-OpenScript ?
    Please advise if there is any work around here.
    Thanks.

    From the last OATS release notes available in the C:\OracleATS\docs directory:
    4.1 Oracle Functional Testing/OpenScript
    Oracle Functional Testing’s OpenScript scripting platform has the following system
    requirements:
    ■ Operating System (32-bit and 64-bit versions): Windows XP, Windows Vista,
    Windows 2003, Windows 7, Windows 2008, Windows 2008 R2.
    ■ Memory: Minimum 1 GB
    ■ System: x86, 32-bit or 64-bit processor, 2.6 GHz or faster
    ■ Disk Space: 4 GB minimum
    ■ Browser: Internet Explorer 7.x, 8.x., 9.x; Firefox 3.5/3.6, 6.x, 10; Chrome 27+
    (playback only).
    ■ Java Runtime Environment: JRE 1.6 minimum (up to build 38), JRE 1.7 (up to build
    11) .
    So basically, it's not supported... Can you try with another JRE version?
    As always don't forget to run OpenScript as administrator on W7/8 or equivalent
    JB

  • Browser doesn't display applets (classes)

    hi all,
    i am sure every beginner faced the same problem
    though i am not a beginner, i am facing this strange problem, and i can't figure out where the proble is .
    i just started developing simple swing applications. first i want to try the examples given in a tutorial.
    most of them are japplets (applets created by swing components)
    Strange thing is that none of htem works on my browser WHICH DRIVES ME CRAZY !!
    let me make my situation clearer:
    i put the Japplet class file and the html file whick invokes the applet under the same directory
    as far as i know , since they are in the same directory i don't need t to set the classpath , am i right?
    well, if i open the html file directly from that directory, it can find the Japplet and it works
    but when i put them in another directory under the root of tomcat 4 and try to access them through :
    http://<hostaddress>:8080/applet.html
    applet.html opens but can't find my applet class saying that app.class not found
    the relevant html code is as follows:
    <html>
    <body>
    <applet code=app.class width=100 height=50>
    </applet>
    </body>
    </html>
    what am i supposed to do?where am i wrong?
    by the way to make sure i also added .; to my classpath
    my OS is win 2000,
    i am using jdk1.3.1
    do i need something else to make them work
    thanks for helping in advance :)
    cheers :)

    Is it a typing error or not.
    Your html code is
    <applet code=app.class width=100 height=50>Is this really the code you use?
    I am missing the " "
    <applet code="app.class" width=100 height=50>If you don't use the "", app.class can not be found.

  • Class.forName, how to use it in the case?

    we have a java application:
    c:\app\TestForName.class
    inside the app, there is a call:
    Class.forName("ClassLib");
    ClassLib.class is a simplest class for testing with no package.
    ClassLib.class can be in any directory except the app's directory
    c:\app
    because ClassLib.class stands for our library class for multiple projects and multiple uses, it is not allowed to be in a special app directory.
    and, ClassLoader and URLClassLoder are not suitable in our case.
    i tried following 3 ideas, none of them is OK, please help.
    1. put ClassLib.class in directory
    c:\lib\
    (that is c:\lib\ClassLib.class)
    call application with command -cp
    java -cp c:\lib;....; TestForName
    (method Class.forName("ClassLib") call is inside TestForName.class)
    2. put ClassLib.class in
    c:\jdk\bin\
    (VM says it is one of "java.library.path")
    java -cp ....; TestForName
    3. put ClassLib.class in
    c:\jdk\JAR\classes\
    (VM says if is one of "sun.boot.class.path")
    java -cp ....; TestForName
    i really wondering how to make Class.forName() call successfuf inside application TestForName.class
    1. which directory is right place for ClassLib.class
    2. how to change command line or java code inside TestForName.class
    thx for any help.

    Why don't u use a class loader. Try this code
    // loader class
    public class Loader  extends ClassLoader {
        String path;
        public Loader(String path) {
              this.path = path;
        public Class findClass(String name) {
            byte[] b = loadClassData(path+name+".class");
            return defineClass(name, b, 0, b.length);
        private byte[] loadClassData(String name) {
            File file = new File(name);
            byte[] data = null;
            try {
                InputStream in = new FileInputStream(file);
                data = new byte[ (int) file.length()];
                for (int i = 0; i < data.length; i++) {
                    data[i] = (byte) in.read();
            catch (IOException ex) {
            file = null;
            return data;
    // in your caller class use
       Loader loader = new Loader(libPath); // lib path may be taken from a command line arg
       Object main = loader.loadClass("ClassLib", true).newInstance();I think this is what u r looking for
    Uditha Nagahawatta

  • Error in Class.forName("com.mysql.jdbc.driver")

    Hi forum,
    Please help me to solve the issue.
    im using the following jsp code for genrating the reports using JASPER REPORTS
    the JSP FILE
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="javax.sql.DataSource"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="net.sf.jasperreports.engine.*"%>
    <%@ page import="net.sf.jasperreports.engine.design.JasperDesign"%>
    <%@ page import="net.sf.jasperreports.engine.xml.JRXmlLoader"%>
    <%@ page import="net.sf.jasperreports.engine.export.*" %>
    <%@ page import ="net.sf.jasperreports.engine.*"%>
    <%@ page import ="net.sf.jasperreports.engine.JasperFillManager"%>
    <%@ page import ="net.sf.jasperreports.engine.JRException"%>
    <%@ page import="net.sf.jasperreports.engine.JasperReport"%>
    <%@ page import="net.sf.jasperreports.engine.JasperPrint"%>
    <html>
    <body bgcolor="00ffcc">
    <%
    try{
    Connection con = null;
    String url="jdbc:mysql://localhost/customer";
    String username = "root";
    String password = "cmsadmin";
    InputStream input=new FileInputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/web/helloworld.xml"));
    JasperDesign design = JRXmlLoader.load(input);
    JasperReport report = JasperCompileManager.compileReport(design);
    Map params = new HashMap();
    params.put("reportTitle", "helloworld");
    params.put("author", "Muthu Kumar");
    params.put("startDate", (new java.util.Date()).toString());
    params.put("ReportTitle", "PDF JasperReport");
    <img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" />Class.forName("com.mysql.jdbc.Driver");<img class="emoticon" src="images/emoticons/confused.gif" border="0" alt="" /><img src="images/emoticons/confused.gif" border="0" alt="" />
    con = DriverManager.getConnection(url,username,password);
    JasperPrint print = JasperFillManager.fillReport(report, params, con);
    OutputStream output=new FileOutputStream(new File("C:/Documents and Settings/user/My Documents/NetBeansProjects/jasperreports/helloreportworld.pdf"));
    JasperExportManager.exportReportToPdfStream(print, output);
    // JasperViewer.viewReport(print);
    catch(SQLException es) {
    out.println(es);
    catch(JRException ex){
    //ex.printStackTrace();
    out.println(ex);
    %>
    </body>
    </html>The error it is saying is in the line Class.forName(....) ;
    Please look for the emoctions with question mark
    i DOn know what to do.
    Please help
    Im comparin the below JRXML file as with the above code
    <?xml version="1.0"?>
    <!DOCTYPE jasperReport
    PUBLIC "-//JasperReports//DTD Report Design//EN"
    "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
    <jasperReport name="helloworld">
    <parameter name="reportTitle" class="java.lang.String"/>
    <parameter name="author" class="java.lang.String"/>
    <parameter name="startDate" class="java.lang.String"/>
    <queryString>
    <![CDATA[SELECT * FROM customer order by UserID ]]>
    </queryString>
    <field name="UserID" class="java.lang.String"/>
    <field name="UserName" class="java.lang.String"/>
    <field name="City" class="java.lang.String"/>
    <field name="State" class="java.lang.String"/>
    <title>
    <band height="60">
    <textField>
    <reportElement x="0" y="10" width="500" height="40"/>
    <textElement textAlignment="Center">
    <font size="24"/>
    </textElement>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$P{reportTitle}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="0" y="40" width="500" height="20"/>
    <textElement textAlignment="Center"/>
    <textFieldExpression class="java.lang.String">
    <![CDATA["Run by: " + $P{author}
    + " on " + $P{startDate}]]>
    </textFieldExpression>
    </textField>
    </band>
    </title>
    <columnHeader>
    <band height="30">
    <rectangle>
    <reportElement x="0" y="0" width="500" height="25"/>
    <graphicElement/>
    </rectangle>
    <staticText>
    <reportElement x="5" y="5" width="50" height="15"/>
    <textElement/>
    <text><![CDATA[UserID]]></text>
    </staticText>
    <staticText>
    <reportElement x="55" y="5" width="150" height="15"/>
    <text><![CDATA[UserName]]></text>
    </staticText>
    <staticText>
    <reportElement x="205" y="5" width="255" height="15"/>
    <text><![CDATA[City, State]]></text>
    </staticText>
    </band>
    </columnHeader>
    <detail>
    <band height="20">
    <textField>
    <reportElement x="5" y="0" width="50" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{UserID}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="55" y="0" width="150" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{UserName}]]>
    </textFieldExpression>
    </textField>
    <textField>
    <reportElement x="205" y="0" width="255" height="15"/>
    <textElement/>
    <textFieldExpression class="java.lang.String">
    <![CDATA[$F{City} + ", " + $F{State}]]>
    </textFieldExpression>
    </textField>
    </band>
    </detail>
    </jasperReport>

    Glass_Fish wrote:
    I have set the classpath in the environment variables in the my computer properties.The web container has it's own properties. The "system" classpath means absolutely nothing to it. Read your server's documentation.

  • Class.forName() with dynamic String

    I'm trying to create objects of a class whose name depends on a runtime database lookup. So my code looks like this:
    package com.mycompany.ourproduct.ourpackage;
    String className = rs.getString(1);
    Class c = Class.forName(className);
    When I run the program, I get a ClassNotFoundException. But everything runs fine if I replace the code above with this:
    package com.mycompany.ourproduct.ourpackage;
    // String className = rs.getString(1);
    String className = "com.mycompany.ourproduct.ourpackage.oursubpackage.MyClass"
    Class c = Class.forName(className);
    The problem seems to be in the dynamic linking. Although the class I'm trying to load is in a different package, it is a public class (and I can load it with a static string). Neither does moving it to the same package fix the problem.
    I've noticed that if I supply a mis-named class with a static string, the exception reads:
    java.lang.ClassNotFoundException: com.mycompany.ourproduct.misspelledpackage.SomeClass
    but the same exception prints as follows when the string comes from the database:
    java.lang.ClassNotFoundException: com/mycompany/ourproduct/misspelledpackage/SomeClass
    I thought the difference was one of compile-time linking and run-time linking, but oddly enough, I still get the dots for misspelled classes that I (1) supply on the command line, (2) read from a file, or (3) concatenate from command line arguments plus info from a file. It's just when I pull the class name from the database that I get the slashes. Does anyone know what's going on?
    Here's what I get from java -version:
    java version "1.2.2"
    Solaris VM (build Solaris_JDK_1.2.2_05a, native threads, sunwjit)
    Any help would be greatly appreicated!

    Hmm. Weird. Have you looked at the String you're getting back from the database? Does it have slashes or dots? (Should be dots.) Have you made sure any leading/trailing spaces have been trimmed? Try doing classname.equals("com.mycompany... etc.") to see if it really is the same string as the constant that does work.
    If it turns out the String is correct, and the only difference is whether that String came from a databaes or a literal, then I don't know what's going on. The first step, though, is to verify whether that's really the case, or if you're not getting the String you think you are.

  • Class.forname("").newInstance();   =   Problem!!  ;)

    I am distributing the application I am developping as a Jar file...
    In my application, there is a tool which interacts with a Database..
    As there is more than 1 existing database, and that they all require different drivers, I do not want to have to put every driver into my jar file, since it makes the file too big... I'd like to make it possible to download the drivers separatly, as another jar file... Although when I do that, I am not able to create a new instance of the driver...
    Here's what I have:
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    This works fine when the driver has been included in the same jar file as my program.. How could I get it to work if the driver is in a separate Jar file, in the same folder as the jar file of my own application?

    I am distributing the application I am developping as
    a Jar file...
    In my application, there is a tool which interacts
    with a Database..
    As there is more than 1 existing database, and that
    they all require different drivers, I do not want to
    have to put every driver into my jar file, since it
    makes the file too big... I'd like to make it
    possible to download the drivers separatly, as another
    jar file... Although when I do that, I am not able to
    create a new instance of the driver...
    Here's what I have:
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    This works fine when the driver has been included in
    the same jar file as my program.. How could I get it
    to work if the driver is in a separate Jar file, in
    the same folder as the jar file of my own application?I think the problem may be the classpath since it has to include the jar name specifically to find the classes in them. Perhaps you can set a new classpath with the System.setProperties() function so that the Class.forName() will work. I haven't tried that so I don't know if it will work.

  • Class.forName problem

    Hi,
    I'm using "Java Invocation API" to load a class and call a generic method of it,
    but the "forName" call fails with error:
         Exception in thread "Thread-4" java.lang.ClassNotFoundException: HelloWorld
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:217)
    here is my (pseudo) code:
    // connect to my class "HelloWorld"
    myClass = (*envP)->FindClass(env, "HelloWorld")
    // connect to class "Java/lang/Class"
    classClass = (*env)->FindClass(env, "java/lang/Class")
    // get the id of Class.forName method
    forNameID = (*env)->GetStaticMethodID(env, classClass, "forName", "(Ljava/lang/String;)Ljava/lang/Class;")
    // j name of HelloWorld
    jClassName = (*env)->NewStringUTF(env, "HelloWorld")
    // call forName -> fails
    jClassObject = (*env)->CallStaticObjectMethod(env, classClass, forNameID, jClassName)
         -----> Exception in thread "Thread-4" java.lang.ClassNotFoundException: HelloWorld
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:217)
    Sustem: MacOSX 10.2.8
    Java Version: 1.4.1
    $CLASSPATH env var: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes
    Can somebody help me or point me to some useful URL about this?
    Thanks

    Here is a simple app that demonstrates my problem. I compiled and ran it on MacOSX but I have the same problem on windows. Copy the following code in a file named "javatest.c", cd to that directory and compile it with commad:
    gcc -o javatest javatest.c -framework JavaVMthen run it with:
    ./javatestCode:
    #include <JavaVM/jni.h>
    //===========================================================================================
    static void print_exception(JNIEnv *envP)
         // output the exception
         if (envP && ((*envP)->ExceptionOccurred(envP) != NULL))
         {     (*envP)->ExceptionDescribe(envP);
              (*envP)->ExceptionClear(envP);
    //===========================================================================================
    int main()
    JavaVMInitArgs     vm_args;
    JavaVM               *jvm;
    JavaVMOption        options[5];
    char               *classPathEnv;
    char               *classPathString;
    jint               res;
    JNIEnv                *envP = NULL;
    jclass               jlcClass;
    jmethodID          forNameID;
    jstring               jClassName;
    jobject               jClassObject;
         vm_args.version = JNI_VERSION_1_2;
         // options
         vm_args.nOptions = 5;
         options[0].optionString = "-verbose:class" ;
         options[1].optionString = "-verbose:jni" ;
         options[2].optionString = "-verbose:gc" ;
         classPathEnv = (char *)getenv( "CLASSPATH" );
         if (!(classPathString = (char*)malloc(strlen( "-Djava.class.path=" ) + strlen(classPathEnv) + 1)))
    printf("malloc failed\n");
              exit(1);
         sprintf(classPathString, "%s%s" ,"-Djava.class.path=" , classPathEnv);
         options[3].optionString = classPathString;
         options[4].optionString = "vfprintf" ;
         options[4].extraInfo = vfprintf;
         vm_args.options = options;
         vm_args.ignoreUnrecognized = JNI_FALSE;
         // Load the jvm
         res = JNI_CreateJavaVM(&jvm, (void**)&envP, &vm_args);
         if (res != JNI_OK)
         {     printf("CreateJavaVM failed\n");
              exit(1);
         // find the class "java/lang/Class"
         if (!(jlcClass = (*envP)->FindClass(envP, "java/lang/Class")))
         {     printf("FindClass java/lang/Class failed\n");
              print_exception(envP);
              exit(1);
         // find the method ID of Class.forName
         if (!(forNameID = (*envP)->GetStaticMethodID(envP, jlcClass, "forName", "(Ljava/lang/String;)Ljava/lang/Class;")))
         {     printf("GetStaticMethodID forName failed\n");
              print_exception(envP);
              exit(1);
         // make a java string of my "HelloWorld" class
         if (!(jClassName = (*envP)->NewStringUTF(envP, "HelloWorld")))
         {     printf("NewStringUTF failed\n");
              print_exception(envP);
              exit(1);
         // call method Class.forName
         if (!(jClassObject = (*envP)->CallStaticObjectMethod(envP, jlcClass, forNameID, jClassName)))
         {     printf("CallStaticObjectMethod of forName failed\n");
              print_exception(envP);
              exit(1);
         // fail with:
         // java.lang.ClassNotFoundException: HelloWorld
         //        at java.lang.Class.forName0(Native Method)
         //        at java.lang.Class.forName(Class.java:115)
    return 0;
    }HelloWorld java code (compiled in a .class file located in $CLASSPATH folder):
    public class HelloWorld
         public static void main (String args[]) throws Exception
              System.out.println ("HelloWorld");
    }Someone can help me about this?

  • Class.forName() throws null exception in servlet

    Hi, just wondering if anyone having this similar problem:
    when i try to load a class using Class.forName() method inside a servlet, it throws null exception.
    1) The exception thrown is neither ClassNotFoundException nor any other Error, it's "null" exception.
    2) There's nothing wrong with the code, in fact, the same code has been testing in swing before, works perfectly.
    3) I have include all necessary jars/classes into the path, even if i haven't, it should throw ClassNotFoundException instead, not "null" exception.

    I have tried to detect any possible nullable variable, and it is able to run until line 15. The exception thrown is actually null only... not NullPointerException... which is why i have confused...
    the message i received is "PlugInException: null".
    The code is at follow:
    * Load plugin
    * @return ArrayList of plugins
    * @exception PlugInException PlugInException
    01 public ArrayList loadPlugin()
    02 throws PlugInException
    03 {
    04 PlugIn plugin;
    05 ArrayList plugins = new ArrayList();
    06
    07 for (int i = 0; i < configLoader.getPluginTotal(); i++)
    08 {
    09 try
    10 {
    11 if (debugger > 0)
    12 {
    13 System.out.print("Loading " configLoader.getPluginClass(i) "...");
    14 }
    15 if (Class.forName(configLoader.getPluginClass(i)) == null)
    16 {
    17 if (debugger > 0)
    18 {
    19 System.out.print(" not found");
    20 }
    21 }
    22 else
    23 {
    24 if (debugger > 0)
    25 {
    26 System.out.println(" done");
    27 }
    28 plugin = (PlugIn)(Class.forName(configLoader.getPluginClass(i)).newInstance());
    29 plugin.setContainer(container);
    30 plugins.add(plugin);
    31 }
    32 }
    33 catch (Exception e)
    34 {
    35 throw new PlugInException("PlugIn Exception: " + e.toString());
    36 }
    37 }
    38
    39 return plugins;
    40 }

  • Class.forName() ????

    Hello, I have the following problem:
    1. I create a class with "Class comp1 = Class.forName(strName);"
    2. With creating an instance custom the constructor some parameters.
    3. With "Constructor[ ] myconstr = comp1.getConstructors();" I get all Constructors.
    4. With "Class[ ] paramTypes = myconstr.getParameterTypes();" I get the parameter types
    question: Can I find somehow parameter name?
    Thanks for your help!!!
    Hallo, ich habe folgendes Problem:
    1. Ich erzeuge eine Klasse mit "Class comp1 = Class.forName(strName);"
    2. Beim Erzeugen einer Instanz brauch der Konstruktor einige Parametern.
    3. Mit "Constructor[] myconstr = comp1.getConstructors();" bekomme ich alle Konsturktoren.
    4. Mit "Class[] paramTypes = myconstr[i].getParameterTypes();" kann ich die Parametertypen bekommen
    Frage: Kann ich irgendwie Parametername rausfinden?
    Vielen Dank f�r die Hilfe!!!

    A method signature consists of the methods name and the parameter types. Nothing more is stored in the class-files. So there is no way to address a parameter by it's name in java.
    You may want to do something like:
    Class[] paramTypes=new Class[] { A.class, B.class };
    Constructor constructor=C.class.getConstructor(paramTypes);
    C cObj= (C) constructor.newInstance(new Object[] ( a, b));

  • Where should i put html with applet class embedded?thanks

    Tomcat4.0 server
    i put html and applet class in the root of my project(/webapps/test/)
    when i hit the html file locally, it displays well. but it doesn't work when it comes to service.
    plus:the applet class is developed with jdk1.1.8
    any help is apprieciated!

    The first thing I would do is recompile the applet with a newer JDK. Second, you need to post more info on the problem. What do you mean by "service"?

  • How to include applet in jsp if applet.class file in another folder

    hi,
    i'm getting problem when my applet.class file is not with its appropriate jsp file. i'm using jsp :plugin tag.it work when jsp file n apllet.class file at same location.
    in short my jsp file is at location /webapps/jsp-examples/myproject/includeDemo.jsp
    n applet i want in a WEB-INF folder.
    Plz help me to solve this..
    or give me other way that an applet can be loaded in jsp page n applet should be in WEB-INF file..
    Help me for this

    http://forum.java.sun.com/thread.jspa?threadID=5148764&messageID=9556205

Maybe you are looking for

  • Is my hard drive dying and if so, how long does it have?

    Symptoms (earlier today and for the past week or so): -- too-frequent cycling noises -- a weird pinging or clicking sound; it seems random but yet tied to opening applications or files -- no chime on startup (that just started today) -- increasing sl

  • Disk 2 taking hours

    I finally got my video install completed - I swapped out a nicer AGP STB card for an older PCI Matrox card, and that was good. I started installing disk 2 about 2 hours ago. I opened a terminal window, and a few files systems seem to be getting used.

  • Can't get my RAW images to open up in elements 9 from my new 5d mark 3 Camera!

    I never had problems opening my RAW images from Canon 5d Mark2 but for some reason, they won't open from my new canon 5d mark 3 camera.  A pop up box comes up that says, cannot open file "........." because it is the wrong type of file.  Can anyone h

  • Document 510008000 saved (error in account determination).

    When I am creating credit memo System through error message Document 510008000 saved (error in account determination). What could be the reason..

  • Unknown devices appearing in my access list

    I have a WPN824 wireless router and in the last two weeks, I've found three devices in the access list that I didn't put there.  I first found the three devices last week and deleted them from the list.  Tonight, I found them again.  All three device