Inner Class metadata file name?

Dear All,
I have a problem creating metadata file for static inner class. My
environment (JBuilder 7.0 enterprise, KODO 1.4.1)
Here is my example:
package com.test;
public class ClassA
public static class ClassB
private String f1;
private String f2;
Now I have the following problems:
1. I have to manually define metadata file (I can't use JBuilder Kodo
plugin it can't generate one for me when I want inner class to be JDO
persistent)
2. What name of .jdo file should be? I tried both "ClassB.jdo" and
"ClassA.jdo" with no success... In JBiulder there is a KODO DataBase
schema tool that complains that it can't find metadata for the file (see
at the end trace stack:
3. Here is my metadata file content, is it correct?
<?xml version="1.0"?>
<jdo>
<package name="com.test">
<class name="ClassA$ClassB"/>
</package>
</jdo>
==========
Mon Mar 31 15:47:38 SGT 2003: ERROR: javax.jdo.JDOFatalUserException: Type
"class com.test.ClassA$ClassB" does not have JDO metadata.
Mon Mar 31 15:47:38 SGT 2003: ERROR: javax.jdo.JDOFatalUserException: Type
"class com.test.ClassA$ClassB" does not have JDO metadata.
     at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java:108)
     at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java:85)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.createMappings(SchemaTool.java:802)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:333)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:321)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1136)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.execute(SchemaToolDialog.java:236)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.execute(SchemaToolDialog.java:217)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.actionPerformed(SchemaToolDialog.java:202)
     at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
     at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
     at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
     at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
     at java.awt.Component.processMouseEvent(Component.java:3715)
     at java.awt.Component.processEvent(Component.java:3544)
     at java.awt.Container.processEvent(Container.java:1164)
     at java.awt.Component.dispatchEventImpl(Component.java:2593)
     at java.awt.Container.dispatchEventImpl(Container.java:1213)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
     at java.awt.Container.dispatchEventImpl(Container.java:1200)
     at java.awt.Window.dispatchEventImpl(Window.java:914)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
     at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
     at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
     at java.awt.Dialog.show(Dialog.java:380)
     at com.borland.primetime.ui.DefaultDialog.show(Unknown Source)
     at java.awt.Component.show(Component.java:946)
     at java.awt.Component.setVisible(Component.java:903)
     at com.borland.primetime.ui.DefaultDialog.showModalDialog(Unknown Source)
     at com.borland.primetime.ui.DefaultDialog.showModalDialog(Unknown Source)
     at
com.solarmetric.modules.integration.jbuilder.SchemaToolAction.perform(SchemaToolAction.java:60)
     at
com.solarmetric.modules.integration.jbuilder.SafeBrowserAction.actionPerformed(SafeBrowserAction.java:72)
     at com.borland.primetime.ide.BrowserAction.actionPerformed(Unknown Source)
     at com.borland.primetime.actions.r.actionPerformed(Unknown Source)
     at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
     at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
     at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
     at javax.swing.AbstractButton.doClick(AbstractButton.java:279)
     at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:886)
     at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:230)
     at java.awt.Component.processMouseEvent(Component.java:3715)
     at java.awt.Component.processEvent(Component.java:3544)
     at java.awt.Container.processEvent(Container.java:1164)
     at java.awt.Component.dispatchEventImpl(Component.java:2593)
     at java.awt.Container.dispatchEventImpl(Container.java:1213)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
     at java.awt.Container.dispatchEventImpl(Container.java:1200)
     at java.awt.Window.dispatchEventImpl(Window.java:914)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
     at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
     at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
==============
best regards,
Ruslan Zenin

Ruslan-
In article <[email protected]>, Ruslan Zenin wrote:
1. I have to manually define metadata file (I can't use JBuilder Kodo
plugin it can't generate one for me when I want inner class to be JDO
persistent)Yes, this is a limitation of Kodo's JBuilder integration currently.
2. What name of .jdo file should be? I tried both "ClassB.jdo" and
"ClassA.jdo" with no success... In JBiulder there is a KODO DataBase
schema tool that complains that it can't find metadata for the file (see
at the end trace stack:Well, you can certainly put it in the packagename.jdo file if you want
to go that route. Otherwise, you can define it in a file named
"ClassA$ClassB.jdo" (assuming that the IDE will allow you to create a
file with a '$' character in it).
3. Here is my metadata file content, is it correct?Yes, that looks correct.
<?xml version="1.0"?>
<jdo>
<package name="com.test">
<class name="ClassA$ClassB"/>
</package>
</jdo>
==========
Mon Mar 31 15:47:38 SGT 2003: ERROR: javax.jdo.JDOFatalUserException: Type
"class com.test.ClassA$ClassB" does not have JDO metadata.
Mon Mar 31 15:47:38 SGT 2003: ERROR: javax.jdo.JDOFatalUserException: Type
"class com.test.ClassA$ClassB" does not have JDO metadata.
     at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java:108)
     at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java:85)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.createMappings(SchemaTool.java:802)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:333)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:321)
     at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1136)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.execute(SchemaToolDialog.java:236)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.execute(SchemaToolDialog.java:217)
     at
