Can't load class with Class.forName()

Hi, can somebody help me with this problem. I have clas copiled with jdk 1.3.1 (I also test it with jdk 1.4.1). If I try to load a Class instance with Class.forName("package.app.MyClass)") I have a runtime exception:
java.lang.ClassNotFoundException: com.unisys.ebs.all.ispecs.GD130IspecModel
     at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:115)
     at com.unisys.util.ObjectLoader.load(ObjectLoader.java:60)
     at com.unisys.jellybeans.IspecFactory.getIspec(IspecFactory.java:74)
     at com.unisys.jellybeans.LINCEnvironment.getIspec(LINCEnvironment.java:1012)
     at com.unisys.ebs.middleware.TestLinc.initConnection(TestLinc.java:52)
     at com.unisys.ebs.middleware.TestLinc.main(TestLinc.java:106)
but if instead of this I instantiate the class calling the constructor and writing an import sentence, it works fine. I really need to instantiate this class via Class.forName because it extends a superclass and know the class to instantiate only at runtime. I will appreciate any help. Thanks.
Pablo Antonioletti

I removed the import in the file header and wrote this code:
try{           
ispecModel = new com.unisys.ebs.all.ispecs.GD130IspecModel();
Class ispecClass = Class.forName("com.unisys.ebs.all.ispecs.GD130IspecModel.class");
catch(Exception e)
e.printStackTrace();
the new sentence work fine, if write mor code I can access methods and members. When the runtime execute the Class.forName sentence the exception is thrown. I put all in the same file and class to avoid mistakes typing class path.
This is very rare I never seen it before and I developed java application since five years ago.

Similar Messages

  • How do we can start Load Testing with e-Load

    How do we can start Load Testing with e-Load?
    Please help?
    Gajanan

    Hi,
    if you allready have the software and a license, i would recomend that you try to get a training from Empirix. this is the best way of ensuring that the investment you did with the software gets maximum payback. training offers is something you can get from your empirix sales rep.
    if you DONT have the software and license, the first step is to get in touch with Empirix for an offer (for software and a training as well)
    the training helps you to unserstand how to work with the product and how to unserstand the results
    I hope that this helps you further
    /m

  • How can I load my java class dynamically ???

    Hi guyz !
    Please look on my problem:
    1. I write code under Windows.
    2. I have file testcls1.java with class by name 'TestCls1'. /package 'hs0'/
    3. I try to use method Class.forName.
    4. File on disk is "c:/shttpsrv0/SrvFiles/java/testcls1.java".
    5. I get exception ClassNotFound.
    Question: what is right way to write first parameter for method ???
    Thanx in advance !

    Hi guyz !
    Please look on my problem:
    1. I write code under Windows.
    2. I have file testcls1.java with class by name
    'TestCls1'. /package 'hs0'/
    3. I try to use method Class.forName.
    4. File on disk is
    "c:/shttpsrv0/SrvFiles/java/testcls1.java".
    5. I get exception ClassNotFound.
    Question: what is right way to write first parameter
    for method ???Class.forName can use *.class files only. If you have *.java file, you have to compile it first. Moreover, Class.forName uses CLASSPATH. If you want to provide the exact location of *.class file, try to use URLClassLoader.

  • How to compile a java file to class with class

    There is a java file.
    And i want to compile it with class, not javac command.
    so i can catch the compile errors.
    how to do it?
    special thanks.

    http://java.sun.com/developer/JDCTechTips/2003/tt0722.html#2

  • Comparing a class with Class-Object

    Hi there:
    I receive a Class-Object and have to compare it
    with a class, for example:
    public boolean stringClass(Class cl) {
      if (cl.equals("".getClass))
        return true;
      else
        return false;
    }I don't like this because in case of complex objects I have
    to create this object only for comparing, it's very inefficient:
    public boolean specialClass(Class cl)
       return cl.equals((new Special(<many parameters .. >)).getClass());
    }Any idea? Am I simply confused to see a clear solution?
    I will prefer something like this:
    if ( cl == Special.getClass())Thanx
    Andreas

    If you have an object, for example a String object, then you can check if this object is really a String:
    Object o = new String("");
    if (o instanceof String) {
      System.out.println("The object is a String");
    }Can you use that, or do you really want to test if a Class object is the name of a given class?
    Class cl = String.class;
    if (cl.getName().equals("java.lang.String")) {
      System.out.println("String Class");
    }

  • Runtime engine can't load vi with lvdatetimerec.ctl

    Hello everybody,
    i have trouble with TS 3.5 / LV 11.0
    I programmed a small vi that calculates the time difference between now and a time stamp. To pass the timestamp from Teststand i use a Control (lvdatetimerec.ctl) and the matching VIs to do the task.
    Unfortunally i can't load the vi into Teststand using the Runtime Engine. I get the message "Unable to load VI "xx.vi" with the Run-Time Engine. It is possible that the version of the VI or one of its subVIs is not the same as the ..."
    It is certainly the same and there is no problem until i include a constant or control of that type.
    Do anybody have an idea?
    Best regards
    Thomas
    Attachments:
    TimeDiff.vi ‏7 KB

    Try to recompile your vi hierarchy in LabVIEW (hold Ctrl and click Run), then save it, then try again in TestStand with LabVIEW runtime.
    Runtime engine does not support dynamic compiling, this vi may looks fine in LabVIEW, but TestStand will complain that it is broken. 
    Sergey Kolbunov
    CLA, CTD

  • Can't load custom formatter class in eclipse plugin?

    Hi All,
    Basically the ClassLoader.getSystemClassLoader().loadClass call in LogManager.getFormatterProperty function is a trouble. I have a code that is using jdk logging. In logging properties file I am specifying my custom formatter class for one of the standard handlers (console). The propblem is that LogManager inside calls ClassLoader.getSystemClassLoader().loadClass to load my class, and throws classnotfound exception. Same code/setup works fine for standard java app. So, apparently Eclipse classloader hierarchy is a problem.
    Is there a way to get around this?

    Are these Brushes for your version of PS?
    Over the decades, Adobe has changed some things about Brushes (and Actions, etc.), so that some older versions will not work in later versions.
    Do you have a version conflict?
    What version of PS do you have? What version were the Brushes created for?
    Good luck,
    Hunt
    PS - same thing happens with the "papers" and "brushes" in what is now Corel Painter. Many things are version specific.

  • In Windows Vista business 64 bits...Itunes can't load data information class...

    Can't sync Iphone 4 with Itunes versión 10.7.0.21, in Windows Vista business 64 bits. Already tried uninstalling and reinstalling and also finding sqlite3.dll and the other dll... and nothing. Renamed the sycservices folder and nothing, copied corefoundations.dll and folder to system32 and nothing...
    This is becoming very annoying... any tips?.
    Thanks.

    Hi!,
        Thanks for your reply but I keep having the problem. I've been investigation through the Internet and I beleive is a COM situation or something is in conflict with iTunes, either way I manage to compare a similar environment (Win Vista 64 bits Business with iTunes running) and figured out that process "Syncserver.exe" is not running and neither is running "ATH.exe".
        I'm reading more about what could possible causing these two process from being executing as they should.
        Thanks.

  • Can applet load own security class, class loader

    i tried this own security class extends SecurityManager class but exception thrown as applet cannot initate new security manager class.
    i have done throw policy file entry to allow applet to write file in client machine.
    i feel this extra burden novice user...
    what is alternative way....
    plz..

    An applet should never be allowed to install its own security manager. That is why it is burdensome.

  • How can I load data with Scripts on *FDM* to a HFM target System????

    Hi all!
    I need help because I can´t find a good guide about scripting on FDM. The problem I have is the next one.
    I have on mind to load my data with data load file in FDM to a HFM target system, but I would like to load an additional data using an event script, ie after validate. I would need any way to access to HFM system though FDM Scripts, is it possible??
    If so, It would be wonderful to get a data from HFM with any Point of View, reachable from FDM Scripts in order to load or getting any data.
    I´ve looking for a good guide about scripting in FDM but I couldn´t find any information about accessing data on HFM target system, does it really exist?
    Thanks for help

    Hi,
    Take a look at the LOAD Action scripts of your adapter. This might give you an idea.
    Theoretically it should be possible to load data in an additional load, but you need to be very careful. You don't want to corrupt any of the log and status information that is being stored during the load process. The audit trail is an important feature in many implementations. In this context it might not be a good idea to improve automation and risk compliance of your system.
    Regards,
    Matt

  • HT1338 I got problem with my mac bookOS X Lion 10.7.5  web safari can't loading , same with my ,app store. can some give me solusion.

    I got problem with my connect wit server using app store, safari and update software. Keep loading and failed can't connect to server. please gime me solusion. I can use only using firefox and chrome

    Power off the router. Wait awhile. Power it back on. Wait until all the lights are lit up properly.
    It will take a while.
    Restart the computer.
    Start up in Safe Mode
    http://support.apple.com/kb/PH11212
    Deselect Proxies if selected.
    Safari > Preferences > Advanced > Proxies:
    Click "Change  Settings" button.
    The network preferences window for Proxies will will show up with "Proxies"
    tab selected.
    Under "Select Protocol", uncheck any box if selected.
    Click "OK", then  "Apply"

  • Can't load website with .jsp - get blank page?  Doesn't happen all the time

    When I try to open American Eagle Outfitters website, I get a blank page and it will not open. The site is ending in index.jsp. I have 3 computers and it does it sporatically on all 3. ie. 1 may open the website, 2 won't or 2 might open website and 1 won't or none of the 3 will open. I know this has to be something simple but it has been doing this for about 3 months and it is driving me nuts because I can't get on there to pay my bill or even shop! Help!!
    Thanks

    I'm having the exact same problem! I've been using the website a lot recently, and then just about a week ago the website just wouldn't load. The page would go white and would say "Done" at the bottom of the screen. I tried googling the website to try and go in through there, and I can only seem to enter the site through "Find a Store Near You". Only this page seems to work, and whenever I click on "Women" or "Clearance" or "WishList" or anything else the page just goes white again and won't load. I've googled "websites won't load" and I've tried all the suggested steps and nothing seems to be working. I order off AE all the time and was ready to place an order, which I now can't do because I can't even sign in to the website.
    If you figure out how to fix it, email me at [email protected]

  • Can you load songs with anything other than iTunes?

    I'm trying to re-install itunes after my PC collapse, but I can't and I really want to upload new music to my ipod, but I can't, can I use any other software other than iTunes? Cuz seriously, I don't know what's the problem with iTunes, but I can't install it.

    There is a lot of software for iPods that allow you to transfer music and more.
    There are things like anapod (http://www.redchairsoftware.com/anapod/featpw.php), ephpod (http://www.ephpod.com/), podplus(http://www.ipodsoft.com/index.php?/software/podplus),and even a winamp extension (http://www.mlipod.com/).
    They aren't hard to find, just search.

  • Jar Loading and Retrieving Classes

    How can I load and retrieve classes from a jar file?

    I still do not know what you mean by "retrieve".
    Are you trying to read bytecode for a class from the jar using util.jar.*,
    or are you trying to get the class object for a class in a jar,
    or are you trying to create an instance of a class from a jar,
    etc.
    What exactly do you mean by "retrieve" a class?

  • Having problems in creating a class with name File.

    I want to compile a new class with class name as File, i have made it part of a new package also but still i am getting this error
    "File.java:2: CustomFile.File is already defined in this compilation unit
    import java.io.File;
    ^
    File.java:6: cannot resolve symbol
    symbol : constructor File ()
    location: class java.io.File
    inFile = new java.io.File();
    ^
    2 errors"
    Here is the source code of the file:
    package CustomFile;
    import java.io.File;
    public class File {
    private java.io.File inFile;
    public File(){
         inFile = new java.io.File();
         System.out.println("hi file");
    }

    Any help is appreciated.
    I want to compile a new class with class name as File,
    i have made it part of a new package also but still i
    am getting this error
    "File.java:2: CustomFile.File is already defined in
    this compilation unit
    import java.io.File;
    ^
    File.java:6: cannot resolve symbol
    symbol : constructor File ()
    location: class java.io.File
    inFile = new java.io.File();
    ^
    2 errors"
    Here is the source code of the file:
    package CustomFile;
    import java.io.File;
    public class File {
    private java.io.File inFile;
    public File(){
         inFile = new java.io.File();
         System.out.println("hi file");

Maybe you are looking for

  • Registered Server Program not being registered?

    Hi, first of all, I'm an ABAPer, not a Basis guy, so i apologize if i'm not giving all the info required to solve this issue. We have a program that's scheduled to run every morning at 4am. This program calls an RFC to XI and sends data to an externa

  • HT1766 If I restore my new iphone from my last backup will it delete all of the new things that i have on my phone

    If i restore my new iphone from my last backup will it delete all of the new content that I currently have on my phone? would it be better off to set it up as a new iphone? and if i set it up as a new iphone what will that do?

  • The app advanced cinema doesn't work

    This app I downloaded worked good for free movies. I paid ten dollars for the movies you can watch only if you pay. Every time I select a movie it sends me to IMBD and I can't watch the movie. The app is called Advanced cinema

  • Why do not Canon 350D show up in the Finder?

    Hi I have connected my Canon 350D, using the USB connector. It does not show up in the Finder window. IPhoto will automatically start and I can download the images. I prefer to use Photoshop CS2, but the canon is not shown there eighter! How can I ge

  • Not Getting SAPKINBC9A upgrade patch for PI_BASIS

    Hi All, I am implementing SPS 12 in my ECC 6.0 System. System is on oracle and linux. My PI_BASIS patch is on 2005_1_700 level and i need to upgrade the same on 2006-1_700. So i cannnot import any of 2006 patch before this component I am not getting