Problems with loading Classes from a Directory of a jar file.

Hi Guys,
i have a problem with my programm. It works greatly in my eclipse platform. but there are all classes in my default folder. I want to add a plugin function now. My Abstract classes are in in my default folder and my doughter classes are in my plugin-folder called plugin.
I look what is in the pluginfolder -> all my doughter classes. but i every time get a Class Cast Exception and an ClassNotFoundException.
How can i do that ? Current i do it with Class.forName(frames.substring(0,frames[i].indexOf(".class")));
best regards flo

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

Similar Messages

  • A problem with copying text from english pdf to a word file

    i have a problem with copying text from english pdf to a word file. the english text of pdf turns to be unknown signs when i copy them to word file .
    i illustrated what i mean in the picture i attached . note that i have adobe acrobat reader 9 . so please help cause i need to copy text to translate it .

    Is this an e-book? Does it allow for copying? It is possible that the pdf file is a scan of a book?

  • Problem with loading classes!!!

    I am loading classes using
    // Open File
    InputStream jarFile = new BufferedInputStream(new FileInputStream(
    pluginPath));
    // Get Manifest and properties
    Attributes attrs = new JarInputStream(jarFile).getManifest().
    getMainAttributes();
    jarFile.close();
    // Read Main Class
    String mainClass = attrs.getValue("Protocol-Class");
    // Load all classes from jar file without giving classpath
    URL url = new URL("jar:file:" + pluginPath + "!/");
    JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
    URL[] urls = new URL[] {
    url};
    ClassLoader classLoader = new URLClassLoader(urls);
    // Create new instance of protocol
    Protocol protocol = (Protocol) classLoader.loadClass(mainClass).
    newInstance();
    I am loading classes one by one say a order A, B, C. In my case class c extends class A. So I am loading class A first and later B and finally C. But I am getting exceptions when loading class C that Class A is unknown.The following exception is thrown
    java.lang.NoClassDefFoundError: com/a/A at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    Please give me a solution to make it run.

    You create a new class loader for each class. The class loaders are independent, and so the class hierarchies they load are independent. Class A loader by classLoaderOne doesn't see class B loader by classLoaderTwo - they are loaded into their own sandboxes.
    Either load everything with one class loader or create the class loaders in a hierarchy. To create a hierarchy use the class loader constructor that takes a parent class loader as a parameter. One class loader may be easier because then you don't need to worry about loading order.

  • Flash CC Air iOS: Problems with loading text from an external xml located on a server.

    So I have this code allowing me to load text from an xml located on a server. Everything works fine on the Air for Android. The app even works in the ios emulator, but once I export my app to my ios device with ios 7, I don't see any text. The app is developed with Air sdk 3.9. What could be the reason? Do I need any special permissions like on Android? Does ios even allow to load xml from an external server?
    Any clues?

    It was my bad. I linked to a php file to avoid any connection lags, which was absolutely fine on the android, but didn't seem to work on the ios 7. So all I did is change the php extension to xml and it worked without any problems.

  • Problems with load DSO from file

    I am working with BI 7.0.
    I am loading data from file to DSO and my problem is that data is not active in my DSO, the data are loaded how New Data and I haven´t the data in query and DSO.
    The settings of my dso are:
    Type: standard
    SIDs Generation upon Activation: X
    Set Quality Status to 'OK' Automatically: X
    Activate Data Automatically: X
    I have created one transformation from datasource to DSO and one DTP that extract from datasource ( No PSA).
    When I execute the DTP there aren´t errors, the status is green and ok but the data is not active.
    If I try activate the data manually the job is launched but the data no active.
    Thanks.

    hai
    Isabel Bautista 
    u r saying the data is not active in dso and also u r loading the data from file directly( no psa).
               i think u know in B.I the data should be in psa then only u can load the data using DTP .so how can u load the data with out data in psa  .i thinks may be because of this u r data is not activating in dso
    if it helps
    assign some points ok

  • A problem with loading xml from external URl in flex

    So I have a server running (localhost) and I wrote an  application to request information from another website and return data  (xml). The application worked fine when I was using the flash builder  and just testing it on my machine (not using the localhost), when I  started using the server with the same exact code, it requested the  crossdomain.xml file to assure that I can request information from that  site, so I added the file and the file is right, the script gets it  (according to firebug), however, it is not getting the xml information  it should get, it just gets stuck with (waiting information from  blah.com) at the bottom.
    Is there a way to solve the problem?
    (I turned my firewall off and it didn't work either)

    Yeah I did test the URL and everything is going fine, the information is not returned to the flex application that's all.
    I am testing with FireBug and it is telling me that the request is in fact sent to the site but I don't think anything (either than the crossdomain function) is returned.
    Thanks for the help, I am really not sure what is going on.

  • Problem with loading  data from file in ../demo/file/test

    hi there,
    I am using ODI to load text files located on a UNIX server where ODI is installed.
    I am using the FILE_GENERIC data server and physical schema that came with ODI and I can reverse and load the demo files located in ../demo/file
    I created a sub-directory 'test' under ../demo/file and placed a file there.
    When I try to reverse this file (in directory ../demo/file/test) I get the error 'The directory ../demo/file/test specified in your schema does not exist'
    I am sure the userid has equal rights to both directories ../demo/file and ../demo/file/test
    What could I be missing?

    In the topology manager
    1. in the logical architecture : If it doesn't already exists (it should exist if your can use it on your local PC), you import the file technology
    2. In the physical architecture, you create your data server for files .In your case, it shoud already exist for same reason as above. Is has a blue icon under the file technology
    2. Select the Data Server, right click and select Insert Physical Schema . The Physical Schema window appears. On Definition tab, enter a name and then the path of your directory in the data schema field. No need to enyter a work schema for files.
    4. Go to the Context tab, Select a Context and an existing Logical Schema for this new Physical Schema.
    Select an existing Context in the left column, the type the name of a Logical Schema in the right column. This Logical Schema is automatically created and associated to this physical schema in this context.
    It should work but i have never experienced it on a Linux system...

  • Weird problem with loading data from an XML using a for loop

    Hi,
    I have a strange problem. I have encountered this thing many a times but still don't know the proper workaround for it.
    I am trying to load swf file, a video file or an image. They can be present on a local system or on a remote server also. All the entries corresponding to the files to be loaded is made in an XML file. I traverse through the nodes of the XML using a for loop. On the complete event of loader info, example:.
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    I fill a container with the loaded data.
    My problem is when I am using for loop it doesn't works properly but if i use a statement like this:
    someFunc()
         if(i<arr.length())
         ... do something...
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
    private function onComplete(e:Event):void
    ... do something...
    i++;
    All files are loaded properly.
    I think this can be because the for loop processes pretty fast but the content takes time to load, which ultimately leads to some wierd results.
    Please let me know how can this thing be done correctly by using a for loop also.

    You don't want to use a for loop to load several items.  The way you almost appear to have it is the proper approach... load a file and use the completion of its loading to trigger loading the next file.

  • Problem with loading Images from Google

    if i click on one of this pictures & chose open in new tab https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=23a96ac6-b84d-4e5a-be5f-ee9132199fac new windows starts loading, but the loading never ends, in past it use to open this page full screen if i chose open in next tab https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=bab88957-319a-4363-94c3-3249dffdb36a, & firefox starts to consume a lot of Disk usage when its loading endlessly https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=0da2dd58-2534-4f61-80e7-c5810795a79d, whats up with fox? tried that thing with IE to, no endless loading, but kind of like plank page, background same color like u see on the link (dark), but no picture full page dark, & IE has no adds, did google change how this works?, but they are just not finished removing the stuff & that left plank page & fox is unable to load this blank page?, so i guess its not much issue with images, but didn't know how to name the topic
    all my adds, for extra information
    Adblock Edge
    Enforce Encryption
    Ghostery
    More In Content UI +

    Test in a similar manner to my suggestion in your memory leaks question [/questions/1048975]
    You are using plugins that are designed to block things and that is probably what is occurring, especially with multiple such plugins.
    See also
    * [[Use the Profile Manager to create and remove Firefox profiles]]
    * [[Firefox uses too much memory (RAM) - How to fix]]
    *[[Disable or remove Add-ons]]
    Additionally also see
    *[[Websites show a spinning wheel and never finish loading]]
    *[[Firefox can't load websites but other browsers can]]
    Must admit I have not got a clue what ms fud.community.services. is

  • Issues with Loading Images from a Jar File

    This code snippet basically loops through a jar of gifs and loads them into a hashmap to be used later. The images all load into the HashMap just fine, I tested and made sure their widths and heights were changing as well as the buffer size from gif to gif. The problem comes in when some of the images are loaded to be painted they are incomplete it looks as though part of the image came through but not all of it, while other images look just fine. The old way in which we loaded the graphics didn't involve getting them from a jar file. My question is, is this a common problem with loading images from a jar from an applet? For a while I had tried to approach the problem by getting the URL of the image in a jar and passing that into the toolkit and creating the image that way, I was unsuccessful in getting that to work.
    //app is the Japplet
    MediaTracker tracker = new MediaTracker(app);
    //jf represents the jar file obj, enum for looping through jar entries
    Enumeration e = jf.entries();
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    //buffer for reading image stream
    byte buffer [];
    while(e.hasMoreElements())
    fileName = e.nextElement().toString();
    InputStream inputstream = jf.getInputStream(jf.getEntry(fileName));
    buffer = new byte[inputstream.available()];
    inputstream.read(buffer);
    currentIm = toolkit.createImage(buffer);
    tracker.addImage(currentIm, 0);
    tracker.waitForAll();
    images.put(fileName.substring(0, fileName.indexOf(".")), currentIm);
    } //while
    }//try
    catch(Exception e)
    e.printStackTrace();
    }

    compressed files are not the problem. It is just the problem of the read not returning all the bytes. Here is a working implementation:
    InputStream is = jar.getInputStream(entry);
    ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
    try{
    byte[] buf = new byte[1024];
    int read;
    while((read = is.read(buf)) > 0) {
    os.write(buf, 0, read);
    catch(Exception e){
         e.printStackTrace();
         return null;
    image = Toolkit.getDefaultToolkit().createImage(os.toByteArray());
    This works but I think you end up opening the jar a second time and downloading it from the server again. Another way of getting the images is using the class loader:
    InputStream is = MyApplet.class.getResourceAsStream(strImageName);
    In this case, the image file needs to be at the same level than MyApplet.class but you don't get the benefit of enumerating of the images available in the jar.

  • Problem With Loading the jars

    Hello Experts,
    I am facing a problem with loading classes.
    i have written one application which is running on server.in that application want to use certain jars(Classes)and those jars anmes and
    classes inside the jars are same.based on the condition i want to call
    corresponding class.
    can any one suggest the solution
    it's urgent
    any help will be appriciated
    thanks in advance
    With regds
    Bankuru

    Hi Yogee,
    Thanks for ur help.
    i have 4.o jars and 5.1 version jars.depending on the condingtion system must use the corrensponding jar.the problem here is that both jars has same clasees and code inside that one is differnet.
    when i run application with 4.o condition then 5.1 is not working and
    if i run tha application with 5.1 then 4.o is not working.
    can u please suggest the possible solution
    i have deployed these jars in application server
    With Regds
    Bankuru

  • Beginner Has Problem With Loading JDBC Driver Using MySQL

    Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
    1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
    sql> select * from videos
    2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
    3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
    4. MySQL server is running
    C:\> C:\mysql\bin\mysqld-nt --standalone
    5. open another DOS window and use the database
    mysql>USE SOUP
    6. succesfully compiled a Java program (javac Test.java):
    import java.sql.* ;
    public class Test
    public static void main( String[] args )
    try
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    try
    Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
    try
    Statement statement = con.createStatement();
    ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
    while ( rs.next() )
    System.out.println( rs.getString( "TITLE" ) );
    rs.close();
    statement.close();
    catch ( SQLException e )
    System.out.println( "JDBC error: " + e );
    finally
    con.close();
    catch( SQLException e )
    System.out.println( "could not get JDBC connection: " + e );
    catch( Exception e )
    System.out.println( "could not load JDBC driver: " + e );
    7. when I run the Java program (java Test), I got
    the message:
    could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    What am I missing?

    Hi,
    I missed to specify test in my last post.
    Try running your program by explicitly setting the classspath when
    running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
    Make sure your jar file contains org.gjt.mm.mysql.Driver class

  • Problem with loading data to Essbase

    Hi All,
    I have a problem with loading data into Essbase. I've prepared maxl script to load the data, calling rule file. The source table is located in RDBMS Oracle. The script works correctly, ie. generally loads data into Essbase.
    But the problem lies in the fact, that after deletion of data from Essbase, when I'm trying to load it again from the source table I get the message: WARNING - 1003035 - No data values modified by load of this data file - although there is no data in Essbase... I've also tried to change the mode of loading data from 'overwrite' to 'add to existing values' (in rule file) but it does'nt help ... Any ideas what can I do?

    Below few lines from EPM_ORACLE_INSTANCE/diagnostics/logs/essbase/dataload_ODL.err:
    [2013-09-24T12:01:40.480-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received Validate Login Session request
    [2013-09-24T12:01:40.482-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received client request: Get App and Database Status (from user [admin@Native Directory])
    [2013-09-24T12:01:54.488-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: MaxL: Execute (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Received client request: MaxL: Describe (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [MLEXEC-2] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Output columns described
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Define (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [MLEXEC-3] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Record(s) fetched
    [2013-09-24T12:01:54.496-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.498-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received Validate Login Session request
    [2013-09-24T12:01:54.499-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: Get Application State (from user [admin@Native Directory])

  • Problems with loading native library/missing methods:no ttJdbcCS in java.li

    Iam facing one problem while connecting the timesten client to the server The SQL Exception which Iam getting is pasted below:-
    Problems with loading native library/missing methods: no ttJdbcCS in java.library.path
    I am working with MAC OS X 10.7.2 and my timesten client version is 11.2.1.0
    I have also changed the Java Preferences from 64-bit to 32-bit but still whenever i tried to connect with the SQL Developer it gives me the above error.

    I just tried this out. My environment is OS X 10.7.4, Timesten (32-bit) client 11.2.1.9.0, SQL Developer 3.1.07, Oracle Java 1.7.0_04.
    The key things you need to be sure to do (in a terminal window) are:
    1. Be sure to . in the TimesTen environment script <tt_install_dir>/bin/ttenv.sh to set the full TT environment.
    2. Change directory to SQLDeveloper.app/Contents/Resources/sqldeveloper
    3. Run 'sh sqldeveloper.sh -J-d32'
    and all should be fine.
    Note that if you are using Java7 as I am then there is a step 1a. Change the CLASSPATH environment variable to specify ttjdbc6.jar not ttjdbc5.jar. For some reason running the app directly from Finder does not work even if you add -J-d32 into the sqldeveloper launch script. I'm still looking into that.
    Chris

  • Problem while loading data from ODS to infoobject

    Hi guys,
    I am facing problem while loading data from <b>ODS to infoobject</b>.
    If I load data via PSA it works fine but
    if I load data without PSA its giving error as Duplicate records.
    Do u have any idea why it is so.
    Thanks in advance
    savio

    Hi,
    when you load the data via the PSA, what did you select? Serial or Paralel?
    If you select serial most likely you don't have duplicates within the same datapackage and your load can go through.
    Loading directly in the IObj will happen thefore if you have the same key in two different packages, the "duplicate records" will be raised; you can perhaps flag your IPack with the option "ignore duplicate records" as suggested...
    hope this helps...
    Olivier.

Maybe you are looking for

  • Printer will not list in the drop down menu

    I have an HP Officejet 6500A (E710) printer running with Windows 7. When I route a word document to the print menu the "name" box is empty. The drop down menu includes the all the printers with the Officejet as the default printer but when I clink on

  • Why is the Library hidden in Lion?

    I find this very strange and annoying. Is there any way to unhide it? Or can someone please explain the rational behind this change?

  • AS 101 question on loops

    I'm stuck on something that's really fundamental and it's driving me nuts. I've got five buttons labeled "btn_1", "btn_2", etc. When a button is pressed, I'd like to trace it's corresponding number. When I try this: for(var i:Number=1;i<6;i++){ this[

  • Funny modulus result? If this a rounding error?

    Hi, Strangely, I'm getting the following result in the ESTK Javascript console: 492.1 % 13.3 Result: 13.3 Clearly the result should be 0 (since 492.1 is a multiple of 13.3). What's going on? Is this because of floating-point arithmetic? In any case,

  • Ibook G4 14": "?" at norm bootup, no HD in Disk Utility with CD bootup

    Model G4, 14", OS 10.3.4, Model A1055. Date on label is 2003. Two brand new hard drives have been put in this computer, with the same non-result. Hard drive info at bottom. Symptoms (with either HD installed): 1) Flashing question mark and 'face' fol