Deprecated Methods and NoClassDefFoundError

Hi,
I wonder if using deprecated methods in a Java program could cause java.lang.NoClassDefFoundError?
I have a Java program with a few deprecated methods. The program worked well when I last ran it about half a year ago. But it shows java.lang.NoClassDefFoundError (Exception in thread "main"
) every time I try to run it recently.
p/s: I use netBeans to run my program.

Hi,
I wonder if using deprecated methods in a Java
program could cause java.lang.NoClassDefFoundError?
I have a Java program with a few deprecated methods.
The program worked well when I last ran it about half
a year ago. But it shows
java.lang.NoClassDefFoundError (Exception in thread
"main"
) every time I try to run it recently.
p/s: I use netBeans to run my program.Hi,
No, the problems seems to be your classpath, and not the fact that you are using deprecated methods.
Kaj

Similar Messages

  • Removing deprecated methods from legacy source?

    What does one do about deprecated methods in legacy code?
    As new versions of the compiler seem to keep supporting the deprecated methods (just offering warnings), there is no reason to invest the resources to update the source? I don't mean methods such as:
    java.lang.Thread stop(),
    I am thinking of methods such as:
    java.awt.Window show();
    Will there ever be tangible consequences to not stopping using deprecated methods? Will code with deprecated methods eventually break?
    Edited by: dpxqb on May 7, 2010 9:50 PM

    There's often an "if it ain't broke, don't fix it" mentality around deprecated methods and classes. Whether that's appropriate or not depends on the individual case. Any deprecated method/class may be removed in any future release, but you have to balance the risk of that happening against the cost of replacing it. Some methods/classes will probably never go away--like Vector, for instance. So there's not much benefit to doing a search/replace on a large codebase.
    It depends on your analysis of the various risks and rewards in your particular situation.

  • FInding the Replacements for deprecated methods

    I am new to using the Java environment, having been mostly a VB/VB .NET and web developer...so please forgive me if this is a dumb question:
    I inherited some java code that is an extension to a 3rd party app. It was originally written under JDK 1.2.2 (I think), and I am now trying to recompile under JDK 1.4.2, using the Borland JBuilder X IDE.
    Everything seems to be OK, except that I get two warning messages about deprecated methods:
    getFormComponent().setFormProperties()
    getFormComponent().getAllFormProperties()
    I probably should have checked more, but these names would appear to be standard java classes. What methods should I be using instead? And more importantly, how do I go about looking up the current methods?
    Thanks in advance.

    I was coming to that conclusion as well...unfortunately, the 3rd party SW vendor does not appear to have updated their supplied documentation - all of the code examples still use the deprecated methods, and their HTML help doesn't return anything when I search for the method names.
    Looks like a call to their technical support line...
    THANKS for the prompt reply.

  • Deprecated interfaces and methods

    We have a weblogic time service that utilize a lot of
    deprecated interfaces and methods such as
    ScheduledTriggerDef, TimeServicesDef etc. Although the time
    service runs in the WLS 7, it is a big concern to me
    that it uses so many deprecated interfaces or methods.
    I am just wondering how I can replace them with non-deprecated ones

    Mark,
    I have a question about the API.
    From the documentation and the API docs it is not clear how to schedule
    a callback to be called just once ASAP.
    We use the deprecated Timer service to execute long running operations
    on the Weblogic thread pool and want the operation to execute only once
    and start as soon as there is a thread available.
    It is not clear what will happen in case a task is scheduled to be
    executed only once and the time for that execution has passed ( 5 ms ago).
    I'd appreciate the clarification.
    Thanks,
    Dejan
    Mark Griffith wrote:
    It will run because it is only deprecated. You should at some point
    "rewrite", but the rewrite is not that big of a deal. There maybe some
    slight differences in timers, since we moved to jmx interfacs, but the
    scemantics should be very very close.
    Attached is an example that will run in the 8.1 sample environment.
    cd to $WLS_HOME
    (On my box it is /bea/wls81/weblogic81/)
    cd samples/domains/examples/
    setExamplesEnv.sh
    cd ../../server/examples/src/examples
    ../examples/src/examples 201$ pwd
    C:/bea/wls81/weblogic81/samples/server/examples/src/examples
    cp jmxTimerEar.zip .
    jar xvf jmxTimerEar.zip
    cd jmxTimerEar
    ant
    And it should build for you.
    Cheers
    mbg
    "Eric Sundberg" <[email protected]> wrote in message
    news:[email protected]..
    We have a weblogic time service that utilize a lot of
    deprecated interfaces and methods such as
    ScheduledTriggerDef, TimeServicesDef etc. Although the time
    service runs in the WLS 7, it is a big concern to me
    that it uses so many deprecated interfaces or methods.
    I am just wondering how I can replace them with non-deprecated ones

  • After changing deprecated methods in Thread Class

    I have changed the deprecated methods suspend() and stop() with JDK1.2.2 methods wait() and thread = null respectively. I wanted to know the affects after changing when I actually run the application.

    For one thing, "thread = null" won't stop the thread. In fact it will have no effect on the thread at all.

  • Deprecated Methods in CE 7.2

    Hi,
    What are the methods that got deprecated in CE 7.2 when compared to CE 7.1
    Regards
    V. Suresh Kumar

    Every Java API javadoc has a 'deprecated' list, and so have the NWCE 7.2 API's
    For NWCE 7.2 Web Dynpro, check http://help.sap.com/javadocs/nwce/current/wdr/com.sap.wdr/index.html and from the top select the 'deprecated' link.
    FYI, all API's can be accessed via http://help.sap.com/javadocs/
    Best regards,
    Robin

  • Deprecated methods in Interfaces

    Hi all,
    I'm implementing an interface containing some deprecated methods. These deprecated methods have to be implemented, of course. If I compile my implementation I get deprecation warnings for these implemented methods. Does anyone know how I can get rid of these warnings? I've added @deprecated flags to my implementation of these methods, but that didn't solve these warnings. I'm using JDK 1.3.1.
    Thanks
    Daniel.

    Technically it's a feature. :p
    but seriously, the whole deprecated thing is a feature, it's too bad that in this case you have to live with it, but there's no way around it.
    besides it doesn't matter if you call a depreciated method as it is still going to work. It just means that some point in the future it will not be supported. And judgeing by sun's past actions, I would say that it's more of a way to encourage people not to use old methods, but I don't think that they will ever remove the depreciated methods from the api.
    The only methods you have to watch out for are the few like those the Thread which are just not implemented at all. Like thread.destroy()

  • Deprecated methods in 10.1.3

    Many methods in 10.1.3 are marked as deprecated.
    For example, class oracle.toplink.publicinterface.Descriptor is replaced by ClassDescriptor and RelationalDescriptor where getQueryManager() is deprecated with no replacement method.
    Another example, in oracle.toplink.sessions.Session interface, method containsObjectInIdentityMap is deprecated and no replacement is specified.
    I understand those deprecated methods will probably be removed in the future TopLink release. My question is: will TopLink provide the functions currently implemented in those methods, i.e. replacement methods?
    Thanks.
    Haiwei

    Haiwei,
    Yes the work done in 10.1.3 to add formal support for non-relational mapping (Object-XML and EIS/JCA) did require some refactoring of the descriptor class. In the end the previous Descriptor class was deprecated in place of a new ClassDescriptor hierarchy. This work is backwards compatible but some of the deprecated methods were not properly Java Doc'd with their new replacement.
    getQueryManager() -> getDescriptorQueryManager() - New method on ClassDescriptor
    All of the cache access methods have been refactored into a new IdentityMapAccessor class. This is available from any session using getIdentityMapAccessor().
    Doug

  • How I make deprecated method in JB4

    Hi, i make deprecated method like this:
    * @deprecated
    public String fillCharsToLimit(String value, int limit, char chr, boolean fromFirst) {
    value = value.trim();
    if (value == null || (value.length() == 0 && limit <= 0))
    ;//do st
    (in project properties i enable Show deprecations)
    I except that compiler say me warning.
    Its ignore deprecation in my code, but when I use deprecated method from JDK all is OK, only my method no why?
    Thanks DK

    You don't get a deprecation warning if the deprecated class or method and the code that uses the deprecated class or method are compiled at the same time. See Bug 4216683 http://developer.java.sun.com/developer/bugParade/bugs/4216683.html for details.

  • File handling deprecated method - which one?

    I have this code, it should basically use the lines of text in a file and use them to construct nodes in a JTree. The compilation error is that the class uses a deprecated method - so does anybody know what method is the problem and what I should use?
    private void createNodes(DefaultMutableTreeNode top)
       DefaultMutableTreeNode anode = null; 
       File theFile = new File("categories.txt");
    try
    DataInputStream din1 = new DataInputStream(new FileInputStream(theFile));     
        //while (din1.available() !=0)
        while (true)
           String topic = din1.readLine().trim();
           //set the string as a tree node
           anode = new DefaultMutableTreeNode(topic);
           top.add(anode);
         din1.close();//close the file handle
         catch (Exception e)
              System.err.println("File input error");
    }//end of method

    If you compile with deprecation it will tell you specifically.
    I think it is:
    javac -deprecation ...
    The only method from below that I think it could be is readLine() in DataInputStream...
    If you are reading text...try:
    BufferedReader br = new BufferedReader(new FileReader(theFile));
    String topic;
    while ((topic=br.readLine())!=null)
        anode = new DefaultMutableTreeNode(topic);
        top.add(anode);
    br.close();

  • DocCheck comments on deprecated methods

    I am using the DocCheck utility to check the comments in my java packages, classes and methods. Methods that are deprecated have a @deprecated tag in the method comment, but DocCheck then complains about missing @params, etc. Is there any way that I can suppress the checking of deprecated methods?

    was just giving the way old doccheck tool a try - found it to be really useful
    and I ran into the problem mentioned here, I wished, doccheck wouldn't check deprecated methods ...
    so, what has happened to
    ericArmstrong wrote:
    I'll add it to the list of desired features, and give it
    a high priority.;-)
    Anyone still using doccheck? Are there any other tools, I mean, maybe doccheck will fail on some javadoc features introduced with Java 5 or 6 or ... 11 ;-)
    I like it! E.g., it gave me hints, to add @see in my getter and setter methods ... cool stuff!
    Merten

  • 1.4 deprecated methods

    Are there any methods that have been deprecated as of JDK 1.3 that have been removed in JDK 1.4 / 1.4.2? I can't find a list anywhere. Generally, do we need to worry about Sun completely removing deprecated methods?

    Woohoo! I wonder how long before the move to 1.5 happens.<thinks about how wonderful moving data structures
    consisting of 6 nested hashtables into generics will be/>
    *splort*
    Exactly! I've already thought about that. But, probably no worries--the contract has ended. What is supposed to be the last release is supposed to happen in a couple of days (once they fix a problem with a data file the subcontractor gave us). Our code to parse their text file (one time thing as part of a build) didn't have much error checking, so the error wasn't found until the testers tried to run something else. Then, the first person debugging it tried to find a latent bug in our code (spend a few days on it). They called me up today (I'm on another project now) to see if I could find anything, because the other guy was out for two days. As soon as I saw where the error occurred, I looked at the data files and quickly found that they were corrupted. Our code is still fragile, but if the data file is fixed, that should be sufficient (might as well keep this part fragile, especially if the contract is over--everything else in the code is fragile, too).

  • Deprecated methods/classes

    Does anyone know if, for the SUN Certified Web Component Developer exam, you are tested on the deprecated classes and methods e.g. HttpSession.putValue(), HttpSession.getValue() etc?

    No they are not in the test

  • Sum of the year digit method and declining balance method

    Hi,
    My Client want Deprecation methods Sum of the year digit and declining balance method for tax purpose. This requirement for Colombia Country.
    Which Deprecation Area I activate and how will configure above two methods.
    Regards
    Venki

    Sum-of-the-Years-Digits Method of Depreciation
    Use
    For each year of the expected useful life, the system notes the remaining useful life for the assets and totals the figures in each year. In each fiscal year, the remaining life is divided by this total in order to calculate the depreciation percentage rate for that fiscal year. This method leads to depreciation amounts that are reduced progressively by the same amount each period.
    Since the remaining useful life is no longer defined after the end of the planned useful life, this depreciation method does not allow for depreciation after the end of the planned life. However, you can change to another method after the expected useful life has expired.
    Acquisitions after the depreciation start year or post-capitalization will necessarily lead to a positive net book value at the end of planned life. For this reason, such transactions are not allowed when using the sum-of-the-years-digits method of depreciation. With this method, you have to handle subsequent acquisitions by creating sub-numbers. It is also a requirement that the acquisition year is the same as the depreciation start year.
    Calculation :
    Depreciation = APC * remaining useful life (current period) / total of remaining useful life (over entire useful life)
    APC: 1000
    useful life: 4
    Total remaining useful life: 10 (= 4 + 3 +2 +1)
    Depreciation 1st year = 1000 * 4 / 10 = 400
    Depreciation 2nd year = 1000 * 3 / 10 = 300
    Depreciation 3rd year = 1000 * 2 / 10 = 200
    Depreciation 4th year = 1000 * 1 / 10 = 100
    Declining-Balance Method of Depreciation
    Use
    For the declining-balance method of depreciation, the fixed asset is depreciated by a progressively falling rate. A constant percentage rate is calculated from the expected useful life and a given multiplication factor. This is multiplied with the falling net book value of the fixed asset. For mathematical reasons, the net book value will never reach zero using this method. You change over to straight-line or complete depreciation under these conditions:
    Declining-balance depreciation < straight-line depreciation
    Net book value < x percent of acquisition value
    Net book value < fixed amount
    Net book value < straight-line depreciation
    The changeover method is specified in the internal calculation key.
    Calculation :
    Depreciation = net book value * percentage rate from expected useful life and factor
    APC: 1000
    Exp. useful life: 10
    Net book value: 700
    Multiplication factor: 3
    Depreciation = 700 * (100% / 10 * 3) = 210
    OR You can use following link
    http://help.sap.com/saphelp_45b/helpdata/en/4f/71de3b448011d189f00000e81ddfac/frameset.htm
    http://help.sap.com/saphelp_45b/helpdata/en/4f/71de3b448011d189f00000e81ddfac/frameset.htm
    Regards,
    ANJIREDDY
    Edited by: ANJIREDDYA on May 8, 2010 12:09 PM
    Edited by: ANJIREDDYA on May 8, 2010 12:10 PM

  • How to create the custom method and make it available to clients:

    Hello, Can any one help me with this problem ASAP??
    I am trying to work on an example of "Customizing the Query and Creating an Associated Custom Method"
    from http://helponline.oracle.com/jdeveloper/help/topics/jdeveloper/developing_mvc_applications/adf_pviewcustommethod.html?tp=true#method. To do that, the first task is to create the custom method and make it available to clients.
    Following instructions in the helponline documentation, I completed the three steps: (1) "Specify a custom query for the View Object definition for EmployeesView", (2) "Add the custom method to the application module Java class", and (3) "Make the method available to clients".
    The following is the error message I got to test the application module. Can anyone tell me what the message really means and what I should do. I am wondering if there is any mistakes in the document.
    (oracle.jbo.SQLStmtException) JBO-27122: SQL error during statement preparation. Statement: SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.EMAIL, Employees.PHONE_NUMBER, Employees.HIRE_DATE, Employees.JOB_ID, Employees.SALARY, Employees.COMMISSION_PCT, Employees.MANAGER_ID, Employees.DEPARTMENT_ID FROM EMPLOYEES Employees WHERE Employees.SALARY > :1 and Employees.DEPARTMENT_ID = :2
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ORA-01008: not all variables bound

    You need to set values for the parameters in your query before you try to execute the query in the view object.
    So you need to call the setBindVars method before the query.

Maybe you are looking for

  • Encryption in Oracle 10g

    Can anyone tell me if Encryption is included in the Oracle 10g Enterprise license? Or would this be a separate license charge/fee for encryption be required?

  • Import contacts and calendar

    how do i import contacts and calendar from my iMac to my new iPhone 6?

  • HD or Logic Board? error code ata1/6/3 HD:2,0

    I've been having a problem with my PB Ti 500 where after running for a while, I'll get the beachball of death and my application, usually Safari or FireFox since I haven't been able to rely on the machine lately, hang. Other symptoms are the machine

  • Regarding Organization Model

    Dear Experts, Currently I'm working with CRM version 5. And the Org Model in SAP CRM use the SAP HR Org Model in R/3 and the replication is one way, i.e. from SAP R/3 to SAP CRM. Is it possible to create another organization unit in CRM if Org Model

  • 3.1 upgrade, no access for admin user

    We have been using ARD3 Admin on a single machine, controlling 10 clients, all 10.4.8. Ran software update and got ARD3.1. Now the admin user appears to have been relegated to a guest user with no admin abilities. All clients are managed by 10.4.8 se