com.solarmetric.modules.integration.ui.SchemaToolDialog.actionPerformed(SchemaToolDialog.java:202)
     at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
     at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
     at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
     at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
     at java.awt.Component.processMouseEvent(Component.java:3715)
     at java.awt.Component.processEvent(Component.java:3544)
     at java.awt.Container.processEvent(Container.java:1164)
     at java.awt.Component.dispatchEventImpl(Component.java:2593)
     at java.awt.Container.dispatchEventImpl(Container.java:1213)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
     at java.awt.Container.dispatchEventImpl(Container.java:1200)
     at java.awt.Window.dispatchEventImpl(Window.java:914)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
     at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
     at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
     at java.awt.Dialog.show(Dialog.java:380)
     at com.borland.primetime.ui.DefaultDialog.show(Unknown Source)
     at java.awt.Component.show(Component.java:946)
     at java.awt.Component.setVisible(Component.java:903)
     at com.borland.primetime.ui.DefaultDialog.showModalDialog(Unknown Source)
     at com.borland.primetime.ui.DefaultDialog.showModalDialog(Unknown Source)
     at
com.solarmetric.modules.integration.jbuilder.SchemaToolAction.perform(SchemaToolAction.java:60)
     at
com.solarmetric.modules.integration.jbuilder.SafeBrowserAction.actionPerformed(SafeBrowserAction.java:72)
     at com.borland.primetime.ide.BrowserAction.actionPerformed(Unknown Source)
     at com.borland.primetime.actions.r.actionPerformed(Unknown Source)
     at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
     at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
     at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
     at javax.swing.AbstractButton.doClick(AbstractButton.java:279)
     at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:886)
     at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:230)
     at java.awt.Component.processMouseEvent(Component.java:3715)
     at java.awt.Component.processEvent(Component.java:3544)
     at java.awt.Container.processEvent(Container.java:1164)
     at java.awt.Component.dispatchEventImpl(Component.java:2593)
     at java.awt.Container.dispatchEventImpl(Container.java:1213)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
     at java.awt.Container.dispatchEventImpl(Container.java:1200)
     at java.awt.Window.dispatchEventImpl(Window.java:914)
     at java.awt.Component.dispatchEvent(Component.java:2497)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
     at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
     at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
==============
best regards,
Ruslan Zenin
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com

