Same class in diferent projects

hi!!
in one project (homecontrolserver), i have one class ("Arrays"), i serialize it, and send over sockets to other project (homecontrolclient), here i have an error, because in this project (client) doesn't exist this class (homecontrolserver.Arrays), exist this one: homecontrolclient.Arrays.
what can i do? i need that both projects have diferents names.. :(
thanks in advance, friends
(i obtain a "NotFoundClass Exception", of course)

if the package name is different, it just won't work. If you are using JBuilder, you can perfectly manage two source paths and packages inside the same project. You don't need separate projects. In that case, maybe you can move this Arrays class to a common package called 'common' or 'shared'. I think you get my point.

Similar Messages

  • How to Differntiate between two instances of the same class ????

    I don't even know if my question makes sense or not ??
    I don't have any code written for it yet.. but its the most critical task for me..
    Q ??
    say i have multiple objects running of the same class on the same box.
    sth like a CPU can have multiple ports. The port class is intantiated
    to create every new port for CPU as required.
    Now i have to differntiate multiple ports on that box and give
    accordingly its statistics back to CPU. sth like how many acces to
    ports, how much bandwidth available, how many bits.. i know how to
    calculate statistics of ports but i don't know how to differentiate
    between multiple ports ??
    Eg: Number of sessions created on oneport is 14 and other is 25. Then i
    have to give differnt statistics of these 2 ports back to CPU.
    I hope all this made some sense ???
    Thank youuuuu....reply back if u need some more details....
    Edited by: javanewbie83 on Jun 16, 2008 4:28 PM

    javanewbie83 wrote:
    I don't even know if my question makes sense or not ??
    I don't have any code written for it yet.. but its the most critical task for me..
    Q ??
    say i have multiple objects running of the same class on the same box.
    For an example: (its just a correlation to my project.. its actually not CPU and port numbers.. sorry if u misunderstand...)
    sth like a CPU can have multiple ports. The port class is intantiated
    to create every new port for CPU as required.
    Now i have to differntiate multiple ports on that box and give
    accordingly its statistics back to CPU. sth like how many acces to
    ports, how much bandwidth available, how many bits.. i know how to
    calculate statistics of ports but i don't know how to differentiate
    between multiple ports ??
    Eg: Number of sessions created on oneport is 14 and other is 25. Then i
    have to give differnt statistics of these 2 ports back to CPU.
    I hope all this made some sense ???
    Thank youuuuu....reply back if u need some more details....Simply repeating your unclear original post does not magically make it clear.

  • How to share common classes across multiple projects in Jdeveloper?

    Hi Experts,
    I have a basic question.
    I am using Jdeveloper 11g and have divided my application into 2 projects (Model(ejb's) and Viewcontroller(jsf+managed beans etc)).
    The model project has a stateless session bean(named VisitingScholarBean) which uses a java bean class(named VisitingScholarDetails) defined in the ViewController project.
    The relevant Method in the stateless session bean is public void saveVSDetails(VisitingScholarDetails vsDetails).
    Now the issue is that the VisitingScholarDetails class is part of only the ViewController project but is being used in the Model project.
    So when I try to run the application it gives an error saying that
    weblogic.application.ModuleException: Exception preparing module: EJBModule(VisitingScholar-Model-ejb)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    edu/nyu/ecoms/oaa/vs/web/backing/VisitingScholarDetails.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: edu.nyu.ecoms.oaa.vs.web.backing.VisitingScholarDetails
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)I cannot replicate the same VisitingScholarDetails class in both projects as it will lead to duplication.
    Please let me know how to include the VisitingScholarDetails class in the ejb-jar without replicating it in the Model and View Controller projects.
    Thanks for your time and help.
    Edited by: user10376431 on Jan 24, 2010 6:25 AM

    Welcome User in OTN,
    to make two projects can access its classes you should goto the project property ---> Dependencies then add the other project.
    in your case:
    try to goto you Model project property ----> Dependencies ---> Edit Dependencies .
    you will find your ViewController project. Expand it thin check to Build Output.
    you can make this for ViewContoller project also as:
    goto you ViewContoller project property ----> Dependencies ---> Edit Dependencies .
    you will find your Model project. Expand it thin check to Build Output.
    Sameh Nassar

  • Using LabView class in multiple projects

    Hello,
    I have created a LabView class that I'd like to use in multiple projects while using source control (we use Serena for this) with the source files of the class in a centralized location (not seperately for each project as I don't want the code of the class to diverge in the different projects). Now I'm wondering what is the best way to accomplish this. I see a couple of different possibilities:
    - Have the class VIs at a certain location in the repository and link to all the files from the other projects in the repository. This will mean I will have all the files in all the project folders on disk but only one archive in the repository for them as they all link to the same location. Problem: Serena cannot create links to folders, so every VI has to be linked and if the structure of the class changes or VIs, the links have to be updated in each project -> not very nice
    - Have the class VIs at a certain location in the repository that will be checked out to a certain path on the local hard drive and add the class VIs to the projects from this fixed path. Problem: it's not guaranteed that the path will be the same on all computers. Some team members might check out to a different location -> bad solution
    - Use a .llb file that is also in the repository and create links to it from the different projects, i.e. the source files will only exist at one location on the hard drive but in every project folder there will be an .llb-file that will come from a single archive in the repository -> actually my favourite solution. Problem: I use the VI Server to call VIs by relative path inside the class and this works differently inside the .llb, since there seems to be no folder structure anymore. If there was a good workaround for this, this might be the best solution
    Does anybody have experiences on how to do something like this? Are there other possibilities to do it?
    Thanks,
    Tobias

    Hi,
    thanks for your reply.
    I think I have to make my question a little clearer. Say I have a class ClassA that uses some VIs that are in the same folder (or subfolders) as the class file. Now I put all of this in an SCC repository at the path /SCC/ClassA/. Now I have two projects that use this class and are located in the SCC repository at /SCC/Project1/ and /SCC/Project2/. Now some people might check out /SCC/ to c:/Projects, other people might check it out to d:/SCC so the absolute paths of the resulting files on the disks could be different. This makes it hard to add ClassA to both projects because on one computer the path to it would be c:/Projects/ClassA/<ClassName> on the other it would be d:/SCC/ClassA/<ClassName>. A common solution for this that we use for C++ projects is to create links inside the SCC, link the source files or a DLL inside the SCC to the /SCC/Project1/ and /SCC/Project2/ folders. This will create multiple copies of the DLL on the harddisk, one in the Project1 folder and one in the Project2 folder.
    Another solution might be the one you proposed, to have the sharde files inside the <LabVIEW> folder. However there are a couple of downsides to this, as far as I can see:
    - It won't work for people who don't have local admin rights (and actually having to change the files inside the "Program files" folder for development is not a good idea, imho)
    - It makes it quite hard to guarantee that both the projects and the shared files are always the same version (for example if I want to build an older version of Project1 I might need an older version of the ClassA, too. If I have it all inside one project in SCC, I can just get an older label to some folder and build it. If I have the shared files in the <LabVIEW> directory, I will have to replace this. There is no way to have multiple versions (older and newer) parallely on the disk in different folders. 
    Tobias

  • Same source always makes same .class file ?

    Compiling same source code will result always in same .class file ? (off course using the same compiler).
    I've seen a site that says the compiler puts a timestamp in the class file. So compiling again at a different time will not result in same .class file.

    _cristi_ wrote:
    I have tested, so far class files seem to be identical.
    But in a large project there might be cases when they differ, that's why I've asked, I can't be 100% sure based on a few tests.
    Certainly won't be based on timestamp then.
    I need this to extract only the class files that have been changed in order to deploy them.
    There is a jar compare tool out there that first decompiles the classes and then compares the resulted text. They say this is necesarry because of timestamp in class files. Link: http://www.extradata.com/products/jarc/
    I suggest you ask them to document the claim about the timestamp. They are selling a product and thus the bias can be questioned.
    And that sample diff they provide is absolutely pointless because 1.5 versus 1.4 is guaranteed to be different because of the class version difference.

  • Can EJB and BC exist at the same time in one project?

    having to use ADF's BC and EJB to access data in both way due to the special requirements, but I am always getting the deployment failure.
    can Ejbs and BC components exist at the same time in one project?

    thanks for your reply.
    I considered to separate the BC and EJB as the separate project. I just use the EJB component to implement the dynamic tree menu, whether a little make a mountain out of a molehill if you as a separate project.

  • Can you avoid multiple clips of the same media in a project

    We have 2 suites and we sometimes work together on a common project utilising the same media.
    If I want to use a sequence from the other suite I can easily import it.
    The problem:  it creates another folder with clips that only belong to the imported sequence.
    The end result after a few imported sequences is that my final timeline has instances in it that
    are from clips belonging to several different folders or bins even though the media is the same.
    In summary... is there a way you can avoid having multiple clips of the same media in a project.
    Makes for a very messy project when you have finished.
    You've got multiple clips with the same name scattered everywhere.
    Cheers

    Not yet.
    I'm kind of hoping this type of media management will be vastly improved in CS6, whose main new 'feature' reeeeeally needs to be outstanding network collaboration with other editors working on the same project.

  • Multiple windows of the same class with a different argument

    Suppose I have a main window with a list of users. If I click on any one user, the "chat window" should open with the argument as that "user".
    If i click on another, a similar "chat window" should open but with a different user.
    I can't have so many stages because I don't know how many users are there.
    How do I open multiple windows of the same class but with a different argument?

    Here is a sample (opens, at random locations, a bunch of child windows parameterized by color).
    Could be simpler, but hopefully you get the gist.
    import java.util.Random;
    import javafx.application.Application;
    import javafx.geometry.Rectangle2D;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.layout.StackPane;
    import javafx.stage.*;
    public class ColoredStages extends Application {
      final String[] colors = { "firebrick", "palegreen", "azure", "chocolate", "goldenrod" };
      final Random random = new Random(42);
      Rectangle2D screenBounds;
      public static void main(String[] args) { launch(args); }
      @Override public void start(Stage stage) {
        screenBounds = Screen.getPrimary().getVisualBounds();
        stage.setTitle("Primary");
        stage.setScene(new ColoredScene("cornsilk"));
        stage.show();
        for (String color : colors) {
          Stage coloredStage = new ColoredStage(stage, color);
          coloredStage.show();
      class ColoredStage extends Stage {
        ColoredStage(Stage owner, String color) {
          super();
          initOwner(owner);
          initStyle(StageStyle.UTILITY);
          setX(screenBounds.getMinX() + random.nextInt((int) screenBounds.getWidth()));
          setY(screenBounds.getMinY() + random.nextInt((int) screenBounds.getHeight()));
          setScene(new ColoredScene(color));
      class ColoredScene extends Scene {
        ColoredScene(String color) {
          super(new StackPane());
          StackPane layout = (StackPane) getRoot();
          layout.getChildren().addAll(new Label(color));
          layout.setStyle("-fx-font-size: 20px; -fx-padding: 30px; -fx-background-color: " + color);
    }

  • How to add a class in a project?

    Hello!
    i'm a beginner in developing and i don't know how to add a class in a project in Sun Java Wireless toolkit 2.5.2...
    The name of my project is essai2 and i already put a class, LogoMIDlet and now i want to put my new class ComBasique, how can i do that?
    and do you know if there is a program for bluetooth in order to connect my Nokia 6680 to another device that have a bluetooth?
    thanks a lot for your answer!
    Sophie

    how to change the class name after the project is created.In NetBeans, right click the class name either in the declaration or constructor, select Refactor --> Rename... and follow the dialog.
    You can refactor --> rename anything that is not in a guarded block. For those, there are options via the properties window.
    db

  • Accessing a private variable from a public method of the same class

    can anyone please tell me how to access a private variable, declared in a private method from a public method of the same class?
    here is the code, i'm trying to get the variable int[][][] grids.
    public static int[][] generateS(boolean[][] constraints)
      private static int[][][] sudokuGrids()
        int[][][] grids; // array of arrays!
        grids = new int[][][]
        {

    Are you sure that you want to have everything static here? You're possibly throwing away all the object-oriented goodness that java has to offer.
    Anyway, it seems to me that you can't get to that variable because it is buried within a method -- think scoping rules. I think that if you want to get at that variable your program design may be under the weather and may benefit from a significant refactoring in an OOP-manner.
    If you need more specific help, then ask away, but give us more information please about what you are trying to accomplish here and how you want to do this. Good luck.
    Pete
    Edited by: petes1234 on Nov 16, 2007 7:51 PM

  • Two threads in the same class ? Is that possible ?

    Hello, I am trying to use threads to move two images around the frame. And I am wondering if it is possible if it is possible to create two separate threads that act differently in the same class, for each of the image.
    Is just that so far I can't see a way since, by implementing Runnable, I'll need to overwrite the run() method. Which in a way just allows me to manage one image.
    Of course I can do two separate classes (each implementing Runnable) for each of the image, but since I think it may be an overkill, I rather to do it in just one.
    So, is that possible ?
    Thank you in advance.

    Of course I can do two separate classes (each implementing Runnable) for each of the image,Use two instances of the same class. Something like this example:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=631379

  • Referencing fields between objects of same class

    Say I have created multiple TicketMachines from this class. Is there a way I create a method that uses "System.out.println" that would print the price of another TicketMachine object. And if so, could you please point me in the direction to find out how.
    * TicketMachine models a naive ticket machine that issues
    * flat-fare tickets.
    * The price of a ticket is specified via the constructor.
    * It is a naive machine in the sense that it trusts its users
    * to insert enough money before trying to print a ticket.
    * It also assumes that users enter sensible amounts.
    * @author David J. Barnes and Michael Kolling
    * @version 2006.03.30
    public class TicketMachine
        // The price of a ticket from this machine.
        private int price;
        // The amount of money entered by a customer so far.
        private int balance;
        // The total amount of money collected by this machine.
        private int total;
        //Creates a machine that issues tickets at a default price of 1000.
        public TicketMachine( )
         //Exercise 2.39  & 2.42(continues below)
          * By removing the parameter from this constructer
          * and setting the value of price to 1000, objects
          * from this class are automatically constructed with
          * a ticket price of 1000.
            price = 1000;
            balance = 0;
            total = 0;
        //Exercise 2.42
         * Create a machine that issues tickets of the given price.
         * Note that the price must be greater than zero, and there
         * are no checks to ensure this.
        public TicketMachine(int thePrice)
            price = thePrice;
            balance = 0;
            total = 0;
         * Return the price of a ticket.
        public int getPrice()
            return price;
         * Return the amount of money already inserted for the
         * next ticket.
        public int getBalance()
            return balance;
         * Receive an amount of money in cents from a customer.
        public void insertMoney(int amount)
            balance = balance + amount;
         * Print a ticket.
         * Update the total collected and
         * reduce the balance to zero.
        public void printTicket()
            // Simulate the printing of a ticket.
            System.out.println("##################");
            System.out.println("# The BlueJ Line");
            System.out.println("# Ticket");
            System.out.println("# " + price + " cents.");
            System.out.println("##################");
            System.out.println();
            // Update the total collected with the balance.
            total = total + balance;
            // Clear the balance.
            balance = 0;
        //Exercise 2.33
        //Prints "Please insert the correct amount of money." to the text terminal.
        public void prompt()
            System.out.println("Please insert the correct amount of money.");
        //Exercise 2.34
        //Displays the value of the price field in the text terminal.
        public void showPrice()
            System.out.println("The price of a ticket is " + price + " cents.");
        //Exercise 2.35
         * After creating two ticket machines with different prices
         * and calling thier showPrice methods it showed a different
         * output for each instance. This effect happenes because the
         * showPrice method prints out a string and the value of the price
         * field, which happens to be different in each instance, thereby
         * printing a different output.
        //Exercise 2.36
         * The result of System.out.println("# " + "price" + " cents.");
         * would print the string "# price cents." to the text terminal.
        //Exercise 2.37
         * The result of System.out.println("# price cents.");
         * would be the same as the result of exercise 2.36.
        //Exercise 2.40
        //This method is a mutator and takes no parameters
        //Empties the money form the ticket machine
        public void empty()
            total = 0;
        //Exercise 2.41
        //This method is a mutator
        //Changes the price of a ticket
        public void setPrice(int newPrice)
            price = newPrice;
    }

    Objects can refer to fields in other objects of the same class.
    It's not clear from your description what you're trying to accomplish, however.

  • How to use ActionListener and ItemListener in the same class

    Why can't I use both ActionListener and ItemListener in the same Class?
    I want to use a drop down list and an entry box on the same form.
    How? I'm having trouble compling......
    Thanks!
    CODE:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Disp extends Applet implements ActionListener, ItemListener
    { TextField entry=new TextField(7);
    Button Enter=new Button("Enter");
    public void init()
    add(entry);
    add(Enter);
    entry.addActionListener(this);
    entry.requestFocus();
    Enter.addActionListener(this);
    public void actionPerformed(ActionEvent thisEvent)
    String answer=entry.getText();

    Simply get your Applet to implement both ActionListener and ItemListener.
    public class MyApplet extends Applet implements ActionListener, ItemListener
      public void init()
        itemWidget.addItemListener(this):
        actionWidget.addActionListener(this);
      public void actionPerformed(ActionEvent e)
        System.out.println("ACTION PERFORMED!");
      public void itemStateChanged(ItemEvent e)
        System.out.println("ITEM STATE CHANGED!");
    }Hope this helps.

  • How to create an object within the same class???

    hi im just a newbie
    i v been always creating an object from the main class..
    but how to create an object inside the same class??
    i got main and students class
    the main got an array
    Students[] stu = new Students[]
    and i got
    stu[i] = new Students(id,name);
    i++;
    but i wanna do these things inside the Students class..
    i tried ..but i got errors.....
    how to do this
    .

    javaexpert, :)
    I really have no idea what you are trying to do since you say you've always been creating an object from the main class, yet you always want to create an object inside the same class.
    I'll assume that you have an object in the main class that you are trying to access from the Students class.
    If you are trying to access objects that are contained within the main class FROM the Students class, then know that there are two ways of doing so, one being static, and the other dynamic (look up definitions if unclear):
    1.) make the objects in the main class both static and public and access the the objects using a convention similiar to: Main.object; It's important to note that Main is the name of your main class, and object is a static object. There are better ways of doing this by using gettter/setter methods, but I'll omit that tutorial.
    2.) Create a new instance of the main class and access the objects using a similiar fashion: Main myInstance = new Main(); myInstance.myObject;
    You should really use getter and setter methods but I'll omit the code. In terms of which approach is better, step one is by far.
    I don't mean to be condecending, but you should really brush up on your programming skills before posting to this forum. This is a fundamenetal concept that you will encounter time and time again.

  • Synchronisation methods in same class

    I have three methods in same class A,B,C IN which A,B synchronised and c not.
    my question is if one thread is in A.another thread cann access B OR C?

    jverd wrote:
    Syncing a block on the object pointed to by X
    synchronized (X) { /* do stuff */}simply waits until no other thread is synced on that object, and then enters the block.
    Declaring a non-static method synchronized is the same as doing synchronized (this) { /* do stuff */ }Calling a non-synced method or executing a non-synced block or statement does not wait for the lock.Duke-wh0ring?? :)

Maybe you are looking for

  • Creating fly-out menus for website in InDesign CS5

    Hi all, I've just upgraded to CS5, and am looking into the new release of InDesign CS5.  In the past, I had created websites in MS Publisher, and then exported the publication as website as html.  I then uploaded the resulting HTML to my website usin

  • How do I get tv shows to appear on my 4th gen ipod touch, without having to place them in the movies section?

    Whenever I go into the info tab of a video file and change the video type to "TV Show", the file will appear as a TV show in itunes but when I check my ipod there is no TV show folder. As of now, I have all of my tv shows sorted as movies because it'

  • Issues with Photostream

    I had to restore my iPhone while I was at an Apple Store working with a Genious and my Photostream no only loads 41 photos from my total library.  I have tried to turn off Photostream and back on and left the application open while connected to WiFi

  • Issue with logic of in parameter of SP

    Hi, below is my SP... user who is running this SP has an option to enter value for P_Step or not. if no value is entered for P_Step then its defaulted to NULL and all steps should run. If the user specifies some value like 10 or 20 or 30 then the SP

  • Possible virus in Nano

    I have a nano 2nd generation, but when i connect it to itunes on my Windows XP, it tells me that nearly all the memory is used with 'Other'. I tried to restore it but got a message saying ipod cannot be restored as some files are being used by anothe