Vector class can't be resolved

hi ,
plz i got the following error while running a J2ME
program
cannot resolve symbol
symbol : method add (java.lang.String)
location: class java.util.Vector
any ideas????

The name of the method is addElement(). A quick glance at the javadocs would have solved that problem in no time.
shmoove

Similar Messages

  • ORA-29534 error for Class can not be resolved

    HI,
    I am trying to load and resolve a third party jar file which has some JMS classes. But while using the loadjava utility,
    "loadjava -u scott/tiger@dbname -r -v -genmissing weblogic.jar"
    i get "ORA-29534: referenced object <Class Name> could not be resolved" error for most of the classes.
    This Jar file has around 15000 classes definitions and it takes almost a complete day to load and resolve it. Even after taking so much of time it is unable to resolve all the classes and give a runtime exception Class can not be resolved for some class.( i have created the oracle java stored procedure successfully)
    I need a help on this very urgently...
    Thanks in advance....
    Sachin

    Sachin,
    There are many possible causes for the error you are getting, for example:
    1. The DBMS_JAVA package is corrupt.
    (Have you previously successfully loaded JARs -- or even java classes -- into the database?)
    2. A java version mismatch.
    (What Oracle database version are you using, and what java version is your JAR file compatible with?)
    You say,
    Surely they are loaded but not resolvedIs this a question, or a statement? Have you verified that the classes are loaded and not resolved? I use the following query for this:
    select DBMS_LONGNAME(OBJECT_NAME), STATUS
      from USER_OBJECTS
    where OBJECT_TYPE like 'JAVA%'The value for the STATUS column should be 'VALID'.
    I'm only guessing, but you may find more information (regarding the error you are getting) in the Oracle log files. Have you checked them?
    Have you tried searching the MetaLink Web site?
    http://metalink.oracle.com
    (Search for "ORA-29516", perhaps.)
    Good Luck,
    Avi.

  • Vector class size limitation

    Hi guys,
    Does anyone know how big a Vector class can be?
    I'm planning to have a Vector object of size ~200,000 to 500,000 elements.
    I would really want to use the vector in my design and benefit from its sync feature. The only concern is how reliable it will be..
    Has anyone have an idea?
    Thanks!

    Shouldn't that response be qualified? Somethinglike,
    where your datastructure doesn't need to be thread
    safe, use an ArrayList? I thought that was theonly
    real reason to use ArrayList over Vector. Arethere
    other reasons? Anyhow, his answer to your questionis
    correct, afaik.If you need synchronization... use ArrayList and the
    Collections.synchronizedList() method. Vector has too
    many non-List methods.
    I still say that is wrong, if your data structure needs to be thread safe, then you should use the synchronize on it where ever you use it.
    Is this code thread safe?
    Vector memberVector = new Vector();
    public void addToVector(Object c, Class cType ) {
    memberVector.add( c );
    memberVector.add(cType);
    }This should produce a vector with alternating objects and then a class that is associated with that object. However, will this code always work?
    The answer is no, even though the vector is 'thread safe' this operation is not. If 2 threads call this function on the same instance of the object, then you can get a situation where 2 objects appear in the list one after another. or 2 classes, it really depends on the thread task scheduler. The only difference between this and an ArrayList is that if you had used an ArrayList the internal structure might get messed up and you might get only one of the objects, and 2 classes or some other combination.
    So the answer to this problem is this
    Vector memberVector = new Vector();
    public void addToVector(Object c, Class cType ) {
    synchronized ( memberVector ) {
    memberVector.add( c );
    memberVector.add(cType);
    }You must sync on the member vector, but in this case, syncing on 'this' would work as well assuming that you used data encapsulation.
    I can't 'prove' it, but if you use proper syncing, then Vector, or any 'thread safe' data structure is no better then a non-thread safe version. It may be that it's easier to debug (sometimes) when dealing with vectors, since no elements will accidently be overwritten ,etc. But it's still unsafe.

  • Where is the Vector class? Can't use it.

    Hello!
    I've downloaded Flex Builder 3 Trial from Adobe's website.
    Now I want to use the Vector class, but this code for example:
      var v:Vector.<String>;
      v = new Vector.<String>();
    Gives me this error:
    1046: Type was not found or was not a compile-time constant: Vector.
    At the IDE, going to
      Window -> Preferences -> Flex -> Installed Flex SDKs
    I can see that I have Flex 3.2 SDK.
    Even more than that: When I search for "Vector" in the help ("Adobe® Flex™ 3 Language Reference") I can see all the details about Vector.
    What can I do?
    I'd like to avoid installing any newer SDKs due to all the bugs I see listed here in the forums.
    Thank you!

    It looks like you are trying to type Java code in Flex Builder.  Flex applications are generally built using ActionScript.
    These docs might help you learn ActionScript:
    http://www.flexafterdark.com/docs/ActionScript-Language
    http://www.flexafterdark.com/docs/ActionScript-vs-Java
    I hope that helps...
    Ben Edwards

  • How can I extend the Vector class?

    Hi All,
    I'm trying to extend the Vector class so I can get add a .remove(item:T) method to the class.  I've tried this:
    public class VectorCollection extends Vector.<T>
    That gives me the compile error "1017: The definition of base class Vector was not found"
    So then I tried:
    public class VectorCollection extends Vector
    Which gives me the compile error "1016: Base class is final."
    There must be some way to extend the Vector class, though, as on the Vector's official docs page it says:
    Note: To override this method in a subclass of Vector, use ...args for the parameters, as this example shows:
         public override function splice(...args) {
           // your statements here
    So there must be a way to extend the Vector class.  What am I doing wrong?

    No. AS3 doesn't currently have full support for generic types; Vector.<T> was added in an ad-hoc ("ad-hack"?) way. We are considering adding full support in a future version of ActionScript.
    Gordon Smith
    Adobe Flex SDK Team

  • Can someone explain to me Vector Class !!

    Can someone explain to me, or tell me where I can find a good tutorial about Vector class.....in simple terms....any good simple, easy to understand tutorials???
    Thank you.
    Rod

    Start with this:
    http://java.sun.com/j2se/1.4/docs/api/java/util/Vector.html
    Essentially, a vector is a single Java object that allows you to store a group of similar things. Each item, or element, inside the Vector must be of the same type, or Java class. The important thing to remember about Vectors is that their size is not fixed. If you don't know how many items you need to store in advance, a Vector is a useful datastore, because you can simply add items into it without worrying about reaching the maximum size. The Vector object will grow itself as you add elements.
    The important methods are described in the above API. Read through it carefully.

  • Compiler says class can't be initialized

    ok, i know abstract classes can't be initialized, but i am extending my base class, but my complier says that "class ClassificationParser can't be initialized" but i am not initializing it. IF anyone can point out a problem, which i just can't see please do. Thank you..
    first is listed the base abstract class, second the extended class
    package cattlemanager.utilities.parsers;
    import java.util.Vector;
    import java.io.File;
    import java.io.IOException;
    * Title:        ClassificationParser
    * Copyright:    Copyright (c) 2001
    * Company:      None
    * @author Harold Smith III
    * @version 1.0
    public abstract class ClassificationParser
       * <p>This method returns the instance of a <code>Classification</code> objects
       * that the implementor can work with and use to there own extent. This allows
       * for the parser to read in all the file data, and insert it into the
       * <code>Classification</code> Objects that he or she wishes the user to
       * modify.</p>
       * <p><strong>Important</strong> - The <code>Vector</code> that is returned will
       *  contain a <code>Vector</code> of <code>Vector</code>'s that the implementor
       *  must work with. The reason for a <code>Vector</code> of <code>Vector</code>'s
       *  is the <code>Classification</code> data may contain several past <code>
       *  Classification</code> records.</p>
       * @return Vector the data vector.
      public Vector getData()
      { return vInternalClassificationDataObject;
       * <code>parse</code> is the default parsing mechanism for the read in data
       * that the user can integrate into there records. Using the <code>parse</code>
       * method, the implemented class will read in the specified <code>File</code>
       * and the <code>Classification</code> Objects will be initialized with tthe
       * read in data.
       * @param File the file to be parsed, should follow the specified format
       *  determined by the appropriate association.
       * @throws WrongFormatException if the file is not formatted to the standards
       *  the association has laid out.
       * @throws IOException if there is a file problem.
      public abstract void parse(File fName) throws WrongFormatException, IOException;
       * The internal <code>Vector</code> of objects that will be laid out as specified
       * in the <code>getData</code> method described within this class.
       * @see #getData
      protected Vector vInternalClassificationDataObject;
    package cattlemanager.utilities.parsers;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.DataInputStream;
    import java.io.IOException;
    import java.io.EOFException;
    import java.util.StringTokenizer;
    import java.util.Date;
    import java.util.GregorianCalendar;
    * Title:        HolsteinAssociationClassificationParser
    * Copyright:    Copyright (c) 2001
    * Company:      None
    * @author Harold Smith III
    * @version 1.0
    public class HolsteinAssociationClassificationParser extends ClassificationParser
      private HolsteinAssociationClassificationParser()
      { try
        { parse(new File("demo.ext"));
        catch (Exception e)
       * Doesn't work?!
      public static synchronized ClassificationParser createInstance()
      { return new HolsteinAssociationClassificationParser();
       * <code>parse</code> parses the <a href="www.holstein.com">Holstein
       *  Association</a> classification data as laid out in there <code>File</code>
       *  format. By using this parser, one can read in the records and access the
       *  data that they need.
       * @param File the name of the file to be parsed.
       * @throws WrongFormatException if the file is not properly formated
      private void parse(File fName) throws WrongFormatException, IOException
        try {
          // READ IN FILE
       * Creates an instance of a date for the format specified by the Holstein
       * Association
      private Date createDate(String time)
      { GregorianCalendar c = (GregorianCalendar) GregorianCalendar.getInstance();
        c.set(Integer.parseInt(time.substring(0,4)), Integer.parseInt(time.substring(4,6))-1, Integer.parseInt(time.substring(6,8)));
        return c.getTime();
    }

    ah stupid errors, i figured it out, i accidently created an instance in a class before i decided to change the class to abstract!

  • Some class that cannot be resolved to a type

    Hello, I?m trying to use the[b] itext API for PDF creating from Java.
    In order to do this you must include the package .jar in your classpath and import com.logawie.text.* in your java file. All this steps are obviusly, and work correctly, in JAVA, but i?m trying to develope a web application, using JSP.
    Usually when I try to import a package from a JAR file that are allocated in the C:\j2sdk1.4.2_12\lib directory it doesn?t work. I solved this problem with some classes including it directly to the src.zip file. But with the itext package it doesn?t work, I don?t know if my solution is too bad, but with another classes it works, but with the itext package it says that all classes references "cannot be resolved to a type".
    Anyone can help me? Thanks in advance.

    when i try to depooy it then error comes
    user cannot be resolved to a type
    can any body help me
    and tell me about classpath
    //UserData.java
    package user;
    public class UserData {
    String username;
    String email;
    int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    //GetName.jsp
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="SaveName.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    //NextPage.jsp
    <jsp:useBean id="user" class="user.UserData" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    //SaveName.jsp
    <jsp:useBean id="user" class="user.UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
     Continue<font face="Arial"> </font>
    </BODY>
    </HTML>

  • Regarding Vector classes in JSP

    Hello,
    Where we actually use the vector classes in jsp page.Is there any necessary to use Vector classes in jsp programs instead of database.Or is there any conditions like here we have use vector instead of DataBase.

    JSP pages are part of the "view" layer in the MVC design pattern.
    As such, it is advisable to seperate them from the model/control layer. For this reason, database code in a JSP page is undesirable.
    The controller normally queries the model, places the results into a collection/vector, makes them available to the jsp page. All the jsp page knows is that it gets the collection - nothing about where it came from or how the model is accessed.
    It is not NECESSARY to do so. You can easily put SQL statements, and scriptlets into your JSP pages. But keeping that stuff out makes for more easily understood and maintainable web applications.
    Cheers,
    evnafets

  • List v = new Vector() how can i write this ?

    List v = new Vector() how can i write this ?
    vector does not 'extends' List rather it 'implements' only ......so how can write this way ? ( polymorphism applies only for 'extends' ).

    my question in a simple way is :
    List some_list extends Vector
    No, List is an interface; Vector is a concrete class. Read the javadocs.
    Vector implements List
    >
    AND
    List some_list implements Vector
    are these two same in behaviour
    our  apart from theoretical differences ?thanks
    Interfaces don't have any implementation; they're pure method signatures. When a concrete class implements an interface, it makes a promise that says "I will provide implementations for exactly these methods. Any client can call a method from the interface and I will do something 'sensible' if I'm written correctly."
    From the point of view of static and dynamic types, there's no difference between interfaces and classes.
    C++ has interfaces, too - they're classes with all pure virtual methods. If you understand how C++ works, the concept shouldn't be hard.
    ArrayList is preferred precisely because it isn't synchronized by default. (You can always make it so using java.util.Collections if you wish later on.) If you don't need synchronization, why pay the performance penalty?

  • Need help about Vector class in java

    Hello,
    I have some questions about Vector class. Please see this short code:
    Vector v = new Vector();
    v.add(New Integer(5));
    Is this the only way to add int value into vector? Performance wise, is this slow? And are there any better and faster way to add/get int element fro vector?
    Thank you very much in advance.

    Normally (up to Java version 1.4), that's the only way you can add an int to a Vector. The thing is that Vector can only contain Objects, and an int is a primitive, not an object. So you have to wrap the int in an Integer object.
    However, Java 5 has a new feature, called autoboxing, which means that the compiler automatically wraps primitive values into objects, so that you can program it like this:
    Vector v = new Vector();
    v.add(5);Note, this will not make your program faster or more efficient, because the compiler translates this automatically to:
    Vector v = new Vector();
    v.add(new Integer(5));So in the end, the same bytecode will be produced. Autoboxing is just a feature to make life more convenient for the programmer.

  • Please, help .. return not working. string can not be resolved to a variabl

    Greetings..
    I am writing a Java code that encrypt a String using DES. After encryption, I want to return the String, but I get error that says: variable can not be resolved. Please, help me to find out what is the problem ?? Thanks in advance.
    Here is the code:
    import javax.crypto.*;
    import java.security.*;
    public class Client {
         public String DESEncrypt(String cardnum)
              try{
              //create cipher object for DES
              Cipher c=Cipher.getInstance("DES");
              // craete the symmetric key for DES
              KeyGenerator kg=KeyGenerator.getInstance("DES");
              Key key=kg.generateKey();
              // DO the ecryption steps then display the result
              c.init(Cipher.ENCRYPT_MODE, key);
              //Dofinal accepts byts only. Thats why we use getbytes method.
              byte[] cardNoBytes=cardnum.getBytes("UTF8");
              //get the encrypted bytes
              byte[] encryptedCardNoBytes=c.doFinal(cardNoBytes);
              //convert bytes to string
              String cardNoString=new String(encryptedCardNoBytes);
              } catch(Exception e){ System.out.print("Error");
              return cardNoString;
         } //end the DESEncrypt method
    public static void main (String[] args) {
    try{
         Client cl=new Client();
         String x2=cl.DESEncrypt("123");
         System.out.println("The Encrypted text using DES is: " + x2+'\n');
    } catch(Exception e){ System.out.print("Error");
    }//end main
    }

    Next time, paste in the exact, complete error message and indicate clearly exactly which line is causing it.
    Your problem is that you declare cardNoString inside the try block, but you try to return it outside. Local variables only exist in the narrowest block in which they're declared. Once you exit try, that variable does not exist.
    You also have a logical problem. If an error occurs, you're just printing out :"Error", but you're not actually handling it. You're going on as if everything is fine. Catching an exception doesn't fix the error. If you can't fix it, don't catch it.
    What do you think your method will return if an exception occurs before you set cardNoString? What do you think it will do to the caller to have some arbitrary, meaningless value returned when he thinks everything went fine and he got a valid result?

  • Vector class warning

    i am learning to use the vector class. i am getting this warning but the program still runs:
    warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector
    heres the code:
    int a=0;
    Vector i=new Vector();
    i.addElement(a);//this is the line causing the warning
    System.out.println(i.elementAt(0));why is the compiler returning this warning but still allowing the program to run?

    Getting back to the original quesiton......
    After you do some research on generics, try to get rid of all those warnings by implementing generics properly in your code. Its not hard once you correct a few such problems and see how its done.
    Although you don't have to correct them since they are only warnings, its good practice since seeing 100 generics warnings may hide other types of warnings you should really look into. Note you can't always get rid of the warnings since generics aren't backwardly compatable with certain java classes (such as ArrayList.toArray()?). To hide these warnings, put @suppressWarnings("unchecked") above the function you want to hide those warnings.
    suppressWarnings will only work for jdk 1.5 and later(?).
    By the way, your code has i.addElement(a) where a is an integer. You might want to read up on autoboxing since java converts this int to an Integer.
    Edited by: njb7ty on May 31, 2008 4:36 PM

  • HT201318 I upgraded my iCloud storage capacity for a higher tier and the device does not actually reflects said upgrade. How can this be resolved since my credit card was charged

    I upgraded my Icloud storage capacity to a higher tier and my Iphone does not reflect the change although my credit card was charged and the device is nor properly backup. How can this be resolved?

    It seems to take up to a couple of days for the upgrade to take hold, at least that's the experience of some users.  Give it 24 hours before contacting apple.
    For customer service issues, go here...
    https://expresslane.apple.com/Issues.action

  • Yosemite many troubling system log messages:  For example:  com.swarmcast.mlbnexdefautobahn ;main class can't be found, iTunes msgs, location msgs, audit warnings

    I'm receiving many concerning messages on my macbook pro: 
    MacBook Pro (Retina, Mid 2012)
    2.6 GHz Intel Core i7
    16 GB 1600 MHz DDR3
    NVIDIA GeForce GT 650M 1024 MB
    OS: Yosemite 10.10 (upgraded)
    These messages start logging and never stop...  452 messages in 11 minutes.  
    11/11/14 11:17:33.878 AM MLBNexDefAutobahn[421]: main class can't be found.
    11/11/14 11:17:23.680 AM com.apple.xpc.launchd[1]: (com.swarmcast.mlbnexdefautobahn) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
    11/11/14 11:17:28.586 AM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    11/11/14 11:17:28.809 AM locationd[58]: Couldn't find a requirement string for masquerading client /System/Library/PrivateFrameworks/Parsec.framework
    11/11/14 11:17:16.944 AM storeassetd[388]: multibyte ASN1 identifiers are  not supported.
    11/11/14 11:17:32.853 AM _nsurlstoraged[417]: audit warning: soft /var/audit
    11/11/14 11:17:32.853 AM _nsurlstoraged[418]: audit warning: allsoft
    11/11/14 11:17:32.854 AM _nsurlstoraged[419]: audit warning: closefile /var/audit/20141111181659.20141111181732
    11/11/14 11:17:34.221 AM com.apple.xpc.launchd[1]: (com.apple.imfoundation.IMRemoteURLConnectionAgent) The _DirtyJetsamMemoryLimit key is not available on this platform.
    11/11/14 11:17:36.032 AM locationd[58]: Location icon should now be in state 'Inactive'
    11/11/14 11:18:17.850 AM com.apple.usbmuxd[55]: LOCKDOWN_V2_BONJOUR_SERVICE_NAME is _apple-mobdev2._tcp,9336080d
    11/11/14 11:17:37.092 AM iTunes[332]: Entered:_AMMuxedDeviceDisconnected, mux-device:2
    11/11/14 11:17:37.092 AM iTunes[332]: Entered:__thr_AMMuxedDeviceDisconnected, mux-device:2
    11/11/14 11:17:37.092 AM iTunes[332]: tid:dc0f - Mux ID not found in mapping dictionary
    11/11/14 11:17:37.092 AM iTunes[332]: tid:dc0f - Can't handle disconnect with invalid ecid

    This cleared up the MLBNexDefAutobahn message...   not the rest however.
    Get This MLBAutobahnNexDef Whasit off my Activity Monitor
    1. Open your User folder.
    2. Go to Library folder ( might need to press down option key when select Go to find Library)> Application Support > Swarmcast
    3. Click UninstallAutobahn.command
    Wait and pray. Phew! Gone. It'll probably open your Unix terminal.
    [[EDIT: ACK! OSX Lion has hidden the Library folder. It's still there. TO find the User's Library folder in OSX, go to Finder and choose Go > Go to Folder... and type ~/Library in the box. ]]

Maybe you are looking for

  • Account error message

    Can anyone help please? My iTunes account info has apparantly changed - without my input? I have tried to amedn but the account page states that my postcode and country are incorrect - even though they are correclty entered. I have used iTunes effect

  • Serial invalid of Premiere

    Hello everyone. I bought a package with 2 DVD contains Photoshop elements 12 and Premiere elements 12 and has 4 serial numbers, supposedly you can install both MAC and WIN. I've only been able to install on MAC using 2 of these licenses, the other 2

  • Modifying variables of type XML at runtime.

    Greetings, Here is the situation I am facing. A workflow is triggered by an incoming XML event. After some processing, a portion of the xml document that triggered the event must be modified and the newly modified document is then dumped onto a JMS q

  • Outlook 2013 become black after intalling Windows Thecnical Preview

    Outlook 2013 become black after installing Windows Technical Preview. Outlook appears fully or partly black, and color comes back to normal where you point the cursor.

  • Redo log files

    How do i find the location of the redo log files in the database.