Class dependency Tool?

How does one get build order of the classes when a compile is done?
Tried javac -verbose and the results were not satisfactory.
There are 1000s of files in question. The end result is to make a makefile.
This is urgent by the way...
Thank you.

You shouldn't rely upon javac to determine dependancies. It is not the best at doing that. I would suggest maybe looking for some third party utilities that will examine your source files and determine the dependancies for you. Unfortunately I don't know of any that I can tell you about, but I would be suprised if there aren't any out there. Also, about that makefile stuff. Generally with make files, the compiler is called separately for each file. The java compiler is written in java, so running it requires starting the VM. This can seriously inflate compile times since the VM starts and shuts down for each file. Apache Ant is written in java also and it accesses the compiler as a class so that it doesn't need to fork a new runtime. This can seriously reduce compile time, so you may want to keep that in mind with your 1000 source files.

Similar Messages

  • In search of java class dependency utility

    Folks,
    We have developed a J2EE application where the "client" is a java
    application. In other words, we have created a JAR file that a user
    uses to launch our application. The manifest for this JAR file has a
    "Main-Class" attribute, so the following command is used to launch the
    (client side of) the application:
    java -jar our.jarOur entire application (both client-side and server-side) consists of
    several hundred classes. Our problem is that we don't have an accurate
    list of which classes are client-side only, which classes are
    server-side only, and which classes are required by both (client-side
    and server-side). I want our client-side JAR to only contain classes
    required by the client. Currently, we are simply bundling all the
    classes into "our.jar".
    I have found (and tried) several utilities, including:
    http://depfind.sourceforge.net/
    http://www.clarkware.com/software/JDepend.html
    http://www.horstmann.com/articles/BetterCleaner.html
    However, I don't think these are suitable. You need to supply a class
    name, and they only tell you the classes that either depend on the
    given class, or that the given class depends on. What I want is a
    "recursive" dependency finder.
    For example, let's say I have class "A". Class "A" depends on class "B"
    (in other words, class "A" needs to import class "B"). Now class "B"
    depends on class "C" and class "C" depends on class "D". Also, we have
    class "E" that depends on class "A" (in other words, class "E" needs to
    import class "A").
    The tools I mentioned above will only return (at most), classes "B" and
    "E" (when I supply them with class "A"), but what I really need them to
    return is classes "B","C" and "D" (and not necessarily class "E").
    Does anyone know how I can achieve this?
    Thanks (in advance),
    Avi.

    ClassDep from jini provides the same functionality as GenJar but I have found it better to work with. You do not need ant to run it although it does come with an ant task. ClassDep.java has a public static void main (String[] args ).
    http://java.sun.com/products/jini/2.0/doc/api/com/sun/jini/tool/ClassDep.html provides the documentation on how to use it.

  • Instance of one of implementations of abstract class depending on context??

    Hi all,
    I just wonder if it is possible in Java to call creation of a new instance of an implementation of an abstract class depending on context.
    I mean something like:
    abstract class Abstract
    //1st implementation of Abstract class
    class Concrete1 extends Abstract
    //2nd implementation of Abstract class
    class Concrete2 extends Abstract
    }And now, somewhere else in the code, I would really need to call something like this:
    Abstract test1 = new ...(); //here I need sometimes to be created instance of Concrete1, sometimes instance of Concrete2
    Is there a way how to do this??

    Some more concrete code if it helps:
    Abstract class:
    * Individual.java
    * Created on 21. leden 2007, 1:08
    package genetics;
    * Abstract class defining fields and methods of one individual for genetic algorithms
    * This class is supposed to be implemented according to problem to be solved
    * @author Richard V�tek
    * @version 1.0
    abstract public class Individual implements Comparable<Individual>
       * Create random chromosomes for this individual
      protected abstract void createRandomChromosomes();
       * Count fitness of this individual
       * This number says how good is this individual (the higher number the better).
       * Better fitness means that this individual is closer to solution.
       * @return  int   Fitness of this individual
      protected abstract int getFitness();
       * Cross-breed this individual with another individual
       * This leaves untouched number of chromosomes to certain (randomly generated) position.
       * From this position on, it will swap chromosomes between this and another individual.
       * So this individual gets changed (cross-breeded) as well as the other, which is returned
       * as result of this method.
       * @param   other              The other individual to cross-breed with
       * @return  Individual         Hybrid of this and another individual (in fact, the other individual
       *                             after cross-breed (this (source) individual gets changed too after cross-breed)
      protected abstract Individual crossbreed(Individual other);
       * Mutate this individual
       * Mutate chromosomes of this individual; every chromosome is mutated
       * with probability set in settings of evolution.
       * This probability is supposed to be quite low number, roughly 1 %.
      protected abstract void mutate();
       * Check this individual
       * Check if this individual still suits the assignment.
       * If not, repair this individual to suit it again.
      protected abstract void check();
       * Implementation of Comparable: comparing of individuals by fitness
       * @param other Another individual to compare
      public int compareTo(Individual other)
        return this.getFitness() - other.getFitness();
    One implementation class:
    * KnapsackIndividual.java
    * Created on 21. leden 2007, 1:41
    package genetics;
    import java.util.Random;
    import java.util.TreeMap;
    import knapsack.KnapsackProblem;
    * This is practically the same as KnapsackProblem class but designed specially
    * for solving knapsack problem with genetic algorithm so all unnecessary fields
    * and methods are removed.
    * @author Richard V�tek
    * @version 1.0
    public class KnapsackIndividual extends Individual
       * Chromosomes of this individual
       * In case of knapsack problem, they are things currentl in knasack
      protected boolean[] arrChromosomes;
       * Cached value of fitness of this individual
       * Used to not to count fitness of this individual everytime when needed
       * (and it is often needed); once counted, it will be read from this cached value
      private int intFitnessCache = Integer.MIN_VALUE;
       * Randomizer for random-driven methods (like mutation, etc.)
      private Random randomizer = new Random();
       * Reference to evolution to read mutation probability from
      protected Evolution evolution;
       * Assignment of problem instance
      protected KnapsackProblem assignment;
       * Create a new Individual instance
       * @param   assignment  Object representing assignment of particular problem
       * @param   evolution   Reference to evolution object to be able to read evolution's settings from
      public KnapsackIndividual(KnapsackProblem assignment, Evolution evolution)
        this.assignment = assignment;
        this.evolution = evolution;
        this.arrChromosomes = new boolean[assignment.getNumberOfThings()];
       * Create random chromosomes for this individual
       * @see Individual#createRandomChromosomes()
      protected void createRandomChromosomes()
        int intChromosomeCount = this.arrChromosomes.length;
        for (int i = 0; i < intChromosomeCount; i++)
          this.arrChromosomes[i] = this.randomizer.nextBoolean();
       * Get fitness of this individual
       * In case of knapsack, fitness is sum of prices of all things currently in knapsack
       * @see Individual#getFitness()
      protected int getFitness()
        //if cached value exist, return it
        if (this.intFitnessCache != Integer.MIN_VALUE)
          return this.intFitnessCache;
        //otherwise, count fitness of this individual
        int intChromosomeCount = this.arrChromosomes.length;
        int intSumOfValues = 0;
        //in case of knapsack, fitness is value of all things currently in knapsack
        //(sum of values of all things in knapsack)
        for (int i = 0; i < intChromosomeCount; i++)
          intSumOfValues = this.assignment.arrPrices;
    //save counted fitness to cache
    this.intFitnessCache = intSumOfValues;
    return intSumOfValues;
    * Cross-breed two individuals
    * @param other The other individual for cross-breed
    * @return The other individual after cross-breed (but this individual is affected too)
    * @see Individual#crossbreed()
    protected Individual crossbreed(Individual other)
    int intChromosomeCount = this.arrChromosomes.length;
    //position from which on swap chromosomes of this and the other individual
    int intCrossbreedPosition = this.randomizer.nextInt(intChromosomeCount);
    boolean booTemp;
    //swap chromosomes from cross-breed position on
    for (int i = intCrossbreedPosition; i < intChromosomeCount; i++)
    booTemp = ((KnapsackIndividual) this).arrChromosomes[i];
    ((KnapsackIndividual) this).arrChromosomes[i] = ((KnapsackIndividual) other).arrChromosomes[i];
    ((KnapsackIndividual) other).arrChromosomes[i] = booTemp;
    return other;
    * Mutate individual chromosomes of this individual with certain probability
    * In case of knapsack, particular thing is just inserted/taken out of the knapsack
    * @see Individual#mutate()
    protected void mutate()
    //probability of mutation (in percents)
    int intMutationProbability = this.evolution.getMutationProbability();
    int intChromosomeCount = this.arrChromosomes.length;
    //iterate through all chromosomes, mutating them with certain (set) probability
    for (int i = 0; i < intChromosomeCount; i++)
    //mutation probability passed => mutate this chromosome
    if (this.randomizer.nextInt(100) < intMutationProbability)
    this.arrChromosomes[i] = !this.arrChromosomes[i];
    //when mutation finished, we must check if this individual still suits the assignment;
    //if not, repait it
    this.check();
    * Check if this individual still suits the assignment; if not, repair it
    * In case of knapsack it means that sum of weights of things currently in knapsack
    * will not exceed capacity of backpack; if exceeds, take out as many things as necessary
    * to not to exceed again; choose things to be taken out according to worst weight to price ratio
    * @see Individual#check()
    protected void check()
    int intSumOfWeights = 0;
    //list of things in the knapsack sorted by weight to price ratio
    //key: index of thing in knapsack
    //value: weight/price ratio
    TreeMap<Integer, Float> things = new TreeMap<Integer, Float>();
    for (int i = 0; i < this.arrChromosomes.length; i++)
    //thing in the knapsack
    if (this.arrChromosomes[i] == true)
    //add its weight to sum of weights
    intSumOfWeights += this.assignment.arrWeights[i];
    //add it to the list of things sorted by weight to price ratio
    things.put(i, (((float) this.assignment.arrWeights[i]) / ((float) this.assignment.arrPrices[i])));
    //sum of weights exceeds knapsack capacity => take out as many things as necessary
    while (intSumOfWeights > this.assignment.getKnapsackCapacity())
    //take out thing with worst weight/price ratio from all things currently in knapsack
    this.arrChromosomes[things.lastKey()] = false;
    //update sum of weights of things currently in knapsack
    intSumOfWeights -= things.get(things.lastKey());
    //also remove this thing from list of things
    things.remove(things.lastKey());
    And another class, where i need this feature (tried to use generics for that, but they can't be used in this way):
    * Evolution.java
    * Created on 21. leden 2007, 2:47
    package genetics;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.Arrays;
    * Class for algorithms using simulated evolution to deal with a problem
    * Tried to be designed general enough to allow to be used for every genetic algotihm.
    * If true, only class Individual must be implemented according to problem to be solved,
    * the rest of genetic algorithm stays the same.
    * @author Richard V�tek
    * @version
    public class Evolution<Problem, IndividualClass extends Individual>
       * Number of generations of evolution to finish
      protected int intGenerationCount;
       * Number of individuals in each generation
      protected int intGenerationSize;
       * Elite individual count
       * All elite individuals are just copied from one generation to another with no change
      protected int intGenerationEliteCount;
       * Number of individuals participating a tournament
       * To select an good individual for next generation, tournaments are hold.
       * This affects number of individuals which one good individual is selected
       * from in one tournament.
       * @see <a href="http://cs.felk.cvut.cz/%7Exobitko/ga/example_f.html">Genetic Algorithm Example Applet</a>
      protected int intGenerationTournamentSize;
       * Probability of mutation (in percents)
      protected int intMutationProbability;
       * Current generation of individuals in evolution
      protected Generation<IndividualClass> thisGeneration;
       * Next generation of individuals in evolution
      protected Generation<IndividualClass> nextGeneration;
       * Fitness of best individual in this generation
      private int intIndividualBestFitness;
       * Sum of fitnesses of all individuals in this generation
      private int intIndividualsSumFitness;
       * Fitness of worst individual in this generation
      private int intIndividualWorstFitness;
       * Fitness of best elite individual in (every) generation
       * Auxilliary variable to not to count statistics for elite individuals
       * in each generation as well (not needed - elite individuals don't change themselves)
      private int intIndividualEliteBestFitness;
       * Sum of fitnesses of all elite individuals in (every) generation
       * Auxilliary variable to not to count statistics for elite individuals
       * in each generation as well (not needed - elite individuals don't change themselves)
      private int intIndividualElitesSumFitness;
       * Fitness of worst elite individual in (every) generation
       * Auxilliary variable to not to count statistics for elite individuals
       * in each generation as well (not needed - elite individuals don't change themselves)
      private int intIndividualEliteWorstFitness;
       * Create a new instance of Evolution (settings passed through parameters)
       * @param   intGenerationCount            Number of generation of evolution to finish
       * @param   intGenerationSize             Number of individuals in each generation
       * @param   intGenerationEliteRatio       Elite individuals to generation size ratio (in percents)
       * @param   intGenerationTournamentRatio  Members of tournament to generation size ratio (in percents)
       * @param   intMutationProbability        Probability of mutation of each chromosome of each individual of generation (in percents)
       * @see     #intGenerationEliteCount
       * @see     #intGenerationTournamentSize
      public Evolution(
        int intGenerationCount, int intGenerationSize,
        int intGenerationEliteRatio, int intGenerationTournamentRatio,
        int intMutationProbability)
        this.intGenerationCount = intGenerationCount;
        this.intGenerationSize = intGenerationSize;
        this.intGenerationEliteCount = (int) (intGenerationSize * (intGenerationEliteRatio / 100.0));
        this.intGenerationTournamentSize = (int) (intGenerationSize * (intGenerationTournamentRatio / 100.0));
        this.intMutationProbability = intMutationProbability;
       * Create a new instance of Evolution (settings loaded from settings file)
       * @param   strSettingFile  Name of file containing settings for evolution
       * @throws  IOException     File does not exist, cannot be read, etc.
       * @throws  Exception       Another exception occured during loading of file
      public Evolution(String strSettingFile)
        BufferedReader settings;
        String settingsLine;
        int intLineCounter = 0;
        int intSetting;
        try
          settings = new BufferedReader(new FileReader(strSettingFile));
          while ((settingsLine = settings.readLine()) != null)
            intLineCounter++;
            settingsLine = settingsLine.substring(0, settingsLine.indexOf("\t"));
            intSetting = Integer.parseInt(settingsLine);
            switch (intLineCounter)
              case 1:
                this.intGenerationCount = intSetting;
                break;
              case 2:
                this.intGenerationSize = intSetting;
                break;
              case 3:
                this.intGenerationEliteCount = (int) (this.intGenerationSize * (intSetting / 100.0));
                break;
              case 4:
                this.intGenerationTournamentSize = (int) (this.intGenerationSize * (intSetting / 100.0));
                break;
              case 5:
                this.intMutationProbability = intSetting;
                break;
            } //switch
          } //while
          //after reading has been completed, let's close the stream
          settings.close();
        } //try
        //IO exception - file not found, cannot be read, etc.
        catch (IOException ioe)
          System.out.println("Vyskytl se I/O probl�m p&#345;i na&#269;�t�n� zad�n� ze souboru " + strSettingFile);
        //Exception - another problem during reading of file
        catch (Exception e)
          System.out.printf("Vyskytl se n&#283;jak� divn� probl�m p&#345;i na&#269;�t�n� zad�n� ze souboru %s. V�pis vyj�mky:\n", strSettingFile);
          e.printStackTrace();
       * Vivify first generation for evolution
       * Necessary number of individuals is created with random chromosomes.
       * Their chromosomes must then be checked if they suit the assignment
       * and if not so, repaired.
      private Generation<IndividualClass> vivifyFirstGeneration()
        //create a brand-new generation
        Generation generation = new Generation<IndividualClass>(this);
        int intTemp;
        //for all individual of this generation
        for (int i = 0; i < this.intGenerationSize; i++)
    //create an individual with no chromosomes
    generation.arrIndividuals[i] = new IndividualClass(this, Problem);
          //create a set of random chromosomes
          neration.arrIndividuals.createRandomChromosomes();
    //if these chromosomes does not suit assignment, repair them
    generation.arrIndividuals[i].check();
    //sort Individuals by fitness so elite individuals get to first positions of array
    Arrays.sort(generation.arrIndividuals);
    //now count statistics for elite individuals (it is enough to count them once,
    //elite don't get changed so their statistics don't get changed either)
    this.intIndividualEliteBestFitness = Integer.MIN_VALUE;
    this.intIndividualElitesSumFitness = 0;
    this.intIndividualEliteWorstFitness = Integer.MAX_VALUE;
    //count statistics for elite individuals
    for (int i = 0; i < this.intGenerationEliteCount; i++)
    intTemp = generation.arrIndividuals[i].getFitness();
    //better fitness than best fitness so far
    if (intTemp > this.intIndividualEliteBestFitness)
    this.intIndividualEliteBestFitness = intTemp;
    //worse fitness than worst fitness so far
    else if (intTemp < this.intIndividualEliteWorstFitness)
    this.intIndividualEliteWorstFitness = intTemp;
    this.intIndividualElitesSumFitness += intTemp;
    //reset generation's statistics
    this.intIndividualBestFitness = this.intIndividualEliteBestFitness;
    this.intIndividualsSumFitness = this.intIndividualElitesSumFitness;
    this.intIndividualWorstFitness = this.intIndividualEliteWorstFitness;
    //count generation's statistics also from rest of individuals
    for (int i = this.intGenerationEliteCount; i < this.intGenerationSize; i++)
    updateGenerationStatistics(generation.arrIndividuals[i].getFitness());
    return generation;
    * Get next generation in evolution
    * Core method for all evolution; Through this method, new generation is obtained.
    * Every next generation should contain better individuals than the previous one
    * (till certain point) so with growing number of iterations in evolution, we
    * get better results (till certain point).
    * Everytime all elite individuals are copied to next generation, then hold needed number of
    * tournaments to choose a pair of good-looking individuals, cross-breed individuals in these
    * pairs, mutate them (and repair if necessary) and finally add to next generation.
    * @return Generation Next generation in evolution
    * @see Generation#tournament()
    * @see Generation#crossbreed()
    * @see Generation#mutate()
    private Generation getNextGeneration()
    Generation nextGeneration = new Generation(this);
    //number of pairs of individuals to select for next generation
    int intIndividualPairsToSelect = (this.intGenerationSize - this.intGenerationEliteCount) / 2;
    int intTemp;
    //reset generation's statistics
    this.intIndividualBestFitness = this.intIndividualEliteBestFitness;
    this.intIndividualsSumFitness = this.intIndividualElitesSumFitness;
    this.intIndividualWorstFitness = this.intIndividualEliteWorstFitness;
    //just copy all elite individuals from this generation to another
    //(they are on first positions of array of individuals)
    for (int i = 0; i < this.intGenerationEliteCount; i++)
    nextGeneration.arrIndividuals[i] = this.thisGeneration.arrIndividuals[i];
    //hold as many tournaments as necessary to select remaining number of pairs
    //of good-looking individuals for next generation (apart from the elite ones)
    for (int i = 0; i < intIndividualPairsToSelect; i++)
    this.thisGeneration.tournament();
    this.thisGeneration.crossbreed();
    this.thisGeneration.mutate();
    //add this individual in next generation
    nextGeneration.arrIndividuals[2 * i] = this.thisGeneration.nextGenerationIndividual01;
    //update statistics of generation
    updateGenerationStatistics(this.thisGeneration.nextGenerationIndividual01.getFitness());
    //add this individual in next generation
    nextGeneration.arrIndividuals[2 * i + 1] = this.thisGeneration.nextGenerationIndividual02;
    //update statistics of generation
    updateGenerationStatistics(this.thisGeneration.nextGenerationIndividual02.getFitness());
    //next generation is complete => return it
    return nextGeneration;
    * Update statistics of current generations
    * @param intFitness Fitness that may possibly update generation's statistics
    * (best fitness, worst fitness, sum of fitnesses)
    private void updateGenerationStatistics(int intFitness)
    //better fitness than best fitness so far
    if (intFitness > this.intIndividualBestFitness)
    this.intIndividualBestFitness = intFitness;
    //worse fitness than worst fitness so far
    else if (intFitness < this.intIndividualWorstFitness)
    this.intIndividualWorstFitness = intFitness;
    //update sum of fitnesses as well (for average fitness)
    this.intIndividualsSumFitness += intFitness;
    * Execute evolution process
    * Vivify first generation and then as many next generations as set in settings of evolution
    public void evolution()
    this.thisGeneration = vivifyFirstGeneration();
    //output generation's statistics
    System.out.printf("Generace 0:\t%d\t%d\t%d", this.getIndividualBestFitness(), this.getIndividualAverageFitness(), this.getIndividualWorstFitness());
    for (int i = 0; i < this.intGenerationCount; i++)
    this.nextGeneration = getNextGeneration();
    this.thisGeneration = this.nextGeneration;
    //output generation's statistics
    System.out.printf("Generace %d:\t%d\t%d\t%d", i, this.getIndividualBestFitness(), this.getIndividualAverageFitness(), this.getIndividualWorstFitness());
    * Get best fitness of all individuals in this generation
    public int getIndividualBestFitness()
    return intIndividualBestFitness;
    * Get average fitness of all individuals in this generation
    public float getIndividualAverageFitness()
    return (this.intIndividualsSumFitness / (float) this.intGenerationSize);
    * Get worst fitness of all individuals in this generation
    public int getIndividualWorstFitness()
    return intIndividualWorstFitness;
    * Get probability of mutation
    * @return Probability of mutation of each chromosome of every individual in generation (in percents)
    public int getMutationProbability()
    return intMutationProbability;

  • Some lib include Export Class,i use dependency tool to view this lib,how to know function's define

    sample:?Polaris_Measure@CCBjxguance@@QAA_NPBG0@Z 
    i know CCBjxguance is export class,Polaris_Measure is class's function,@@QAA_NPBG0@Z  is params and return value,but @@QAA_NPBG0@Z mean ? which data type ?

    So I take it that you have a .dll file but you do not have headers for it? Then finding out the params and return type won't help you much anyway.
    That's a member function, to be able to use it you need an instance of that class. And to obtain an instance of that class you need to know the full definition of that class, including its member variables. Member variables aren't exported so you have no
    way of knowing those, short of reverse engineering the .dll code.
    Anyway, the full declaration of that function is:
    public: bool __cdecl CCBjxguance::Polaris_Measure(unsigned short const *,unsigned short const *)
    This can be obtained by using the undname utility from a VS command prompt:
    undname "?Polaris_Measure@CCBjxguance@@QAA_NPBG0@Z"

  • Preventing Child Class Dependency when using conditional disable to specify Class in Development Environment

    Hello
    I am developing an application which I would like to execute on both normal and real-time systems using LabVIEW Proffesional Development System 2012 SP1
    To control how the application interacts with the user, I have created a class which defines the type of user-interface behaviour which should allow me to have nice dialog boxes when the system is executing on a windows machine and have no dialog boxes (or other non-Real-Time friendly code) when operating on a real-time target.
    The parent class is the code that is suitable for Real-Time and the child class is the one with dialog boxes.
    To control which class is loaded, I have a conditional disable structure. This will work fine when the application is built into a executable or real-time executable but the problem arises when I want to use the code during development on the real-time target.
    I find that with the application under a real-time target (RT PXI), the correct conditional-disable case is activated so the parent class is used, but the child classes are also listed under the dependancies - I pressume this is because they exist on the block diagram in the disabled case of the conditional disable diagram.
    This means that I cannot deploy the code to the Real-Time target as it is unhappy with the child class code - even though this will never be run.
    To save posting my real project, I have created an example with a Parent and Child class and a Conditional Disable Flag called "CLASS" to demonstrate the problem.
    If you run Test.vi you will see that the Child class still gets locked (i.e. is a dependancy) during execution even though it is not called.
    So - basically my question is: Is there anything I can do about this or will I just have to do-away with the conditional disable and just put the correct Class constant on the block diagram during testing?
    Thanks in advance
    John.
    Solved!
    Go to Solution.
    Attachments:
    Example Proj.zip ‏18 KB

    I feel your pain.  I ran into a similar problem a short time back.
    Apparently Official NI stance is that you need to put a conditional Disable structure IN EVERY ONE OF YOUR CLASS VIs.  In the Windows VIs, you simply have an empty conditional disable case with the windows code in an appropriate other case and vise versa on the RT.
    I too would much prefer the method you describe...
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Java Package/Class Dependency

    Hi, friends,
    I would like to get a list of packages that a given package depends on. If it is possible, I would also know which class of the given package depends on which classes.
    Is there any software to do this?
    If I would like to write a Java utility for that purpose, how can I proceed?
    Best regards,
    Youbin

    in the HTML fles of the java doc, you can know the class hierarchy and antecedents of each class. For example, class JComponent :
    java.lang.Object
    |
    --java.awt.Component
    |
    --java.awt.Container
    |
    --javax.swing.JComponent
    Moreover, the java doc also show the inner classes, fields and methods inherited from those super classes...
    you may also know which classes extends this one. For example JComponent :
    All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable
    Direct Known Subclasses:
    AbstractButton, BasicInternalFrameTitlePane, Box, Box.Filler, JColorChooser,
    JComboBox, JFileChooser, JInternalFrame, JInternalFrame.JDesktopIcon, JLabel,
    JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPopupMenu, JProgressBar,
    JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSpinner, JSplitPane,
    JTabbedPane, JTable, JTableHeader, JTextComponent, JToolBar, JToolTip, JTree,
    JViewport
    vincent

  • Servlet Class dependency is not found at weblogic startup.

    I have the following ear file which includes:
    web-inf\lib (contains all the needed utilities jar)
    *ejb.jar
    *webapp.war (The WEB-INF\lib dir inside war file contains all the needed utilities
    jars.
    I get the following BEA-101250 error saying that a servlet could not be loaded
    because a class that it depends on is not in the classpath. But I think I place
    all the needed jars in the startWebLogic.cmd file as well as in the WEB-INF\lib
    of the ear and war files. However, if a classs that a servlet depends on is not
    found, why doesn't weblogic simply tells us what that class is (instead of guessing
    to death)? How can I find which class that the servlet depends on is not found?
    Thanks.
    BEA-101250
    Error: [context]: Servlet class className for servlet svltName could not be loaded
    because a class on which it depends was not found in the classpath classPath.\nt.
    Description
    [context]: Servlet class className for servlet svltName could not be loaded because
    a class on which it depends was not found in the classpath classPath.\nt.
    Cause
    One of the classes the servlet class uses was not recognized by the Web application
    classloader.
    Action
    Make sure the class is available either in WEB-INF/classes or WEB-INF/lib or
    system classpath.

    Hmm, do you perhaps have the prefer web-inf-classes set in weblogic.xml?
    -- Rob
    rock wrote:
    I place all the utilties class in the top level APP-INF/lib. Same error. I installed
    this application on JBoss and everything runs fine. I really don't know what
    classes or jar that weblogic says that a servlet depends on.
    There are only a finite number of places where you can put all the needed jars
    in which that servlet depends:
    1. myapp.ear/APP-INF/lib
    2. myapp.ear/WEB-INF/lib
    3. or put it to a directory in the ear and refer to each jars in the CLASS-PATH
    line of the MANIFEST.MF file.
    4. myweb.war/WEB-INF/lib
    5. EJBs are in myapp.ear top directory
    6. Refer to all the jars in startWebLogic.cmd script as it starts.
    I still don't know what jars I am missing.
    Thanks.
    Rob Woollen <[email protected]> wrote:
    rock wrote:
    Rob,
    I remove all the classpath, but when I deploy the ejb complains thatit missed
    all the needed utilities class. Ok, stop there. If the utilities classes need to be seen by both the
    EJBs and webapp, then placing them in WEB-INF/lib is not enough. That
    makes them available only to the webapp.
    If you're using 8.1, then the solution is pretty simple. Move your
    utility classes into a top-level directory named APP-INF/lib
    ie
    ear/APP-INF/lib/utils.jar
    ear/fooejb.jar
    ear/fooweb.war
    If you're using < 8.1, then you can still move the jars to APP-INF/lib,
    but you'll need to add manifest class-path entries to the EJB and webapp.
    -- Rob
    I again place it on - the ear deploys fine (ejbs
    and war). But the starting servlet could not loaded because it cannotfinds a
    class that it depends on. I think I reference all the classes or jarsthat it
    needs - so I need it to tell me which one. I don't know why weblogicmakes it
    so difficult. It took me a month already and all I need to do is findthe class
    that it complains about.
    Rob Woollen <[email protected]> wrote:
    Yes, it would be nicer if that exception had more information.
    You told the web container the servlet-class in your web.xml. THe
    web
    container tried to load it and got a NoClassDefFoundError.
    Unfortuantely that exception doesn't include much information.
    NoClassDefFoundErrors are caused by something in a parent loader
    depending on something in a child classloader.
    Step #1 is for you to remove everything you've added to the $CLASSPATH.
    If that doesn't solve your problem, post again.
    -- Rob
    rock wrote:
    I have the following ear file which includes:
    web-inf\lib (contains all the needed utilities jar)
    *ejb.jar
    *webapp.war (The WEB-INF\lib dir inside war file contains all the
    needed
    utilities
    jars.
    I get the following BEA-101250 error saying that a servlet could notbe loaded
    because a class that it depends on is not in the classpath. But Ithink I place
    all the needed jars in the startWebLogic.cmd file as well as in theWEB-INF\lib
    of the ear and war files. However, if a classs that a servlet dependson is not
    found, why doesn't weblogic simply tells us what that class is (insteadof guessing
    to death)? How can I find which class that the servlet depends onis not found?
    Thanks.
    BEA-101250
    Error: [context]: Servlet class className for servlet svltName couldnot be loaded
    because a class on which it depends was not found in the classpathclassPath.\nt.
    Description
    [context]: Servlet class className for servlet svltName could notbe loaded because
    a class on which it depends was not found in the classpath classPath.\nt.
    Cause
    One of the classes the servlet class uses was not recognized by theWeb application
    classloader.
    Action
    Make sure the class is available either in WEB-INF/classes or WEB-INF/libor
    system classpath.

  • Adding asset class dependent master data

    Hi Guru's
    For making end users life easier I would like to add the insurance type and series (=/= Index series for replacement values on depr area data) on the asset class.
    In the screen layout of the asset I already set the maintenance level on asset class, but I can not find the correct transaction to customize add the insurance type and series to the right asset class.
    The transaction "ANK1 - Specify Chart-of-Dep.-Dependent Screen Layout/Acct Assignment" would work if I would have multiple chart of depr assigned to an asset class, but I have only one COD, so this is not working.
    Can anybodt help me?
    Thanks

    I looked, but thought that Tr. AO41 - Modify asset classes = Tr OAOA - Change asset classes which is not the case .... :s
    Thanks!

  • Design and class dependency

    Hi
    I have a hard time putting a program together when it consists of many classes. I put a big effort in making a good class-design but I don&rsquo;t think I really get it. I have read a lot of design patterns, but in the end I always get confused about how the &lsquo;view&rsquo; and the &lsquo;model&rsquo; have to communicate with each other.
    Here is a image which describe my problem
    image
    The only way I can get this working is by having a big &lsquo;control&rsquo; class where I get and set everything.
    Ex. If I want to put a grid in PanelB:
    Tile t = loaddata.getCalcOnData().getGrid().getTile();
    guiFrame.getPanelB().setTile(t);
    I don&rsquo;t think this is right, but how can I else make the MVC pattern work?

    The image is blocked from me at work, so I could not refer to that. Based on the descriptions you provide, I am guessing this is a Swing app. However, the points below apply generally to a web application.
    Your model is simply whatever you want. You should not have any controller or view aspects to your model, ideally. The model is what makes your system unique. You can write procedurally with immutable data transfer objects, use Java beans or some combination. Try to follow your best OO practices here when it is possible.
    Your controller and view completely depend on one another. Basically, the controller is responsible for invoking model functionality (or services), taking the results and dispatching (or providing) them to a view. The view takes those objects and renders a display. The view also sends user events (mouse clicks, keyboard input, web form posts, etc.) to the controller, and the whole beautiful process repeats itself.
    So, at the end of the day, the model is basically easy to understand. The view is also easy to understand. What trips most people up is the controller.
    For Swing, you basically add listeners to your various view components. So, you have a listener for a button click, a listener if a list box values changes, etc. As many as you want or need. These listeners do not have to do anything fancy. They simply have to validate (and maybe transform) the event they receive and send the data portion (method arguments, etc.) to a model object.
    On the "return" trip, most model methods will return some data to the view . The controller is responsible for forwarding this response on to the original view or to another view (e.g., button click refreshes a page versus button click navigates you to the next screen in a wizard).
    You have a lot of freedom in your controller's design. It really does not have to look pretty. It simply has to "glue" the view components to the model. But understand, the model exists, ideally, on its own. You should be able to have the same model be re-used in other scenarios (e.g., a swing view, a web app view, etc.) The controller and the view are intimately related. It is possible to write "abstract" or "generic" controllers, but IMO, this is definitely not worth the effort until you have multiple views to service. If you are interested in decoupling to this extent, take a look at the Command pattern.
    One final thought, take a look at Spring MVC. Their controller's method signature probably makes the MVC concept as clear as possible:
    http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html
    public interface Controller {
         * Process the request and return a ModelAndView object which the DispatcherServlet
         * will render.
        ModelAndView handleRequest(
            HttpServletRequest request,
            HttpServletResponse response) throws Exception;
    }http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/portlet/ModelAndView.html
    Hope that helps.
    - Saish

  • How to save a reference to a class depending on a conditional statement...

    Hi!
    I'm rather new to Java, but I'm already in the process of creating a rather big application (big, from my point of view) :).
    I have a main class, in which I find out what OS the application is running on (utilizing System.getProperty("os.name")). If the string corresponds to Windows (I'm using regular expressions to match this), I create an instance of another class called WindowsPlatform.java. And vice versa for Unix.
    My problem is that I'm not really sure how to save a reference to the Unix or Windows platform class, as the program conditionally decides, depending on the platform, which class to invoke.
    The error Java's giving me is:
    MainClass.java:9 cannot find symbol
    symbol  : method sayHi()
    location: class Platform
            platform.sayHi();
                    ^
    1 errorWhat I want is to have the sayHi() method invoked from whatever class (UnixPlatform or WindowsPlatform) that was earlier in the program used as argument for the setPlatform() method in Initializer.java.
    This is the the code involved (class names have been changed to easier reflect their purpose):
    ### MainClass.java ###
    public class MainClass
        public static void main(String[] args) {
            SettingsClass settings = new SettingsClass();
         Initializer init = new Initializer(settings);
         Platform platform = settings.getPlatform();
         platform.sayHi();
    ### SettingsClass.java ###
    public class SettingsClass
        private Platform platform;
        public void setPlatform(Platform _platform) {
            platform = _platform;
        public Platform getPlatform() {
            return platform;
    ### Initializer.java ###
    public class Initializer
        private SettingsClass settings;
        private RegExpr re;
        private String os;
        public Initializer(SettingsClass _settings) {
            settings = _settings;
            re = new RegExpr();
         os = System.getProperty("os.name");
         if (re.find(".*win.*", os, true)) {
                settings.setPlatform(new WindowsPlatform());
         } else {
                settings.setPlatform(new UnixPlatform());
    ### Platform.java ###
    public class Platform
        /* Some generic functions applicable to
         * all platforms
    ### RegExpr.java ###
    import java.util.regex.*;
    public class RegExpr
        private String regExpr;
        private String str;
        private boolean iCase;
        public boolean find(String _regExpr, String _str, boolean _iCase) {
            this.regExpr = _regExpr;
            this.str = _str;
         this.iCase = _iCase;
            Pattern pat;
         Matcher matcher;
         if (iCase) {
                pat = Pattern.compile(regExpr, Pattern.CASE_INSENSITIVE);
         } else {
                pat = Pattern.compile(regExpr);
         matcher = pat.matcher(str);
         if (matcher.find()) {
             return true;
         } else {
                return false;
    ### UnixPlatform.java ###
    public class UnixPlatform extends Platform
        public void sayHi() {
         System.out.println("Hi, I'm Unix!");
    ### WindowsPlatform.java ###
    public class WindowsPlatform extends Platform
        public void sayHi() {
         System.out.println("Hi, I'm Windows!");
    }I would greatly appreciate any help I could get on this issue!
    Thanks for your time!
    Regards, ridgero

    Dear Ridgero, your method must exist in your Platform class. Now you can only call this method from UnixPlatform or WindowsPlatform. The two easiest ways to resolv this would be something like:
    abstract class Platform
        /* Some generic functions applicable to
         * all platforms
        abstract void sayHi();
    }or this:
    public class Platform
        /* Some generic functions applicable to
         * all platforms
        abstract void sayHi() {}
    }Good luck.

  • Tools for generating Entity Classes

    Hi ,
    I am new to EJB 3.0 Entity Beans .
    I am finding it hard to develop a Entity Class .
    Please let me know if there are there any Tools that will generate an ENtity class depending upon the database table ??

    Hi!
    Most IDEs like Netbeans and Eclipse can generate entities based on existing database schemas, but imho it's much more usefull to write the first few entities by yourself. It's a bit more difficult, but at least this way you will learn what each annotation does, where they can be placed and what attributes you can set on them.
    Once you have a good general foundation you can skip this process by autogenerating these classes. But that's just my opinion.
    Some examples:
    Eclipse
    Netbeans
    Btw. there are no entity beans in EJB 3.0. These are plain old java classes, thus they are called simply entities to avoid confusion with the entity beans used in previous ejb versions.

  • Classes on which ur servlet depends is not found in classpath

              i am trying to deploy a servlet in exploded form in weblogic 7.0.Its is deployed correctly but when i call the servlet from a html file i.e. index.html it throws an error http:<Error> <HTTP> <101250>
              stating that the classes on which my servlet class depends is not found in classpath.I have set classpath manually and also created a domain name "ApplicationDomain" and i have put my application "WebApp" in application's directory in the domain
              it throw the folowiing error with exceptions
              <May 28, 2003 12:09:54 PM IST> <Error> <HTTP> <101250> <[ServletContext(id=1642082,name=WebApp,context-path=)]: Servlet
              class myclasses.Gservlet for servlet Gservlet could not be loaded because a class on which it depends was not found in t
              he classpath D:\bea\user_projects\Applicationdomain\applications\WebApp;D:\bea\user_projects\Applicationdomain\applicati
              ons\WebApp\WEB-INF\classes.
              java.lang.NoClassDefFoundError: myclasses/Gservlet (wrong name: Gservlet)>
              <May 28, 2003 12:09:54 PM IST> <Error> <HTTP> <101018> <[ServletContext(id=1642082,name=WebApp,context-path=)] Servlet f
              ailed with ServletException
              javax.servlet.ServletException: [ServletContext(id=1642082,name=WebApp,context-path=)]: Servlet class myclasses.Gservlet
              for servlet Gservlet could not be loaded because a class on
              

    Configuration file bc4j.xcfg not found in the classpath.

  • Wrong classes output directory when use of dependant projects

    Hi,
    JDev 10.1.2.1 but also in previous versions.
    Windows XP Prof, AMD Athlon, 1 Go Mem
    I have following setup:
    Projects:
    DTO (data transfer objects and utility classes used in other projects)
    -> dependies: none
    Directory tree:
    MyWorkspace\DTO\classes
    MyWorkspace\DTO\src
    Model (model classes)
    -> dependies: DTO
    Directory tree:
    MyWorkspace\Model\classes
    MyWorkspace\Model\src
    View (JClient app)
    -> dependies: DTO, Model
    Directory tree:
    MyWorkspace\View\classes
    MyWorkspace\View\src
    WebView (Struts app)
    -> dependies: DTO, Model
    Directory tree:
    MyWorkspace\WebView\deploy
    MyWorkspace\WebView\model
    MyWorkspace\WebView\public_html
    For some unexplained reasons sometimes (difficult to reproduce)
    JDev get confused and DTO classes, sometimes Model classes are copied to the View project classes directory.
    Example utility class of the DTO project:
    source:
    MyWorkspace\DTO\src\com\photoswing\dto\util\TextUtils.java
    instead of being generated in:
    MyWorkspace\DTO\classes\com\photoswing\dto\util\TextUtils.class
    is found in the View claases output directory (directory tree created by JDev):
    MyWorkspace\View\classes\com\photoswing\dto\util\TextUtils.class
    I noticed that regularly the JDev navigator has synchronization problems and can't find the class when activating the right-click Select in Navigator action in an open source file.
    This generally happens when switching from source files of different projects.
    Now if you compile a source file and the navigator has a synchronization problem following warning is displayed:
    Warning: The file is not part of the active project DTO.jpr, compiled class will be written to DTO.jpr output directory
    When only one file gets compiled this can be repaired easely by deleting the class written in the wrong directory.
    But when several files are changed and are compiled the warning is only displayed for the current source file and all classes output trees must be scanned manually.
    When testing the app if I'm not wrong JDev reads from the classes directories and doesn't produce a jar file, so deleting manually the wrong classes is a valid workaround.
    But what if the app gets deployed and jars are generated?
    I can't imagine myself changing manually the produced jars by removing the wrong classes and what about the manifest?
    Your help is requested.
    Regards
    Fred
    PS Can't provide a TestCase => happens in complex environment only.

    Glad to know I'm not the only one having that serious problem.
    JDev by default create at least 2 different projects (model and view) so it seems to be a standard.
    Working simultaneously on source files of different projects seems to the cause the trouble.
    Is there somekind of patch available?
    Could somebody of Oracle answer the question of the first message of this thread?
    Thanks
    Fred

  • Running a Java class which depends on a Jar

    Hi,
    I try to run a class using the command java packagename.classname.
    This class depends on a jar for functioning.
    So, when I run this class, exception related to the absence of this Jar is shown.
    How can I overcome this? Where should I place this jar or running any other commands for loading this jar will do?
    Please help.
    Any help in this regard will be well appreciated with dukes.
    Regards,
    Rony

    Hi Rony,
    Place the that jar file in your class path.
    or
    Place that "jar file path" in Enivronment Variables of your computer under "Class path" variable
    or
    set the class path using command prompt.
    Thanks,
    Sekhar

  • How can I find out all dependings of a class ?

    Is there anywhere out there a tool, to find out
    from which classes is an other class depending ?
    I need this to find out a bug which came apparently from a static constructor which will be accomplish by loadind the class. It is for me important not only to know the directly imported classes but also the classes which are imported by the imported classes... and so on.
    Thanks in advance!
    Strucki

    You're misunderstanding what importing a class means. You can import a class without using it, and you can use a class without importing it. Importing a class has absolutely nothing to do with using a class and does not in any way indicate a class dependancy.
    In order to find the class dependancies, you should ignore the import statements. There are some tools that will do dependancy analysis, such as the free jikes compiler, but dependancy analysis in Java is very complicated and as far as I know there is no program that gets it exactly correct.

Maybe you are looking for

  • How to set up SSO between e-portal employee node & ebill customer node?

    We have a requirement to set up SSO between e-portal employee node & ebill customer node. I am told that sso is possible only between 2 employee nodes. Please advise.

  • Text tool not working in photoshop CC, all I can see are small boxes event with giant font

    Hi there, I am not sure what is going on here.  I cannot get the Text to show up using the Text tool.  All I can see are tiny boxes even made the font 60 points.  SHould be huge.  Been happening for more than a week and I ran an update via the cloud

  • Insert Leading Zeroes

    How Do Everyone! I have a currency amount say 144.66 and I want to insert leading zeroes. I want to convert it to say 000000144.66 I have used the FM CONVERSION_EXIT_ALPHA_INPUT but because there is a decimal point in the number it is not quite worki

  • Bookmarks come and go

    My bookmarks in Safari disappear and are gone for several hours and then they are back. This happens sometimes every day,sometimes just about once a week. It all started when I updated to the new IOS version. How can I end this irritating coming and

  • Logging half-open conections to blocked Windows ports

    Background: Usually when we have a problem with a VPN user attempting to connect to an inside service, we turn to our ASA syslogs to determine where the connection is being prohibited (or other errors such as the user trying to connect to the wrong m