Using external classes inside an EBJ

Hi! Here's a simple question about EJB's:
I have an EAR file containing a WAR file (WEB-INF/lib, WEB-INF/classes, and all that stuff), and a JAR file. The JAR file contains a MDB. A simple scenary, isn't it?
Well, my MDB uses classes contained in the WEB-INF/classes of the WAR file. The reason why the classes needed by the MDB are in the war file (web-inf/classes) is that the war application also uses that classes.
This trick works in some servers and versions, but fails in other cases.
Now my JBoss 4.02 says:
ClassNotFoundException: No ClassLoaders found for: com.einforma.sfee.peticiones.PeticionFactura
Where this class is shared by the MDB and the WAR app, and is stored in WEB-INF/classes of the war file
Can anybody suggest a workarond to this problem? What should be the 'elegant' way to make this work?

Ok, it's solved, i just removed the classes from my
war, made a jar with them, and put the jar into de
ejb. Now both (war and ejb) can access the classes.you have duplicated the class in your application.
A better strategy would be to make a jar of common utilities (which are used by both WAR and EJB classes). Put this in the J2EE server's class path.
Of course, you must ensure that the EJBs and WAR classes dont use some shared resources in those utility classes.
Packaging of your J2EE application is one of the most important tasks.
regards

Similar Messages

  • Use "external" classes as plugins

    hi everyone :-)
    i have an application which offers some plugins to the user.
    now the thing is: the plugins shouldn't be included into my JAR-file, the should be in an external folderstructure outside of the JAR.
    when i use the Class.forName(...)-method, i cannot access the external classes... even if i add the package-path of them (i.e. "pluginsp.plugin1.Plugin1")
    has anyone an idea how to solve?
    thx a lot & regards
    manu

    OSGi is pretty bulky and is a spec. Eclipse is built around OSGi. Perhaps the better implementation is OSCAR, an open-source implementation of OSGi that is more a stand-alone plugin engine like my Platonos Pluginengine is.
    Depends on what you want. Small, fast, easy to work with and get up in about 5 mins? Go for mine. If you need something a little more industry standards based but is more complicated to work with and quite a bit bulkier in terms of the library size, go for OSCAR. I am not slamming OSCAR or OSGi. OSCAR is very slick, and OSGi is a great initiative. Just offering another solution that may work out better.

  • Why can't I use this class inside my MovieClip?

    Hi,
    The attached SlideshowExample.as file works quite nice when I use it on stage directly. But when I tried to use it in Gallery_mc movie clip, it doesn't work, Please help me out in resolving this problem.
    Sorry, I think there is no file attachment option here.
    Thanks.

    What you need to do is to attach this class "SlideshowExample" to your MovieClip symbol in the Library, then instantiate it and add it to the display list. (If you want to use the name "Gallery_mc" then you can rename the class to 'Gallery_mc".)
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Using external classes

    Hi!
    I've a file named XSort.class. It starts with "public class XSort extends Sorter". I've to write a file in which I should call methods of this class. How can I get access to the class? "import XSort.class" doesn't work.
    By the way: How can I test how much time a method takes?
    Thanks, Chris

    in order to access the class if its in a seperate file, you'll have to create a package for it
    type in
    package XSort;
    as the first line of code and stick it in a folder called XSort under your classpath
    then just import the class with
    import XSort.*;
    in the class that needs the methods

  • How to use external Java API in Java Embedd inside BPEL

    How to use external classes inside the BPEL in Java Embed Activity ? Any sample code availble ? Like i want to use log4j API inside BPEL.

    No you dont have to change your startManagedServer.cmd/.sh everytime you need to have a Java Embedding activity. You only need it in case of using Log4J. As log4j requires a configuration xml viz log4j.debug.xml and log4j.dtd you need to let the soa managed server know about it. The best way to load this configuration files is using the JAVA_OPTIONS command during server startup.
    Hope the explanation helps.

  • Need help with tomcat 5.5 and using java classes

    hey there,
    i am trying to set up tomcat 5.5 on my computer at home and have sucessfully done so. i have been trying to use Java classes inside my JSP files however tomcat thows an internal servlet error as follows:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    ProductList cannot be resolved to a type
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    ProductList cannot be resolved to a type
    An error occurred at line: 144 in the jsp file: /order.jsp
    Generated servlet error:
    Product cannot be resolved to a type
    i have the classes located as the setup tutorial recommends (root/WEB-INF/classes/) and still nothing works. i would appreciate any help anyone can give.
    thanks,

    Which tutorial are you following?
    As of java1.4, all classes must be in packages for them to work in Tomcat. This means your beans and servlets too.
    Put your beans in a package, and then recompile them, and put them in the right place.
    eg
    package com.mypackage
    public class MyClass ...
    once compiled would go into WEB-INF/classes/com/mypackage/MyClass.class
    Are you using Product and ProductList classes in scriptlet code?
    Have you imported them with a page directive
    <%@ page import="com.mypackage.Product, com.mypackage.ProductList" %> ?

  • Working with AS3 External Classes

    Ok... trying to work with AS3 external classes. I have a movieClip that I want to also function as a button. Instance name is "_onDemand". This movieClip is on the stage of my Home.fla.  "_onDemand" movieClip properties   Class:HomePage  Base clase: flash.display.MovieClip
    I want the user to click this movieClip and take the user to an external URL within a new browser window or tab.
    Can anyone help me? Or at least point me to a really really good tutroial that does exactly this using external classes?
    Thanks so much,
    Mark
    My code:
    package com.cox4college.pages
    import com.gaiaframework.templates.AbstractPage;
    import com.gaiaframework.events.*;
    import com.gaiaframework.debug.*;
    import com.gaiaframework.api.*;
    import flash.display.*;
    import flash.events.*;
    import com.greensock.TweenMax;
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    public class HomePage extends AbstractPage
    public function HomePage()
    super();
    alpha = 0;
    //new Scaffold(this);
    override public function transitionIn():void
    super.transitionIn();
    TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});
    override public function transitionOut():void
    super.transitionOut();
    TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete});
    public class _onDemand extends Sprite
    // Link Navigation button handlers
    public var _onDemand:Sprite;
    // if you want a hand cursor
    _onDemand.buttonMode = true;
    _onDemand.useHandCursor = true;
    _onDemand.addEventListener(MouseEvent.CLICK, onDemandClickHandler);
    _onDemand.addEventListener(MouseEvent.ROLL_OVER, onDemandRollOverHandler);
    _onDemand.addEventListener(MouseEvent.ROLL_OUT, onDemandRollOutHandler);
    public function onDemandClickHandler(e:MouseEvent):void{
    navigateToURL(new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/ondemand.cox"));
    public function onDemandRollOverHandler(event:MouseEvent):void{
    _onDemand.gotoAndStop("hover");
    public function onDemandRollOutHandler(event:MouseEvent):void{
    _onDemand.gotoAndStop("static");
    Getting the following errors:
    1120: Access of undefined property _onDemand.

    Ok. I admit it... I had some wonderful help to resolve this issue. You ever feel like you are on an island learning AS3 External Classes? I feel that way all the time... so far... I plan on not feeling that way soon. I hope this helps someone get off that island.
    package com.domainname.client {
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.utils.*;   
        import caurina.transitions.Tweener;
        import caurina.transitions.properties.*;
        FilterShortcuts.init();   
        ColorShortcuts.init();      
        public class Main extends MovieClip {
            private var coverDelay:Number = 4;
            //#DF6D27
            public function Main():void {
                initMain();
            private function initMain():void {
                mc_form.visible = false;
                Tweener.addTween(mc_cover,{alpha:1,time:1,delay:coverDelay,onComplete:formIn});
                btn_onDemand.buttonMode = true;
                btn_listings.buttonMode = true;
                btn_ppv.buttonMode = true;
                btn_rhapsody.buttonMode = true;
                btn_onDemand.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_onDemand.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_onDemand.addEventListener(MouseEvent.CLICK,navClick);
                btn_listings.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_listings.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_listings.addEventListener(MouseEvent.CLICK,navClick);
                btn_ppv.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_ppv.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_ppv.addEventListener(MouseEvent.CLICK,navClick);
                btn_rhapsody.addEventListener(MouseEvent.MOUSE_OVER,navOver);
                btn_rhapsody.addEventListener(MouseEvent.MOUSE_OUT,navOut);
                btn_rhapsody.addEventListener(MouseEvent.CLICK,navClick);           
                function navOver(evt:MouseEvent):void {
                    Tweener.addTween(evt.target,{_color:0xffc614,time:.2});
                function navOut(evt:MouseEvent):void {
                    Tweener.addTween(evt.target,{_color:0xffffff,time:.2});
                function navClick(evt:MouseEvent):void {
                    var url;
                    switch (evt.target.name) {
                        case 'btn_onDemand':
                        url = new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/ondemand.cox");
                        break;
                        case 'btn_listings':
                        url = new URLRequest("http://ww2.cox.com/myconnection/santabarbara/watch/entertainment/tv-listings.cox");
                        break;
                        case 'btn_ppv':
                        url = new URLRequest("http://ww2.cox.com/residential/santabarbara/tv/pay-per-view.cox");
                        break;
                        case 'btn_rhapsody':
                        url = new URLRequest("http://ww2.cox.com/myconnection/santabarbara/listen.cox");
                        break;                                                           
                    navigateToURL(url,"_blank");

  • Trouble Using DataProvider in External Class

    Hello,
    I am creating a Flash form which will include a drop-down selection menu from which a user may choose their state. I originally accomplished this by adding a ComboBox to the stage and then populated the ComboBox's DataProvider object with an XML listing of all the state names and the corresponding values. Everything works as expected.
    I have decided, however, that it would make the most sense to create an external class to accomplish the same thing. I have attempted to create such a class using the following code:
    package {
    import fl.data.DataProvider;
    import fl.controls.ComboBox;
    public class StateSelectionList extends ComboBox {
    private var xml:XML;
    private var dp:DataProvider;
    private var cb:ComboBox;
    public function StateSelectionList() {
    xml = <states>
    <state name="AL - ALABAMA" value="AL" />
    <state name="AK - ALASKA" value="AK" />
    <state name="AZ - ARIZONA" value="AZ" />
    </states>;
    dp = new DataProvider(xml);
    cb = new ComboBox();
    cb.dataProvider = dp;
    cb.labelField = "name";
    I then attempted to use this class in my Flash file by adding a ComboBox component to my library and then by creating a new StateSelectionList object and adding it the stage using the following code:
    var states:StateSelectionList = new StateSelectionList();
    addChild(states);
    The data provider for the new object is empty, however, as one can find by tracing the length of the object's dataProvider property;
    trace(states.dataProvider.length);
    I am new to creating external class files so I am not sure why the new object is not populated with any data. Thanks in advance for any suggestions.
    P.S. Please feel free to download the complete XML file I created for the states. The file includes all US states and possessions, US military states, and Canadian provinces and territories. http://windhorsemedia.com/private/states.xml

    There is a something tricky:
    first if you extend the combo box ther is no need to create a new instance in its constructor only to pass the data provider. This will work
        var xml:XML =<states>
                <state name="AL - ALABAMA" value="AL" />
                <state name="AK - ALASKA" value="AK" />
                <state name="AZ - ARIZONA" value='AZ' />
                </states>;
                dataProvider=new DataProvider(xml);
    dataProvider is public from base class ComboBox so you can access it anytime. But the properties that are inspactable may be setted with effect only after second frame is passed so try this
    public class StateSelectionList extends ComboBox {
            public function StateSelectionList():void
              addEventListener( Event>ENTER_FRAME, onsecondFrame, false, 0, true )
    private function onsecondFrame( evnt : Event ): void
    removeEventListener( Event>ENTER_FRAME, onsecondFrame
                var xml:XML =<states>
                <state name="AL - ALABAMA" value="AL" />
                <state name="AK - ALASKA" value="AK" />
                <state name="AZ - ARIZONA" value='AZ' />
                </states>;
                dataProvider=new DataProvider(xml);
                labelField="name";
    Note, In my custom components when I extend the UIComponent a set the parameter in afterComponentParameters or CreateUI( I think this was the name ) methods but more fast is just to pass one frame and set the parameturs

  • Using classes inside of classes

    I have created a custom sound class called MySoundClass that
    extends the Sound class... it is declared as class
    com.stickyMatters.WineGlassPiano.MySoundClass. I also have another
    class called SongPlayer that is declared as
    com.stickyMatters.WineGlassPaino.SongPlayer... my question is.. how
    do i use the MySoundClass inside of the SongPlayer class... when I
    try to import it says I cannot use the import statement inside of a
    class file. I know in AS3 you can use the package keyword to create
    packages and do that... but as far as I can see there is no package
    keyword in AS2... because I tried, and it just tells me htere is a
    syntax error on the line with the package declaration... can you
    use one custom class inside another? and if so... how?
    P.S. just to be sure... i am using flash CS3 and writing AS2
    files. Thanks!

    ack!!! thank you...I actually tried that and it didn't
    work... but when I went back after you said it and tried it again,
    it did work... so I guess I just had a misspelling or something
    before. ugh! Thanks for the reply!

  • Execute an external program using Runtime class

    How to execute an external java program using Runtime class?
    I have used ,
    Process p=Runtime.getRuntime().exec("c:/j2sdk1.4.0/bin/helloworld.java ");
    But it throws a runtime IOException error:2 or error:123.
    Help me with the code. Thanks in advance.

    Create Runtime Object and attach to system process.Try this code
    import java.io.*;
    public class ExecuteExternalApp {
      public static void main(String args[]) {
                try {
                    Runtime rt = Runtime.getRuntime();
                    //Process pr = rt.exec("cmd /c dir");
                    Process pr = rt.exec("c:\\ yamessenger.exe"); //give a valid exe file
                    BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                    String val=null;
                    while((val=input.readLine()) != null) {
                        System.out.println(val);
                    int exit = pr.waitFor();
                    System.out.println("Exited with error code "+exit);
                } catch(Exception e) {
                    System.out.println(e.toString());
                    e.printStackTrace();
    }Edited by: anishtomas on Feb 3, 2009 9:34 PM
    Edited by: anishtomas on Feb 3, 2009 9:37 PM

  • Using resources from an external JAR inside a JAR

    Hi,
    I'm trying to package all parts of my application into a JAR file so I can deploy my application using Java Web Start. However, I have an issue.
    I need to use the files from an external JAR, Ice.jar, with my application. Therefore, I included Ice.jar in my build, specifically in the lib/Ice.jar directory.
    This does not seem to be working; my application cannot read the information from the Ice.jar file when I launch my JAR file. It does work in one instance, however:
    I have a directory included in the same directory where my JAR file is. This directory is named lib, and contains Ice.jar. My directory structure is as follows:
    dist
    dist/NVAC.jar //my JAR
    dist/lib/Ice.jar //the external JARMy JAR file, NVAC.jar, will ONLY work if that lib directory is included in its directory. This is NOT what I want to do; I want to include the external JAR inside my JAR file, so a user will only have to download the JAR file. I have included the external JAR inside my JAR as I mentioned previously; at the path myJAR/lib/Ice.jar.
    Therefore, how do I use a resource from an external JAR inside my JAR? Do I have to use ClassLoader? ClassLoader.loadClass() perhaps?
    If I can provide any more information, please let me know.
    Thanks

    Seems to me it isn't practical to want to do things
    that don't work. Especially since you're using
    WebStart and it takes care of dependent jars
    automatically for you if you configure things
    correctly, so this absurd idea of jars inside jars
    isn't even helpful.Dang DrClap, you seem to be the go-to guy for destroying all my ridiculous ideas (no offense; I mean that in a good way).
    Seems I did not understand JWS fully when I thought of that idea. I researched it more after reading the replies here, and I see that I was indeed thinking absurdly.
    Thank you for the help,
    Dan

  • Needs help.....Please about using different classes

    I don't know how to use differenet classes.
    Please tell me how to write class to suit Start. This stuff me up. Please .... help me
    <<My program>>
    //Start
    public class Start
    {  private Artist[] Artists;
    private Record[] records;
    private Person[] Manager;
    private TextMenu makeMenu = new TextMenu();
    public static void main(String[] args)
         Start studio = new Start();
    studio.menu();
    public Start()
    {  //Person.Manager(ManagerName,HouseNumber,StreetNumber,PhoneNumber)
         Manager = new Person[1];
         Manager[0] = new Person("Yangfan",88,"Young ST",11118888);
         //Artist(GroupID,ArtistName,HouseNumber,StreetNumber,PhoneNumber)
         Artists = new Artist[5];
    Artists[0] = new Artist(1,"Backstreet Boys",58,"Music ST",99998888);
    Artists[1] = new Artist(2,"Santana",68,"Music ST",99998899);
    Artists[2] = new Artist(3,"Macy Gray",78,"Music ST",55558888);
    Artists[3] = new Artist(4,"Ricky Martin",88,"Music AVE",77778888);
    Artists[4] = new Artist(5,"Did Rock",55,"Music Road",66667777);
    //Record(RecordingID,RecordName,Artist,StartTime,FinishTime,RecordingDate,GuestArtist1,GuestArtist2)
    records = new Record[6];
    records[0] = new Record(1,"I want it that way",Artists[0],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[1] = new Record(2,"Smooth",Artists[1],11,12,"05/08/2001",Artists[1],"");
    records[2] = new Record(3,"Do something",Artists[2],11,"05/08/2001",Artists[3],"");
    records[3] = new Record(4,"Livin La Vida Loca",Artists[3],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[4] = new Record(5,"Bawitdaba",Artists[4],11,13,"05/08/2001",Artists[1],"");
    records[5] = new Record(6,"The one",Artists[0],11,14,"05/08/2001",Artists[1],"");
    public void menu()
    {  String[] choices = {">>>List Manager Details",">>>List All Artist Names",">>>List An Artist Telephone-Number",">>>Show Details For One Recording",">>>Add A New Recording",">>>List The Recording Costs For All Artists",">>>List Artist's Reocording",">>>Exit Program"};
    while (true)
    {  switch (makeMenu.getChoice(choices))
    {  case 1: showAllArtists();
    break;
    case 2: showAllRecords();
    break;
    case 3: System.exit(0);
    break;
    case 4: System.exit(0);
    break;
    case 5: System.exit(0);
    break;
    case 6: System.exit(0);
    break;
    case 7: System.exit(0);
    break;
    case 8: System.exit(0);
    break;
    default:
    public void showAllArtists()
    {  int numArtists = Artists.length;
    for(int i = 0; i < numArtists; i++)
    {  Artists[i].displayArtistDetails();
    public void showAllRecords()
    {  for (int i = 0; i < records.length; i++)
    {  System.out.println();
    records.printRecordDetails();
    <<Assignment>>
    Due - midnight, Wednesday August 22nd
    This assignment will test your knowledge of Java programming using classes, encapsulation and javadoc.
    The base requirements
    Write a complete Java class to manage a Digital Recording Studio. The studio wants to keep a list of all Artists that use the studio and also wishes to keep track of all Recordings that have been made. An important function of the program is to calculate the time spent making a recording and charge the Artist for the time used.
    You must create at least the following classes, Start, Studio, Person, Artist, Recording, Address. You may create other classes if needed as well
    Start will contain main(), create one instance of a Studio and execute a Menu of commands to test your code. Studio should contain a studio name, an array of Artist and an array of Recording plus the studio manager (a Person). Each Artist should contain the name of the group and an Address. Each Person will have a name and a home address. Each recording will have a Title (usually song title), an Artist (only one), and a list of guestArtist (they are Artist�s but will not receive royalties) the number of the CD the recording is stored on (numbers are numerical and recordings are saved on CD-R), plus the recording start and finish times for the recording session (suggest you use Java Date class � refer to the API). An Address will contain, house number (integers only), a street name and a telephone number. There is no need to store city and country.
    To enter a set of data for testing your program � main() should call a method in the Start class that will fill in a set of values by creating objects and filling in values by calling methods in each class. This is the ONLY method allowed to be longer than 1 page long � normally we would read the data from a file but there are no O-O principles that can be learnt with simply filling in data values. It is suggested to create say at least 4 Artist�s and 6 Recordings (at least one with 1 guest Artist and one with 2 guestArtist�s)
    A menu for testing your program should be provided (it is suggested to put the Menu into a separate class as you need at least 3 menus). While other commands are possible, only the following ones will receive marks.
    Menu commands needed are
    List the Managers name, address and telephone number
    List all Artist Names
    List an Artist telephone number (a sub menu showing valid Artist�s is required)
    Show all details for one Recording ( sub menu of valid Recordings will be needed and remember there can be more than one guestArtist)
    Add a new Recording, user will need to be prompted for all details.
    List the recording costs for all Artists � show each Artist on a separate line with their name and total amount, charge for using the studio is $1000 per hour or part thereof, example for a 1 hour and 10 minute recording the Artist will be billed for 2 hours.
    List all the Recording�s one Artist has worked on (sub menu of Artists needed), the list should show whether they were the Artist or a guestArtist
    Exit program
    Use fixed sizes for arrays, suggest 20 is suitable for all arrays. Java can handle dynamic data structures (where the number of elements can grow or shrink), but that is beyond a first assignment.
    Do NOT make ANY methods static - this defeats the Object Oriented approach and will result in ZERO marks for the entire assignment.
    Data MUST be encapsulated, this means that all the data relating to an object are to be stored INSIDE an object. None of the data detail is to be globally available within your program - hence do not store Artist names in either Studio or Recordings � just store a reference instead. Do NOT create ID numbers for Artists, you should use References instead � for many students this will be the hardest part as you have to use Objects, not program in a C style to solve the problem. Note that if there are any non-private data in classes then zero will given for marks for encapsulation.
    Good programming style is expected (see web page or lecture notes). In particular, you must use javadoc to generate a set of html pages for your classes. Make sure you use the special javadoc style comments in your source code. Marks will be granted for both using javadoc and also for including sensible javadoc comments on each class and each public method.
    What to Hand In
    Read the turnin page, basically the .java files, a readme.txt to tell the marker which file the program starts from plus the javadoc (html) files. Do NOT send .class files (if you do send these we will delete them and recompile your program), do NOT compress with gtar, tar, zip or use any other tool on your files. Turnin automatically compresses all your files into a single archive for us to mark.
    The simplest way to turnin all your files is to place all files in one directory then just use the *.* wildcard to turn in all files within that one directory.
    You must turnin all files that are not part of Java 1.3. In particular, you are allowed (actually encouraged) to use EasyIn or SavitchIn but should include the one you use in the files you submit. It is STRONGLY suggested that you copy all the files into another directory, test it works there by compiling and executing then turnin files from that directory. A common problem is students adding comments at the last minute then not testing if it still compiles. The assignment will be marked as submitted � no asking later for leniency because you added comments at the last minute and failed to check if it still worked.
    If the tutors are unable to compile your submission, they will mark the source code but you will lose all the execution marks. Sorry, but it is your responsibility to test then hand in all files.
    Comments
    For CS807 students, this program should be fairly easy if it was to be programmed in C (you would use several struct). The real art here is to change over to programming objects. Data is contained in an object and is not global. This idea is essential to using Java effectively and is termed encapsulation. Instead of using function(data), you use objectName.method( ). Effectively you switch the data and functions around, the data has a method (function) attached to it, not the other way around as in C (where you have a function and send data to it).
    While there will be some marks for execution, the majority of the marks will be given for how well you write your code (including comments and documentation) and for how well you used O-O principles. Programs written in a C style with most of the code in one class or using static will receive ZERO marks regardless of how well they work.
    You are responsible for checking your turnin by reading the messages turnin responds with. Failure to read these messages will not be an acceptable excuse for submitting an incorrect assignment. About 2% of assignments sent to turnin are unreadable (usually empty) and obtain 0.
    Late submissions
    Late submissions will only be accepted with valid reasons for being late. All requests for assignment extensions must be made via email to the lecturer. Replies for acceptance or refusal will made by email. Instant replies are unrealistic (there is usually a flood of queries into my mail box around assignment due dates) and the best advice is to ask at least 4 days in advance so that you will have a reasonable chance of getting a timely reply and allow yourself enough time to submit something on time if the extension is not granted.
    ALL late submissions will be marked LAST and will NOT be sent to tutors for marking until all other assignments have been marked. As an example, if you submit late and your assignment is not yet marked by the time assignment 2 is due then it will be pushed to the end of the marking pile as the assignments that were submitted on time for assignment 2 will take priority.
    If you make a second submission after the submission date, only the first submission will be marked. We will not mark assignments twice! You can update your submission BEFORE the submission date if you need to - this will just overwrite the first submission. The latest time for a late submission is 5pm on the Wednesday after the due date. This is because, either a solution will be handed out at that lecture or details of the assignment will be discussed at the lecture. I cannot accept any assignment submissions after that time for any reason at all including medical or other valid reasons. For those who are given permission to be later than the maximum submission time � a different assignment will be handed out. Remember, if you decide to submit late you are VERY UNLIKELY to receive feedback on your assignments during semester.
    Assignments will be removed from turnin and archived elsewhere then forwarded to tutors for marking on the morning after the assignment is due. A different tutor will mark each of your assignments � do not expect the tutor you see at the tutorials to be your marker.
    Marks will be returned via email to your computer science yallara account � ideally within 2 weeks. I will send marks out when I receive them so do not send email asking where your marks are just because a friend has theirs. If you want your email forwarded to an external account, then place a valid .forward file into your yallara account. The Help Desk on level 10 can assist you in setting this up if you do not know how to do it.

    I have seen other people who have blatantly asked for
    other people to do their homework for them, but you
    are the first person I've seen to actually cut and
    paste the entire assignment as it was handed to you.
    Amazing.
    Well, unlike some of the people you're talking about, it seems like zyangfan did at least take a stab at it himself, and does have a question that is somewhat more sepcific that "please do this homework for me."
    Zyangfan,
    marendoj is right, though. Posting the entire assignment is kind of tacky. If you want to post some of it to show us what you're trying to do, please trim it down to the essential points. We don't need to see all the instructor's policies and such.
    Anyway, let me see if I understand what you're asking. You said that you know how to write the code, but only by putting it all in one class, is that right? What part about using separate classes do you not understand? Do you not know how to make code in one class aware that the other class exists? Do you not know how code in class A can call a method in class B?
    Please be a bit more specifice about what you don't understand. And at least try using multiple classes, then when you can't figure out why something doesn't work, explain what you did, and what you think should have happened, and what did happen instead.
    To get you started on the basics (and this should have been covered in your course), you write the code for two classes just like for one class. That is, for class A, you create a file A.java and compile it to A.class. For class B, you create a file B.java and compile it to B.class. Given how rudimentary you question is, we'll skip packages for now. Just put all your class files in the same directory, and don't declare packages in the .java files.
    To call a method in class B from code that's in class A, you'll need an object of class B. You instantiate a B, and then call its methods.
    public class B {
      int count;
      public B() { // constructor
      public void increment() {
        count++;
    public class A {
      public static void main(String args[]) {
        B b = new B();
        b.increment();
    }Is this what you were asking?

  • External Classes

    I've been looking around and I've failed to find a way (or I messed up somewhere) to have an applet use an external class which, in turn, uses objects of the applet. In example, you have main.class which has a drawing area, and you have picture.class which is supposed to draw a picture in the drawing area of main.class. I'm asking that someone explains what I add in main.java for it to use picture.java, and what I add in picture.java for it to be able to make use of objects in main.java... I hope I explained this well enough, and replies are appreciated.
    (main.java has a Graphics object and makes an instance of the picture class, to which it passes the parameters Something.jpg, and picture.java then draws Something.jpg on main.java's Graphics object... This is all strictly in example.)

    Yeah, I'm starting to see what you mean by implementing some sort of Getter. Right now, example-wise, I have the Picture class inside of Main.java, and that works fine, since it then has access to the Graphics object, but java compiles them into two separate class files, Main.class, and Main$Picture.class, but I want to separate the two classes and have two separate java files, but since Picture wouldn't have access to the Graphics object, it's not as simple as just making a new file called Picture.java. So yeah, I see what you mean, since Picture doesn't have direct access to the Graphics object, have picture send what it wants to do back to Main, since it has access to the Graphics object, I just don't know how to implement it.

  • How do I write an external class with global constants?

    Hi you all !
    First I want to explain what exactly I want to do:
    I have an application that should run in different resolutions. The app runs fullscreen, and I don't use Layouts or something, just a single Frame with a Graphics Object.
    Now to handle the different resolutions, I want to write an external class with some constants to use. The usage in my main Class should be something like this:
    public
    class blah
    private Constants myConstants;
    public blah()
    if (highResolution)
    myConstants = new hiResConstants();
    else
    myConstants = new loResConstants();
    System.println(String.valueOf(myConstants.SCREEN_WIDTH);
    }or somthing like that. The important fact is that I can choose the constants at runtime and that I am NOT forced to use methods to get the values, cause something like
    System.println(String.valueOf(myConstants.getScreenWidth());sux if you have methods using 5 or more parameters.
    Anybody out there who understood my problem and can help me??? PLEASE?
    best regards,
    Skippy

    First, what's so much worse about
    System.println(myConstants.getScreenWidth());
    than
    System.println(myConstants.ScreenWidth);
    Is the extra five characters really that bad? (Note
    you don't need the String.valueOf method call.)Well actually it was a wrong example I gave here, but it's not the call that makes me shake but the implementation:
    public int screenWidth = 1024;vs.
    public
    int getScreenWidth()
    return 1024;
    }Here it makes a bigger difference, even when you think of managing about 100 or even more constants.
    Second, why do you have methods that take five or more
    parameters!?Well, maybe this example show up what I mean:
    if (cursorIsInArea(100,100,200,200,areaId))
    doSomeStuff();Ok, I could use Rectangles here, but if you think of the timing here (I draw 30 frames / sec and this check comes about every frame or the animation would be choppy) I refuse to create an Object everytime I make this call.
    Btw: Is it worth thinking about the time of execution like I did in this example? OO is a neat thing, but is it that fast?
    I don't think isCursorInArea(new Rectangle(100,100,200,200),areaId) is such a great idea, but I might be wrong.
    It sounds like you're trying to compound a bad design
    with an even worse design for no good reason!Well, I'm not that experienced Java programmer to judge about that, but I (and my profs at university too) found my codes well structured and designed so far.
    Skippy
    PS: the string.valueOf(123) call came from cut&paste:
    system.out.println(string.valueOf(number1)+string.valueOf(number2));Try this without the function.... ;-)

  • Uploading bitmapData using FileReference class ?

    Hi gurus ;)
    Question nr 1.
    Is it possibly to upload bitmapData to server using
    FileReference class ? How should i approach this issue, is there
    any ready classes available for this purpose. I'm generating
    bitmaps inside my Flash/Flex App and need to store them under users
    profile in server.
    Question nr 2.
    Can i upload files from remote server to another using
    FileReference class
    e.g Somehow like :
    uploadURL = new URLRequest();
    uploadURL.url = "
    http://www.[yourDomain
    fileURL.url = "
    http://www.myLocation.com/myfile.JPG";
    file = new FileReference(fileURL.url);
    file.upload(uploadURL);
    This is just an idea, sure not working ;)
    Any ideas are helpful
    Thx
    iquaaani

    I did a small application that uploads a file to the server
    every hour. If the server response that a login is required to
    upload the file, it goes to a login page to do the login and
    retried to upload the file.
    I got the server response in order to know if the file did
    upload correctly or not (I have to send more form data than just
    the file). I didn't try the mime type since it's not relevant for
    my application and usualy this information is not very trust worthy
    anyways.
    I'm not sure what you mean with exceptions, if you are
    referring to HTTP errors, I think there is an event for that, but I
    used the IOError event for this, and it seems to work good
    also.

Maybe you are looking for

  • Remote for Tv anywhere not working

    My new remote from the box will not work but everything else works fine. Any Ideas how to make my remote work?

  • Perf Management - Part Appraiser Error

    Hi All - I am having an issue during the preparation of the appraisal document that I have created. I am getting the error, "Maximum of 00 Part appraisers allowed for template". I get the error when I try to create a new document. I have checked all

  • Adobe GoLive is Dead.  Now What?

    Adobe announced today that GoLive is dead: http://www.macworld.com/article/133181/2008/04/golivedead.html I am a long time Adobe GoLive user having migrated from Pagemaker 3.0 to GoLive 6 to GoLive 9. My websites are not that complicated, and I know

  • How to find out how always on configured?

    How to find out how is always on configured on a particular database for the preferred type of backup?  Thanks.

  • Linksys with Leopard

    I an running Leopard on a new IMac with a Linksys wireless network. Every hour or so I drop to only 1 or maybe 2 bars on the Airport -- I have to turn Airport off and then on again to get a signal. Once I re-start I immediately go full bars. The Link