Similar Messages

  • Parametric inner classes have the same parametric tpye?

    The qestion I have is:
    If you have a parametric inner class with the name of the type parameter the same as the one of the parametric "outer" class. Are they the same?
    I think they should be, but I just made an obeservation that they probably aren't.
    The follwing code does not compile
    public class POC<E> {
        public Iterator<E> iterator() {
            return null;
        private class Magic<E> {
            private Iterator<E> iterator;
            public Magic() {
                Magic.this.iterator = POC.this.iterator();
    }What actually bugs me, is the error I got:
    incompatible types
    found: java.uti.Iterator<E>
    required: java.util.Iterator<E>
    hu? To me this looks like a match.
    I could get it to compile with an Instance of Iterator<E> passed to the constructor in stead of getting it by myself.
    And I use 1.5rc

    Probably because types E and T are not correlated:
    public class POC<E> {
        public Iterator<E> iterator() {
            return null;
        private class Magic<T> {
            private Iterator<T> iterator;
            public Magic() {
                Magic.this.iterator = POC.this.iterator();
    }The error message in this case is:
    POC.java: : incompatible types
    found   : java.util.Iterator<E>
    required: java.util.Iterator<T>
                Magic.this.iterator = POC.this.iterator();I've succeded to compile the following two programs:
    //1.
    public class POC<E> {
        public Iterator<E> iterator() {
            return null;
        private class Magic<E> {
            private Iterator<E> iterator;
            public Magic() {
                POC<E>  p = new POC<E>();
                iterator = p.iterator();
    // 2.
    public class POC<E> {
        public static <E> Iterator<E> iterator() {
            return null;
        private static class Magic<E> {
            private Iterator<E> iterator;
            public Magic() {
                iterator = POC.iterator();
    }Which one suits you best?
    Best regards,
    Andrej

  • Jar files and Inner classes..

    I am trying to compile a java source file of a class that has an inner class.. using GNU Make. I am not sure if the .jar file is packing properly, because I get an error :
    Exception in thread "main" java.lang.NoClassDefFoundError: Airport$PortCode
            at Airport.getCode(Airport.java:133)
            at Airport.test1(Airport.java:228)
            at Airport.run(Airport.java:241)
            at Airport.main(Airport.java:255)where Airport.class is the main class and Airport$PortCode is an inner class of it (it is not static and is declared public)
    it works when I use it via "java Airport" but again i get the above error when I run with "airport.jar"
    thanks for you help

    I tried to test it on UNIX, but it replied to my
    commandUh, I am not so lucky to have a UNIX license (and don't see the need). Possibly the find on UNIX is different from GNU's find.
    find: path-list predicate-listUse backticks: The output of the command between backticks is used as the value for the shell variable. Possibly it could be the case that your find program does not allow the omission of the path list, then just make it:
    CLASSES=/home/here/there/project/classes
    `find $CLASSES -name "*.class"`Execute this command and the output of the command executed can be used as a return value.
    -name "*.class"look for all files ending on name.
    You can always do:
    $ man find (man is great)
    or
    $ info find>
    >
    >
    JARCLS    = `find -name "*.class"`

  • JAXB: Error compiling classes generated by xjc (file name too long)

    Hi friends,
    I am trying to compile classes that are generated by using XJC tool on xsd file. The compilation fails with following message.
    buildxsdmodel:
        [javac] Compiling 794 source files to /home/uchamad/working/teleworker/ejb/build/classes
        [javac] /home/uchamad/working/teleworker/ejb/build/tmpsrc/uk/co/novatel/teleworker/model/wlr/bulksearch
    results/impl/ApplicationInformationTypeImpl.java:58372: error while writing
    uk.co.novatel.teleworker.model.wlr.bulksearchresults.impl.ApplicationInformationTypeImpl.XMLRequestID
    TypeImpl.SearchOrderResultsTypeImpl.SearchTypeDetailTypeImpl.OrderTypeImpl.OrderDetailsTypeImpl.
    OrderLinesTypeImpl.NumberPortingTypeImpl.OLODetailsTypeImpl.NumberLocationTypeImpl.OLOMainP
    STN1AddressTypeImpl.Unmarshaller: /home/uchamad/working/teleworker/ejb/build/classes/uk/co/novatel
    /teleworker/model/wlr/bulksearchresults/impl/ApplicationInformationTypeImpl$XMLRequestIDTypeImpl$S
    earchOrderResultsTypeImpl$SearchTypeDetailTypeImpl$OrderTypeImpl$OrderDetailsTypeImpl$OrderLin
    esTypeImpl$NumberPortingTypeImpl$OLODetailsTypeImpl$NumberLocationTypeImpl$OLOMainPSTN1A
    ddressTypeImpl$Unmarshaller.class (File name too long)
        [javac]                                             public class Unmarshaller
        [javac]                                                    ^
        [javac] 1 error
    The compiler is complaining about the file name being too long. This is happening because the java classes when generated from XSD contains deep nesting of inner classes. So when it comes to compile the .class name file is too long for the operating system.
    I am trying this on unix box.
    I wonder if there is a way to configure XJC so that it does not produce inner classes but instead keep them out.
    Any help would be appreciated.
    many thanks
    Usmangani

    Flattening your schema definition will flatten the output files, too -- that will probably be nice for coding as well since you wont have to use class names such as SomeTypeNestedInAnotherTypeThatHasYetAnotherType. Instead of having all of the elements defined directly within the enclosing root element, define logical chunks at the top level and incorporate them in the definition of real root element of your documents by reference.

  • How to specify relative path for file name in java class

    I have a directory structure like this.
    C:\Aurora\com\optemys\aurora\validation
    I have a class Test.java under the validation folder.
    I have various files under the same folder i.e validation.
    If I want to access the file "test.properties" in Test.java, how can I just specify "test.properties" & not "C:\Aurora\com\optemys\aurora\validation\test.properties".
    I dont want to hardcode any file path into the class. How can I specify the relative file name into the class.
    Thanks In Advance
    Sachin

    switch the name in Test.properties and use
    this.getClass().getResourceAsStream(fileName)

  • Class name and file name

    if i have putiple classes in a single file then if a clas declared as public then the file name shoud me same as class name.... why?
    if i declare two public class in a same source fiel what will happen????????
    plz help................
    thanks in advance

    And i bet a million dollars that even you don't
    search the forum before posting anything . So stop
    suggesting that .Too bad that I wasn't included in the bet. You won't be coz you are a veteran and it's from you and the other veterans(I will include my peers as well) that i learnt a lot including good googling.
    It happens
    that I search the forum before I post an answer.
    Searching the forum using google is actually very
    effective.Yes and thats the very reason i didn't mention googling in that reply because i know that google gives the results from the threads in the forum as i myself have read a lot of posts at this forum using google and obtained solutions.But it's a different case when a person has to manually search the forum(without google) to see if a topic matches his needs and as i just mentioned off lately most of the posts come out with crappy headers like "Please Help Me" ; "Error" ; "Can't compile" ; "Help Needed" ; "What's wrong in this".How much sense does these headers make with respect to the what the post is really about.One can't expect a person to verify each such post with such crappy headers and read each's contentns.Just imagine how frustrating it is.Even the posters lose their cool when someone posts with such titles.Then just imagine what will be the condition of the person who is asked to check the forum before posting.But i totally endorse googling.There is no pardon or any sort of respite for a person who has posted without googling which would have fetched him top notch answers.
    Oh God!That looks really long!

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • Passing Inner class name as parameter

    Hi,
    How i can pass inner class name as parameter which is used to create object of inner class in the receiving method (class.formane(className))
    Hope somebody can help me.
    Thanks in advance.
    Prem

    No, because an inner class can never have a constructor that doesn't take any arguments.
    Without going through reflection, you always need an instance of the outer class to instantiate the inner class. Internally this instance is passed as a parameter to the inner class's constructor. So to create an instance of an inner class through reflection you need to get the appropriate constructor and call its newInstance method. Here's a complete example:import java.lang.reflect.Constructor;
    class Outer {
        class Inner {
        public static void main(String[] args) throws Exception{
            Class c = Class.forName("Outer$Inner");
            Constructor cnstrctr = c.getDeclaredConstructor(new Class[] {Outer.class});
            Outer o = new Outer();
            Inner i = (Inner) cnstrctr.newInstance(new Object[]{o});
            System.out.println(i);
    }

  • How to Load a class file base on .class file name???

    Hi,
    Can anyone help me?
    1) Based on filename (d:\temp\bla.class), I want to load this bla.class and get the actual package of this class.
    example:
    package something.temp;
    public class bla
    I want to load the file base on filename and get the package of the class. Is it possible ?
    Thank you.

    Hi nikki96,
    It will not work. I will get java.lang.NoClassDefFoundError eventhough I extends classloader to use the findClass(String filename);
    Example:
    import java.security.*;
    import java.util.Enumeration;
    import java.util.NoSuchElementException;
    import java.util.jar.Attributes;
    import java.util.jar.Manifest;
    import sun.misc.Resource;
    import sun.misc.URLClassPath;
    public class MyURLClassLoader extends ClassLoader
    String host;
    int port;
    public Class findClass(String name)
                   try
         byte[] b = loadClassData(name);
         return defineClass(name, b, 0, b.length);
                   } catch(Exception e)
                        e.printStackTrace();
                   return null;
    private byte[] loadClassData(String name) throws Exception
                   // load the class data from the connection
                   File file = new File(name);
                   InputStream is = new FileInputStream(file);
                   long length = file.length();
                   // You cannot create an array using a long type.
                   // It needs to be an int type.
                   // Before converting to an int type, check
                   // to ensure that file is not larger than Integer.MAX_VALUE.
                   if (length > Integer.MAX_VALUE) {
                        // File is too large
                   // Create the byte array to hold the data
                   byte[] bytes = new byte[(int)length];
                   // Read in the bytes
                   int offset = 0;
                   int numRead = 0;
                   while (offset < bytes.length
                        && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                        offset += numRead;
                   // Ensure all the bytes have been read in
                   if (offset < bytes.length) {
                        throw new IOException("Could not completely read file "+file.getName());
                   // Close the input stream and return bytes
                   is.close();
                   return bytes;
    Problem: The class file is not in the proper package (d:\temp\bla.class) where the proper package is d:\something\temp\bla.class.
    Objective: I just want to base on the bla.class (no matter where is it located), then get the package of the classfile (bla.class) like example something.temp.
    Simple as that but I don't know how to do :(.

  • How to call inner class method in one java file from another java file?

    hello guyz, i m tryin to access an inner class method defined in one class from another class... i m posting the code too wit error. plz help me out.
    // test1.java
    public class test1
         public test1()
              test t = new test();
         public class test
              test()
              public int geti()
                   int i=10;
                   return i;
    // test2.java
    class test2
         public static void main(String[] args)
              test1 t1 = new test1();
              System.out.println(t1.t.i);
    i m getting error as
    test2.java:7: cannot resolve symbol
    symbol : variable t
    location: class test1
              System.out.println(t1.t.geti());
    ^

    There are various ways to define and use nested classes. Here is a common pattern. The inner class is private but implements an interface visible to the client. The enclosing class provides a factory method to create instances of the inner class.
    interface I {
        void method();
    class Outer {
        private String name;
        public Outer(String name) {
            this.name = name;
        public I createInner() {
            return new Inner();
        private class Inner implements I {
            public void method() {
                System.out.format("Enclosing object's name is %s%n", name);
    public class Demo {
        public static void main(String[] args) {
            Outer outer = new Outer("Otto");
            I junior = outer.createInner();
            junior.method();
    }

  • Custom metadata fields used in file name?

    Hi,
    Is it possible to add to the list of meta data fields that are used as tokens for file names?
    I've been using Rob Cole's excellent custom meta data in the library module and now I want to use these fields to name the file during export...
    While at it, is it possible to add the same custom meta data fields to the info view overlay in develop mode?
    Cheers,
    Bonny

    1.  Its possible an export filter (post-process action) could be defined that supports the custom metadata for export filenaming (Lightroom itself does not have any other hooks I'm aware of) - dunno if anyone's done that, yet.
    2.  I think not (see PM).
    Rob

  • Unable to change file name in Metadata pane - Lightroom 2

    I can't seem to activate the file name area in the Metadata pane in the Library module. It is solid gray and I cannot make the area active. With the correct folder active, the files seem to be normal in all visible ways, but the ability to change the name is not available. This is true in Grid or Loupe views. It is true with only one Active image. Any thoughts?

    Are the images on-line? Though that shouldn't make a difference. You should still get a non-grayed out filename and get a warning dialog, instead if you try to set a name change.
    Don

  • File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled.

    I have duplicated a project to work on another computer. The project opens fine but when I import new footage/audio files I get this message. "File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled." Then I can't play my timeline and Premier Pro crashes.  I have to force quit and restart my computer to continue working. What does this error really mean? How do you rectify?
    Our workflow requires that we duplicate projects to make updates because we are frequently revising but need to keep original project unchanged and intact.

    I have a similar issue and message , but occurs when I import AVI clips from OnLocation CS4 to Premier Pro CS4.

  • Batch rename files preserving the original file name in metadata

    How can I batch rename files while preserving the original file name in metadata? (Don't want the old file name as part of the new file name)
    (Adobe CS Bridge can do this with some success, but I don't want to be dependant on this software. Results are inconsistent.)

    With a simple terminal script. More details needed, though.

  • Error in File name or class name not found during Automation operation: 'CreateObj​ect'

    Hello Team,
    When I am trying to execute the below code i am getting the following error. Any help would be greatly appreciated.
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not oFSO.FolderExists(SavePath) Then
    Set f = oFSO.CreateFolder(SavePath)
    Else
    End If
    53 4/11/2014 12:27:22 PM Error:
    Error in <NoName(4).VBS> (Line: 9, Column: 1):
    File name or class name not found during Automation operation: 'CreateObject'
    I have googled through the error and tried to re-register the scrrun.dll using regsvr32 eventhogh it is successfully registered, i am getting the following error. My PC is windows 7 32bit OS.
    any help is greatly appreciated.

    The following script class will write a log file entry. See if it will run for you.
    The script is using a class object that you might not have seen before. A little intro:  The top section is just for testing the class. Normally I just comment this out after the class is working well.  It should run right way. I would save the vbs file in the editor, That way when you are using autoactpath or currentscriptpath variables they will be able resolve the paths.
    Paul
    Attachments:
    LoggingCode_V2.VBS ‏5 KB

Maybe you are looking for