Help me.... ClassLoader and classes

I'm trying to use a ClassLoader to load in .class files at run time. But I keep getting ClassNotFoundExceptions. which doesn't make sense cause the classes are there... any thoughts on how to fix this... thanks in advanced
- hux

So I thought I had it... but it doesn't work.. I've removed the .class from the end of the passed in string, but the bloody thing is still giving me a ClassNotFoundException.... any ideas?
Thanks for the help...
--Hux                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Need HELP with objects and classes problem (program compiles)

    Alright guys, it is a homework problem but I have definitely put in the work. I believe I have everything right except for the toString method in my Line class. The program compiles and runs but I am not getting the right outcome and I am missing parts. I will post my problems after the code. I will post the assignment (sorry, its long) also. If anyone could help I would appreciate it. It is due on Monday so I am strapped for time.
    Assignment:
    -There are two ways to uniquely determine a line represented by the equation y=ax+b, where a is the slope and b is the yIntercept.
    a)two diffrent points
    b)a point and a slope
    !!!write a program that consists of three classes:
    1)Point class: all data MUST be private
    a)MUST contain the following methods:
    a1)public Point(double x, double y)
    a2)public double x ()
    a3public double y ()
    a4)public String toString () : that returns the point in the format "(x,y)"
    2)Line class: all data MUST be private
    b)MUST contain the following methods:
    b1)public Line (Point point1, Point point2)
    b2)public Line (Point point1, double slope)
    b3)public String toString() : that returns the a text description for the line is y=ax+b format
    3)Point2Line class
    c1)reads the coordinates of a point and a slope and displays the line equation
    c2)reads the coordinates of another point (if the same points, prompt the user to change points) and displays the line equation
    ***I will worry about the user input later, right now I am using set coordinates
    What is expected when the program is ran: example
    please input x coordinate of the 1st point: 5
    please input y coordinate of the 1st point: -4
    please input slope: -2
    the equation of the 1st line is: y = -2.0x+6.0
    please input x coordinate of the 2nd point: 5
    please input y coordinate of the 2nd point: -4
    it needs to be a diffrent point from (5.0,-4.0)
    please input x coordinate of the 2nd point: -1
    please input y coordinate of the 2nd point: 2
    the equation of the 2nd line is: y = -1.0x +1.0
    CODE::
    public class Point{
         private double x = 0;
         private double y = 0;
         public Point(){
         public Point(double x, double y){
              this.x = x;
              this.y = y;
         public double getX(){
              return x;
         public double setX(){
              return this.x;
         public double getY(){
              return y;
         public double setY(){
              return this.y;
         public String toString(){
              return "The point is " + this.x + ", " + this.y;
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }My problems:
    I dont have the right outcome due to I don't know how to set up the toString in the Line class.
    I don't know where to put if statements for if the points are the same and you need to prompt the user to put in a different 2nd point
    I don't know where to put in if statements for the special cases such as if the line the user puts in is a horizontal or vertical line (such as x=4.7 or y=3.4)
    Edited by: ta.barber on Apr 20, 2008 9:44 AM
    Edited by: ta.barber on Apr 20, 2008 9:46 AM
    Edited by: ta.barber on Apr 20, 2008 10:04 AM

    Sorry guys, I was just trying to be thorough with the assignment. Its not that if the number is valid, its that you cannot put in the same coordinated twice.
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }The problem is in these lines of code.
    public double slope(Point point1, Point point2) //if this method finds the slope than how would i use the the two coordinates plus "m1" to
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
         }if slope method finds the slope than how would i use the the two coordinates + "m1" to create a the line in toString?

  • HELP! - BEAN and CLASS interchange?

    When I setup to a bean like:
    <jsp:useBean id="logger" scope="application" class="Logger" />
    I can use the bean and bean's functions fine in the JSP, but not within functions that exist in the JSP like:
    jspInit()
    it says the "logger" is undefined. Is there a way I can access the logger function within the jspInit class or do i have to redefine a new instance of "logger" within jspInit().
    The whole point is I would like to use the same instance of the class from all the JSPs. Thats what scope=application seems to do instead of instantiating everytime.
    P.S. If I were to instantiate a class like:
    Logger logger = new Logger;
    would I be able to give it "applicate scope"? like a bean can have?
    Really long question, thanks a lot for the help. :)

    Hi yusufm1,
    I can use the bean and bean's functions fine in the JSP, but not within functions that exist in the JSP like:
    jspInit()it says the "logger" is undefined.
    What ever you write in jsp, other than in <%! %> tags, is a part of _jspService() method. The life cycle of jsp has following 3 steps.
    1. jspInit()
    2. _jspService()
    3. jspDestroy()
    jspInit() is the first method of the jsp class that is executed. _jspService is the next method. The statement -
    <jsp:useBean id="logger" scope="application" class="Logger" />
    instantiates a bean in _jspService() method of jsp class. So it is evident that this instance is not available in jspInit().method.
    Is there a way I can access the logger function within the jspInit class or do i have to redefine a new instance of "logger" within jspInit().
    To use the bean instance in jspInit() you should instantiate the bean object in jspInit() or declare it as an instance variable.
    If I were to instantiate a class like:
    Logger logger = new Logger;
    would I be able to give it "applicate scope"? like a bean can have?
    No, simply instantiating a class in the jspInit() method wouldnot provide it with application scope. You have to put that instance in ServletContext (application) to make it available to all jsp pages. If you instantiate a class in jspInit() only and donot put it in application it is not even available to _jspService() method.
    Hope this helps

  • Help with objects and classes

    the only problems i have is getting the bestTime value to display at the end and also getting the proper message dialog boxes to appear by calling the other program instead of putting JOptionPane.showInputDialog...... in this part
    Swimmer swim = new Swimmer();
              swim.setName(JOptionPane.showInputDialog(null, "Input user's name"));
              swim.setInitTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter initial time")));
              swim.setFinTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter final time")));there should be a way i can call the other program where i have the methods in but im not sure as to how to do it.
    import javax.swing.JOptionPane;
    public class Swimmer
         private String name;
         private double initTime;
         private double finalTime;
         private double bestTime = 0;
         public void setName(String n)
              name = n;
         public void setInitTime(double t)
              initTime = t;
         public void setFinTime(double f)
              finalTime = f;
         public void setBest(double b)
              bestTime = b;
         public String getName()
         String userName = "";
              userName = JOptionPane.showInputDialog(null,
              "Input swimmer's name");
              return name;
         public double getInitTime()
              double initialT;
              initialT = Double.parseDouble(
                   JOptionPane.showInputDialog(null, "Enter initial time"));     
              return initTime;
         public double getFinTime()
              double finalT;
              finalT = Double.parseDouble(
                   JOptionPane.showInputDialog(null, "Enter final time"));
              return finalTime;
         public double getBest(double initTime, double finalTime)
              initTime = 0;
              finalTime = 0;     
              double bestTime = 0;
              if (finalTime > initTime)
                   bestTime = initTime;
              else
                   if (initTime > finalTime)
                        bestTime = finalTime;
                   return bestTime;
         public void output()
         String outString = "";
         outString += name + "\n";
         outString += "Best Time: " + bestTime + " seconds\n";
         JOptionPane.showMessageDialog(null, outString);
    }new other java file. the problem i was talking about up top is for this program. instead of using the joption dialog boxes there should be a way to call the other program where i have methods but im not sure how to do it.
    import javax.swing.JOptionPane;
    public class Swimmer2
         public static void main(String[] args)
              Swimmer swim = new Swimmer();
              swim.setName(JOptionPane.showInputDialog(null, "Input user's name"));
              swim.setInitTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter initial time")));
              swim.setFinTime(Double.parseDouble(JOptionPane.showInputDialog(null, "Enter final time")));
              swim.output();
    }

    swim.setName(swim.getName());would seem to work.
    Very odd design though.

  • Setting path and class path help

    I am a complete beginner who is currently starting a cd based tutorial!I have downloaded jdk1.1.6 which is the nearest developement kit to the one used in the tutorial.I use windows 98.When I try to set my path or class path as instructed in the docs, I cannot find any thing in the autoexec file at all.I have opened using notepad/Run and DOS edit but all three open an empty file.Where will I need to set up the path and class paths.My system must run these from somewhere else perhaps due to an update.

    Hi,
    Put the following statements in your autoexec.bat.
    <homepath> = Path of your JDK folder on the drive. e.g. c:\jdk
    SET CLASSPATH=;.;<homepath>\lib\tools.jar; .... continue with other jar files on the same line and seperate the entries by a semicolon.
    SET PATH=C:\WINDOWS\;C:\<homepath>\BIN\;
    This autoexec.bat must be on c:\. i.e. U can open it in notepad by giving c:\autoexec.bat in the File Open Dialog. It is possible for this file to be empty. Simply add the commands on the last line.
    Regards ,
    Karan

  • Loading .jar and .class in MX7

    I have a cfx tag that includes a .class and .jar file. I
    could do this on the old MX server but in MX7 the option is not in
    the cfide/administrator.
    I copied the .jar and .class files into the
    c:\cfusionmx7\runtime\lib\ directory and then added them to the
    bottom of the jvm.config file with the following entry. (note: The
    .jar file is called MYNEWFILE.jar)
    java.class.path={application.home}/servers/lib,{application.home}/../lib/macromedia_driver s.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib,{application.home}/lib/ MYNEWFILE.jar,{application.home}/../wwwroot/WEB-INF/lib/
    I then rebooted the server. I also have a ".class" file that
    goes with this. I have no idea where to put that thing. The cfx
    (which I mapped in the administrator).
    I get the standard 500 error saying:
    HTTP 500 - Internal server error
    Internet Explorer
    even though I have debugging going to my laptop.
    Here is the output of the exception.log
    "Error","jrpp-0","07/05/07","16:04:14",,"com/allaire/cfx/CustomTag
    The specific sequence of files included or processed is:
    C:\Inetpub\wwwroot\Pauly\example.cfm "
    java.lang.NoClassDefFoundError: com/allaire/cfx/CustomTag
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown
    Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
    at
    jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:69)
    at
    coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:207)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at coldfusion.tagext.CfxTag.doStartTag(CfxTag.java:88)
    at
    coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1908)
    at
    cfexample2ecfm2026642798.runPage(C:\Inetpub\wwwroot\Pauly\example.cfm:3)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
    at
    coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at
    coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
    at
    coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
    at
    coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at
    coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    "Information","Thread-10","07/05/07","16:14:10",,"Address
    already in use: JVM_Bind"
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at
    coldfusion.server.jrun4.metrics.CfstatServer.run(CfstatServer.java:64)
    Any help would be greatly appreciated, as I've been working
    on this for a while. I couldn't find a solution in the forums so I
    thought I would post. Thanks!
    Pauly

    >> java.lang.NoClassDefFoundError:
    com/allaire/cfx/CustomTag
    Is the CFX.jar in the classpath?
    > The option is not in the cfide/administrator.
    What option? The administrator has several options for custom
    jars, tags, et.
    - Extensions -> Custom Tag Paths
    - Extensions -> CFX Tags
    CF will also look in these directories automatically
    - {cf_webroot}/WEB-INF/classes (for classes)
    - {cf_webroot}/WEB-INF/lib (for jars)

  • ClassLoader and ClassCastException

    ok, I have a Class named 'Lib' that I want to Load into the virtual machine from a file. I do this by extending ClassLoader and overloading the findClass() method to read the .class file through a FileInputStream.
    Everything is fine until I try casting the 'Lib' object to a 'Lib' type. For example, I can do a
    Object o = loadClass("Lib").newInstance();
    but I cannot do a
    Lib l = (Lib)loadClass("Lib").newInstance();
    This also raises a new question: if you load a class dynamically during the execution of the program, how do you assign it to a new reference type so that you can use it?(i.e how do you make the 'Lib' type if you don't import the class? Incidently, I do import it and it still won't cast the object.)
    I am making sure that the same class loader is loading all instances of the 'Lib' type, namely my(the extended) classloader, but it still won't let me cast. can anyone help??? thx.
    Karl

    Thanks for the comment Vlad. Here is the code I'm using, I verified that it is not being loaded by the bootstrap ClassLoader(default) as I moved it entirely out of the CLASSPATH.
    Class myClass extens ClassLoader{
    public void libInit(){
                            try{
                                            System.out.println("parent class loader: " + ClassLoader.getSystemClassLoader().toString());
                                            ClassLoader c = this.getClass().getClassLoader();
                                            System.out.println("this class loader: " + c.toString());
                                            Lib lib = (Lib)loadClass("Lib").newInstance();
                                            System.out.println("asserting Lib instance. " + lib.toString());
                                    }catch(Exception e){
                                            System.err.println("error2: " + e.toString() + "  " + e.getMessage());
                    public Class findClass(String name){
                            System.out.println("using my findClass()");
                            byte[] b = loadClassData(name);
                            return defineClass("Lib", b, 0, b.length);
                    final Class findLoadedClasses(String name){
                             return null;
                            byte[] b = null;
                            try{
                                    File f = new File("Libs","Lib.class");
                                    FileInputStream fis = new FileInputStream(f);
                                    int i = (int)f.length();
                                    b = new byte;
    System.out.println("boo " + i);
    fis.read(b,0,i);
    fis.close();
    }catch(Exception e){
    // Logger code goes here
    System.err.println("error1: " + e.getMessage());
    return b;
    The above fails on the cast from the newInstance() method. In the above code is the first place in the program where I even reference a 'Lib' type.
    Also, instead of using a 'Lib' type, how could I read a class file into a reference type? Is this what java.lang.ref is for? thanks.
    Karl

  • Batch Management and Class and Characteristics Assignment

    Dear Team,
    Recently We Configured Batch Management in SD, and Batch is determining in Sales order, delivery and Billing. Its working fine.
    Issue-1: While posting stock (Quality server) with moment type 561, production date entered manually but system not calculating Expiry date automatically, i maintained Total shelf Time and Min. Rem. Shelf time.
    Issue-2: In sales order I want determine batch as FIFO Method, in present system it will consider LIFO method,
    I come to know to over come this Issues i need to maintain some Characteristics and Class, Please help me out in creating of characteristics and class and other process,
    Thanking you in advance,
    Sudheer.U

    Dear Team,
    Recently We Configured Batch Management in SD, and Batch is determining in Sales order, delivery and Billing. Its working fine.
    Issue-1: While posting stock (Quality server) with moment type 561, production date entered manually but system not calculating Expiry date automatically, i maintained Total shelf Time and Min. Rem. Shelf time.
    Issue-2: In sales order I want determine batch as FIFO Method, in present system it will consider LIFO method,
    I come to know to over come this Issues i need to maintain some Characteristics and Class, Please help me out in creating of characteristics and class and other process,
    Thanking you in advance,
    Sudheer.U

  • To view database Java Source and Class code in SQL Developer - Do this...

    I've wanted something like this for a while.. Hope this helps someone else...
    Make a master detail report...
    1. Click the reports tab.
    2. Right click on "user defined reports" and select "add report"
    3. Type "Java Source Object and Class Code" into the name field.
    4. Make sure "Style" is set to "Table".
    5. Paste this code into the "SQL" window.
    select OBJECT_NAME, OBJECT_TYPE, to_char(created,'DD-MON-YYYY HH24:MI:SS') Created, to_char(LAST_DDL_TIME,'DD-MON-YYYY HH24:MI:SS') "Last DDL", STATUS
         from user_objects
        where object_type in ('JAVA SOURCE')
        order by object_name6. Click "Add child"
    7. Make sure "Style" is set to "Code" in the child.
    8. Paste the following code into the SQL window of the child.
    select text from user_source where name = :OBJECT_NAME order by line9. Click Apply..
    10. Enjoy...
    no semicolons after the sql....
    Message was edited by:
    slugo

    Mark,
    Thanks Check this out people can now subscribe to the public reports out no the exchange.
    http://krisrice.blogspot.com/2007/10/marks-post-on-forums-got-me-to-do.html
    -kris

  • Abstract method and class

    I'm a beginner in Java and just learn about abstract method and class.
    However, i am wondering what is the point of using abstract method/class?
    Because when I delete the abstract method and change the class name to public class XXXX( changed from "abstract class XXXX), my program still runs well, nothing goes different.
    Is it because I haven't encountered any situation that abstract method is necessary or ?
    Thanks!

    Yes - you probably haven't encountered a situation where you need an abstract.
    Abstract classes are not designed to do anything on their own. They are designed to provide a template for other classes to extend by inheritance. What you have build sounds like a concrete class - one which you are creating instances of. Abstract classes are not designed to be ever instantiated in their pure form - they act like a partial building block, which you will complete in a class which extends the abstract.
    An example might be a button class, which provides some core functionality (like rollover, rollout etc) but has an empty action method which has to be overwritten by a relevant subclass like 'StartButton'. In general, abstract classes may not be the right answer, and many people would argue that it is better to use an interface, which can be implemented instead of extended, meaning that you can ADD instead of REPLACING.
    Not sure if that helps.. there are whole chapters in books on this kind of thing, so it's hard to explain in a couple of paragraphs. Do some google searches to find out more about how they work.

  • Could not find .java and .class files...

    I am working on Windows Vista operating system.
    I am able to access the .java which I created and also .class files from the command prompt.
    But I am not able to find those files in the bin folder in Windows Explorer.
    I want to delete some .java and .class files. When I use the delete command on the command prompt , I am getting ---- could not find the file.
    Can anyone help me...

    Hey everyone,
    I found the answer!
    If the command prompt application is run as administrator(since it is windows vista), the created .java files as well as .class files will be stored and can be seen in the bin folder.
    However, I could not locate the .java files (and also corresponding .class files) which I created previously.

  • Help ! Package and ArrayStoreException

    Please help. I have a problem with a package program. I am creating a package called pack containing 2 classes, Expenses with m_expense( ), Expenses have variables to store food, lodging and clothing and class Income with m_Income( ), Income have variable to store salary, rent and allowances. Then i create a class debit to display the variable using public static void main (String args[ ] ); and it in Expenses.m_expense( );
    Income.m_income( ) to display the variable contents;
    I should also calculate the savings. The compile error is i cannot access Expenses.m_expense and also Income.m_income. I don't know what is wrong. And where should i calculate the savings - in debit.java or in pack.java.
    Another thing is I'm supposed to create a program to create ArrayStoreException but i don't understand it. Can anyone please give an example and explain.
    All advice is appreciated. Thank you!

    You see, now I'm a little confused. What lecturer had taught me is unapplicable and is different from the other tutorials that i refered to.
    I create a new dir named pack. In it there is a file named pack containing the 2 classes.An example code he gave is something like below :
    package pack;
    public class Expense
    public static void m_expense()
    float food = 150.00
    System.out.println("Food is" + food);
    public class Income
    public static void m_income()
    float salary = 575.00
    System.out.println("Salary is " + salary);
    Then create a new file outside the directory:
    import pack.*;
    class debit
    public static void main(String args[])
    Expense.m_expense();
    Income.m_income();
    What do you think ? Pls give some comments and assist to rectify the mistake. I will try the earlier suggestions you gave to me. Thanks a lot.

  • Java-JSP working with packages and classes

    Hi everybody,
    I'm bearly new on Java-JSP developping and I wanted to know how Tomcat (for example) manage the imported packages and classes.
    The fact is I'm working on a project ('/bob') which use some packages that I don't see in the '/bob' directory. So, is that possible that '/bob' is downloading packages and classes from Internet to '/bob/download' virtual repertory and use it? If it is true, is it possible to override this download by making '/bob' project using local packages or classes (example : com.boblibrary.classes.util in '/bob/WEB-INF/classes/com/boblibrary/classes/util') instead of downloading it?
    Therefore, the '/bob' project is using bugged classes (that I think it downloads from Internet) which I can't correct.
    Thanks for your help.
    - Renaud

    Thank you for your answer, but I can't imagine where is physicaly the class that my project use and show me as http://localhost:8080/atlassian-jira-3.13.2/download/ressources/br.com.ecore.jira.plugin.projectViewPlugin:ProjectViewTabPanel/js/projectviewtabpanel.js. Where is that Javascript file suppose to be on my hard drive? Or where is that class 'br.com.ecore.jira.plugin.projectViewPlugin' suppose to be on my hard drive? If it is not dowloaded from the Internet.
    I have no trace of that class on 'atlassian-jira-3.13.2/', neither on 'jdk1.6.0_18/', 'jre6/' or 'apache-tomcat-5.5.28/common/classes/'.
    Thanks.

  • Naming convention for packages and classes

    Hi all,
    Is there any naming conventions for packages and classes which uses a design pattern ?. If yes what are the conventions used for business delegate,session facade, service locator,DAO and any other patterns.
    rgds
    Anto Paul

    Hi,
    that is a good question and one we have considered also. We dont yet cover the naming conventions for classes based on patterns but maybe will in the future. Currently, in the blueprints apps we tend to do some things like naminga class
    -AccountDAO etc for DAOs
    -For servicelocator we have a class called ServiceLocator viewable at https://adventurebuilder.dev.java.net/source/browse/adventurebuilder/ws/components/servicelocator/src/java/com/sun/j2ee/blueprints/servicelocator/web/ServiceLocator.java?rev=1.4&content-type=text/vnd.viewcvs-markup
    -for session facade, its a bit trickier since the name is so long and we cant add "SessionFacade" to the end of each facade class. I think in general we put "Facade" in the name, usually near the end
    -For Business Delegat, again it seems too long to add to each class name. So in the past we have added
    a "BD" to the names of the delegates. Some examples are at http://java.sun.com/blueprints/patterns/BusinessDelegate.html
    -For transfer objects we usually add a TO to the end of the name. Some examples at http://java.sun.com/blueprints/patterns/TransferObject.html
    Seems like something we could get a bit more consistent about.
    hope that helps,
    Sean

  • Objects and classes

    Hi All
    I am new to ABAP Objects and i feel lil difficult  to under the concept and classes..can any one please give me with small example to easily understand about the tole of objects and classes..
    Thanks and Regards,
    Arun joseph

    Hi arun,
    These are very simple concepts.There is no need to worry about it.
    Object is an instance of a class.Class is an abstract description of an object. Class is a set of instructions that is used to build an object.  Class represents  properties of an object.
    eg: Vehical, Car,Bird,Box,Student
    Object represents a properties of real time entity  like
    engine, color,marks, legs,height,width etc.
    The following links provide more information with examples.   
    Link:[http://help.sap.com/saphelp_nw70/helpdata/EN/c3/225b5c54f411d194a60000e8353423/frameset.htm]
    Link:[http://help.sap.com/saphelp_nw70/helpdata/EN/c3/225b5c54f411d194a60000e8353423/frameset.htm]
    if any more doubts, come to me with your doubts.
    if it useful, reward points.
    Thank you,
    Prasad G.V.K

Maybe you are looking for