Struct equivalent for java array?

What's the struct (c++) equivalent in Java?
here's my im doing.
class Text
char character;
int freq;
public static void main(String[] args) throws IOException
BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
Text[] letter = new Text[2];
I want to assgined letter[0].character = 'a'; and letter[0].freq = '3' but it doesn't allow me to do that when I compile it?

I've trying doing:
for(i = 0; i < letter.length; i++)
               letter.character = new Text();
               letter[i].freq = new Text();
and even
for(i = 0; i < letter.length; i++)
               letter= new Text();
before doing
letter[0].character = 'a';
          letter[0].freq = '3'; but got an error:
non static varible this cannot be referenced from a static context

Similar Messages

  • Converting object wrapper type array into equivalent primary type array

    Hi All!
    My question is how to convert object wrapper type array into equivalent prime type array, e.g. Integer[] -> int[] or Float[] -> float[] etc.
    Is sound like a trivial task however the problem is that I do not know the type I work with. To understand what I mean, please read the following code -
    //Method signature
    Object createArray( Class clazz, String value ) throws Exception;
    //and usage should be as follows:
    Object arr = createArray( Integer.class, "2%%3%%4" );
    //"arr" will be passed as a parameter of a method again via reflection
    public void compute( Object... args ) {
        a = (int[])args[0];
    //or
    Object arr = createArray( Double.class, "2%%3%%4" );
    public void compute( Object... args ) {
        b = (double[])args[0];
    //and the method implementation -
    Object createArray( Class clazz, String value ) throws Exception {
         String[] split = value.split( "%%" );
         //create array, e.g. Integer[] or Double[] etc.
         Object[] o = (Object[])Array.newInstance( clazz, split.length );
         //fill the array with parsed values, on parse error exception will be thrown
         for (int i = 0; i < split.length; i++) {
              Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
              o[i] = meth.invoke( null, new Object[]{ split[i] });
         //here convert Object[] to Object of type int[] or double[] etc...
         /* and return that object*/
         //NB!!! I want to avoid the following code:
         if( o instanceof Integer[] ) {
              int[] ar = new int[o.length];
              for (int i = 0; i < o.length; i++) {
                   ar[i] = (Integer)o;
              return ar;
         } else if( o instanceof Double[] ) {
         //...repeat "else if" for all primary types... :(
         return null;
    Unfortunately I was unable to find any useful method in Java API (I work with 1.5).
    Did I make myself clear? :)
    Thanks in advance,
    Pavel Grigorenko

    I think I've found the answer myself ;-)
    Never thought I could use something like int.class or double.class,
    so the next statement holds int[] q = (int[])Array.newInstance( int.class, 2 );
    and the easy solution is the following -
    Object primeArray = Array.newInstance( token.getPrimeClass(), split.length );
    for (int j = 0; j < split.length; j++) {
         Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
         Object val = meth.invoke( null, new Object[]{ split[j] });
         Array.set( primeArray, j, val );
    }where "token.getPrimeClass()" return appropriate Class, i.e. int.class, float.class etc.

  • Can we define a complex type that is equivalent to java.util.List?

    hi everyone
    is it possible to define a complexType that is equivalent to java.util.List? all i know now is how to define an array of some type using either <xs:list> for simpleType or the minOccurs and maxOccurs of the element tag. i was wondering if there is way to define something equivalent to a List in java. thanks

    Define a sequence of list tems.
    <xs:element name="list">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="item"  maxOccurs="unbounded"  type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

  • Is there a logic:match equivalent for JSTL?

    In a search page I execute a query which returns an array of objects (All objects are of the same object type and are cast to Object[]) and each object has many attributes. I tried using <logic:iterate>, but I was never successful in having it display any results. I believe this had something to do with the entire array being passed via session scope instead of just one record and me not specifying it properly with <logic:iterate>. I was able to successfully use <c:forEach> and it worked right away. I stuck with using that because of its "just works" ability in addition to using a lot of other JSTL code. However, one of the attributes that is being printed out needs to be parsed and is of the form "Yxxx". <logic:match> covers this very nicely, but when I specify it in the below code it is not able to find my variable in any scope.
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match parameter='${myResults}' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>I have done several google searches, but I haven't found a JSTL equivalent for <logic:match>. If there is one could someone please tell me what it is? In addition, although <logic:match> is great I still need to print out a substring of that attribute. Could someone tell me how to do that? If this is not possible could someone please tell me if its possible to use <logic:iterate> with an array of objects like I was attempting to do initially so that I could use <logic:match> at least?
    Thanks to all of you for your time.

    Yes you can use the logic:iterate tag. I think you have to specify the type of the exposed variable though. I prefer the forEach loop.
    I think you are using the wrong attribute in the logic:match tag. You should be using the "name" attribute rather than "parameter"
    Parameter attribute refers you to a request parameter, and I pretty sure you don't want that.
    So given the collection of objects in the session attribute "result"
    This should loop through them all, and see if they start with the letter 'Y'
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match name='myResults' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>As for the latter bit, are you using a JSP2 container and JSTL1.1? It would appear so seeing as you are trying to use EL expressions in the logic:match tag.
    If so, you could make use of the JSTL function library:
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
       <c:if test='${fn:startsWith(myResults.pin, "Y")}'>
          <c:out value="${fn:substring(myResults.pin, 1, -1)}"/>
        </c:if>
    </c:forEach>And I've just spotted a very cool function in there: substringAfter
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
          <c:out value='${fn:substringAfter(myResults.pin, 'Y')}'/>
    </c:forEach>Cheers,
    evnafets

  • Using a ariable for an array name

    I am currently working on the search method for my project.Which is to use breadth first search, to find the goal state of a problem.I am storing each new state encountered in a queue called states, and using an array for each state. So states would be a queue of arrays.
    I was hoping to name each new state in order so state1 state2 state3 and so on. So for instance state1 would be an array containing the original board.
    The problem I am having is declaring a new array for each new state. I was hoping to use a variable i to keep count of the number of states, so that when I declare a new array I could use something like
    String[][] statei = original board array
    So if i = 1 then state1 would contain a copy of the original array.
    However I cannot seem to get java to recognise that i is a variable and not part of the name for the array.
    Is there any way to let java know that I�m using i to represent a variable. Do I need to but i in quotation marks or something similar?
    Thanks for any help

    sorry i wasnt clear enough, what i have is an initial array called boards. Now every time i move a value in boards i need to create a new array. So for instance
    i = no of states
    new String [][] statei = a copy of boards[] with the affects of making the move
    example if i was moving the value of boards[x][y] to boards[x][y+1]
    i would need statei to be an array containg the change to the array above

  • Mapping Java Arrays

    I was given an object model generated by an apache product, Axis. The generated java files use the Java Array in the following fashion:
    Class Zoo {
    private ArrayOfAnimals animals;
    // … public get/set methods cut
    Class ArrayOfAnimals {
    private Animal animals[];
    // … public get/set methods cut
    Class Animal {
    private String name;
    // … public get/set methods cut
    I was tasked with mapping the one-to-many relationship between zoo and an array of animals using the Animal array. I can’t find a mapping in TopLink to do this type of association. I am NOT allowed to modify the generated source code. I may be able to extend the generated classes, and perhaps provide a different superclass.
    I am allowed to create the relational model for these domain classes. Can anyone help with this type of mapping?
    Thanks

    TopLink does not directly support arrays as the mapping type for a collection, only collection types that support the Collection and Map interfaces.
    In general it seems odd to use an array instead of a Java collection which would be much more efficient (in terms of adding and removing) and much more functional. I would definitely suggest changing the generated code, or the way the code is generated if at all possible.
    The easiest way to map the array in TopLink would be the use get/set methods for the 1-m mapping on the Zoo class that converted the array to/from a Collection.
    i.e. something like,
    public List getAnimalsList() {
    return new Arrays.asList(animals.animals);
    public void setAnimalsList(List list) {
    animals.animals = (Animal[]) list.toArray();
    In general TopLink uses its ContainerPolicy class to handle collections. It may also be possible (but advanced) to write a custom container policy for your 1-m mapping that handles arrays.

  • [JNI Beginner] GC of Java arrays returned by the native code

    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
        (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
        return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?
    - if it's no more referenced (the example Java code just systemouts it and forgets it), will it be eligible to GC?
    - if it is referenced by a Java variable (in my case, I plan to keep a reference to several replies as the business logic requires to analyze several of them together), do regular Java language GC rules apply, and prevent eligibility of the array to GC as long as it's referenced?
    That may sound obvious, but what mixes me up is that the same tutorial describes memory issues in subsequent chapters: spécifically, the section on "passing arrays states that:
    [in the example] the array is returned to the calling Java language method, which in turn, garbage collects the reference to the array when it is no longer usedThis seems to answer "yes" to both my questions above :o) But it goes on:
    The array can be explicitly freed with the following call:
    {code} (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);{code}Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is +not+ returned as is to a Java method)?
    The tutorial's next section has a much-expected +memory issues+ paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, +unless the references are assigned, in the Java code, to a Java variable+, right?
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    I also checked the [JNI specification|http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp1242] , but this didn't clear the doubt completely:
    *Global and Local References*
    The JNI divides object references used by the native code into two categories: local and global references. Local references are valid for the duration of a native method call, and are automatically freed after the native method returns. Global references remain valid until they are explicitly freed.
    Objects are passed to native methods as local references. All Java objects returned by JNI functions are local references. The JNI allows the programmer to create global references from local references. JNI functions that expect Java objects accept both global and local references. A native method may return a local or global reference to the VM as its resultAgain I assume the intent is that Global references are meant for objects that have to survive across native calls, regardless of whether they are referenced by Java code. But what worries me is that combining both sentences end up in +All Java objects returned by JNI functions are local references (...) and are automatically freed after the native method returns.+.
    Could you clarify how to make sure that my Java byte arrays, be they allocated in C code, behave consistently with a Java array allocated in Java code (I'm familiar already with GC of "regular" Java objects)?
    Thanks in advance, and best regards,
    J.

    jduprez wrote:
    Hello all,
    I am beginning with JNI, to integrate a C library that pilots an industrial equipment, into a java UI. This library enables to exchange various proprietary PDUs (protocol data units), with the equipment, up and down (request/replies). Both requests and replies are arrays of bytes (+char*+).
    "Request" byte arrays are constructed by Java code, which passes them to the JNI code that glues with the lib. "Reply" byte arrays are returned to the Java code, which analyzes them.
    The "return reply" part is very similar to this [tutorial example|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html] , which returns bytes read from a file. However there's something I don't understand with regard to garbage collection of the returned byte array:
    - in this stock example, the C code creates a Java byte array fills it, and simply returns it (example code stripped to highlight only the parts relevant to my question):
        jByteArray=(*env)->NewByteArray(env, size);
    (*env)->SetByteArrayRegion(env, jByteArray, 0, size, (jbyte *)sourceBytes);
    return (jByteArray);What will happen to this Java array (jByteArray) with regard to garbage collection?It will be collected when it is no longer referenced.
    The fact that you created it in jni doesn't change that.
    The array can be explicitly freed with the following call:
    (*env)-> ReleaseByteArrayElements(env, jByteArray, (jbyte *)sourceBytes, 0);Under what circumstances would one need to explicitly free jByteArray when it's about to be returned to the Java calling method? Or does this sentence apply to completely different situations (such as, when the array is not returned as is to a Java method)?
    Per what the tutorial says it is either poorly worded or just wrong.
    An array which has been properly initialized it a just a java object. Thus it can be freed like any other object.
    Per your original question that does not concern you because you return it.
    In terms of why you need to explicitly free local references.
    [http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp16785]
    The tutorial's next section has a much-expected memory issues paragraph, from which I quote:
    By default, JNI uses local references when creating objects inside a native method. This means when the method returns, the references are eligible to be garbage collected.I assume this means, unless the references are assigned, in the Java code, to a Java variable, right?As stated it is not precise.
    The created objects are tracked by the VM. When they are eligible to be collected they are.
    If you create a local reference and do NOTHING that creates an active reference elsewhere then when the executing thread returns to the VM then the local references are eligible to be collected.
    >
    If you want an object to persist across native method calls, use a global reference instead. A global reference is created from a local reference by calling NewGlobalReference on the the local reference.That is not precise. The scope is the executing thread. You can pass a local reference to another method without problem.
    I assume this enables the C code to maintain a global reference to a java object even if it's not referenced anymore from the Java variables, right?
    It enables access to it to be insured across multiple threads in terms of execution scope. Normally you should not use them.

  • How to call a C sort function to sort a Java Array.

    My name is David, I'm interning this summer doing some High Performance Computing work. I'm significantly out of my comfort zone here; I am primarily a network/network security geek, not a programming guy. I took one Java based class called problem solving with programming where we wrote like 3 programs in Java and did everything else in pseudocode and using a program called Alice http://www.alice.org/ to do things graphically. Learned basically no actual programming syntax. Also have done some self-taught perl, but only through one book and I didn't finish it, I only got about half way through it. So my expertise in programming are pretty much null.
    That being said, I currently am tasked with having to figure out how to make JNI work... specifically at this time I am tasked with writing an array in Java, and designing a C program that can be called by means of JNI to sort the array. I have chosen to work with the Merge Sort algorithm. My method of coding is not one where I write the entire thing from scratch, I don't particularly have a need to master languages at this point, rather I just need to make them work. I am interested in learning, but time is of the essence for me right now. So thus far what I have done is take sample codes and tweak them to meet my purpose. However, I currently am unable to make things work. So I am asking for help.
    I am going to paste 3 codes here, the first one will be my basic self-written instructions for JNI (Hello World Instructions), the second one will be my Java Array, and the third one will be my MergeSort function. I am not asking for you to DO my work for me by telling me how to manipulate my code, but rather I am asking for you to send me in the direction of resources that will be of some aid to me. Links, books (preferrably e-books so I don't have to go to a library), anything that you can send my direction that may help will be deeply appreciated. Thanks so much!
    JNI Instructions:
    /*The process for calling a C function in Java is as follows:
    1)Write the Java Program name. Eg. HelloWorld.java
    2)Compile it: javac HelloWorld.java
    3)Create a header file: javah -jni HelloWorld
    4)Create a C program eg. HelloWorld.java
    5)Compile the C program creating a shared library eg. libhello.so (My specifc command is cc -m32 -I/usr/java/jdk1.7.0_05/include -I/usr/java/jdk1.7.0_05/include/linux -shared -o libhello.so -fPIC HelloWorld.c
    6) Copy the library to the java.library.path, or LD_LIBRARY_PATH (in my case I have set it to /usr/local/lib.
    7)Run ldconfig (/sbin/ldconfig)
    8)Run the java program: java HelloWorld. */
    //Writing the code:
    //For the HelloWorld program:
    //In java:
    //You need to name a class:
    class HelloWorld {
    //You then need to declare a native method:
    public native void displayHelloWorld();
    //You now need a static initializer:
    static {
    //Load the library:
    System.loadLibrary("hello");
    /*Main function to call the native method (call the C code)*/
    public static void main(String[] args) {
    new HelloWorld().displayHelloWorld();
    //In C:
    #include <jni.h> //JNI header
    #include "HelloWorld.h" //Header created by the javah -jni command parameter
    #include <stdio.h> //Standard input/output header for C.
    //Now we must use a portion of the code provided by the JNI header.
    JNIEXPORT void JNICALL
    Java_HelloWorld_displayHelloWorld(JNIENV *env, jobject obj)
    //Naming convention: Java_JavaProgramName_displayCProgramName
        printf("Hello World!\n");
        return;
    }Java Array:
    class JavaArray {
         private native int MergeSort(int[] arr);
         public static void main(String[] args)
             int arr[] = {7, 8, 6, 3, 1, 19, 20, 13, 27, 4};
         static
             System.loadLibrary("MergeSort");
    }Hacked and pieced together crappy C Merge Sort code:
    #include <jni.h>
    #include <stdio.h>
    #include "JavaArray.h"
    JNIEXPORT jint JNICALL
    Java_JavaArray_MergeSort(JNIEnv *env, jobject obj, jintArray arr[],jint low,jint mid,jint high)
       jint i,j,k,l,b[10];
    l=low;
    i=low;
    j=mid+1;
    while((l<=mid)&&(j<=high))
        if(arr[l]<=arr[j])
           b=arr[l];
    l++;
    else
    b[i]=arr[j];
    j++;
    i++;
    if(l>mid)
    for(k=j;k<=high;k++)
    b[i]=arr[k];
    i++;
    else
    for(k=l;k<=mid;k++)
    b[i]=arr[k];
    i++;
    for(k=low;k<=high;k++)
    arr[k]=b[k];
    void partition(jint arr[],jint low,jint high)
    jint mid;
    if(low<high)
    mid=(low+high)/2;
    partition(arr,low,mid);
    partition(arr,mid+1,high);
    sort(arr,low,mid,high);

    You're doing OK so far up to here:
    Java_JavaArray_MergeSort(JNIEnv *env, jobject obj, jintArray arr[],jint low,jint mid,jint high)This is not correct. It is not what was generated by javah. It would have generated this:
    Java_JavaArray_MergeSort(JNIEnv *env, jobject obj, jintArray arr,jint low,jint mid,jint high)A 'jintArray' is already an array, embedded in an object. You don't have an array of them.
    So you need to restore that, and the header file, the way 'javah' generated them, then adjust your code to call GetIntArrayElements() to get the elements out of 'arr' into a local int[] array, sort that, and then call ReleaseIntArrayElements() to put them back.

  • Manipulating java array object in an oracle procedure

    hi there,
    i have a java store procedure that returns an array of filenames, and i have an oracle stored procedure that will for each filename returned in the java array object, open that file do some processing and load the data into database tables, now my question is, would an oracle 9i varray object be compatible with a java array, or should i pass in a pl/sql table to store the filnames returned?
    i really am stuck at this point and need help !!!!
    Thanx

    Wole,
    Have you searched the code samples available at the Technet Web site? Could you not find a relevant one?
    Have you tried searching the Ask Tom Web site?
    Good Luck,
    Avi.

  • Equivalent of java.sql.ResultSetMetaData

    Hi,
    I'm looking for something which is equivalent to java.sql.ResultSetMetaData in Toplink. Does anyone know how this can be done ?
    Thanks,
    -Prashant

    Hi,
    I have a similar problem. I want to find out the column names when i fire raw-sql. I use SQLCall to do this.
    Then I get a Vector<DatabaseRow>.
    Vector vDR = session.executeQuery( new SQLCall( "select * from table_name" ) )
    Now Is there a way to find out the column names dynamically. In the javadocs i see that objDatabaseRow.keys() returns an Enum<DatabaseField>... but i cant see javadocs on how to use DatabaseField.
    So is there any other way ?
    Thanks,
    Krishna

  • In-Band Management configuration for f5100 array from T5440 on Solaris 10

    Hi All,
    I am trying to configure in-band management for storagetek array Sun Storage F5100 from T5440 server on Solaris 10.
    OS Installed on the server: Solaris 10 10/09
    Hardware : T5440
    Array : Sun Storage F5100
    Sun Storage F5100 have 20 FMODs which can see from format output. But In-Band management don't work, i want to manage it by CAM.
    /dev/rdsk/c2t0d0s2
    /dev/rdsk/c2t1d0s2
    /dev/rdsk/c2t2d0s2
    /dev/rdsk/c2t3d0s2
    /dev/rdsk/c2t4d0s2
    /dev/rdsk/c2t5d0s2
    /dev/rdsk/c2t6d0s2
    /dev/rdsk/c2t7d0s2
    /dev/rdsk/c2t8d0s2
    /dev/rdsk/c3t0d0s2
    /dev/rdsk/c3t1d0s2
    /dev/rdsk/c3t2d0s2
    /dev/rdsk/c3t3d0s2
    /dev/rdsk/c3t4d0s2
    /dev/rdsk/c3t5d0s2
    /dev/rdsk/c3t6d0s2
    /dev/rdsk/c3t7d0s2
    /dev/rdsk/c3t8d0s2
    Below are the packages i installed:
    host_sw_solaris_6.6.0.11
    SMagent-SOL-90.01.02.05.pkg
    SMruntime-SOL-90.60.02.01.pkg
    once after i installed the above packages i am getting below error
    SANtricity Storage Manager Agent, Version 90.01.02.05
    Built Wed May 06 06:21:07 CDT 2009
    Copyright 2009 Sun Microsystems Inc. All rights reserved. Use is subject to license agreement.
    Checking device /dev/rdsk/c0t2d0s2 : Skipping
    Checking device /dev/rdsk/c0t3d0s2 : Skipping
    Checking device /dev/rdsk/c2t0d0s2 : Skipping
    Checking device /dev/rdsk/c2t1d0s2 : Skipping
    Checking device /dev/rdsk/c2t2d0s2 : Skipping
    Checking device /dev/rdsk/c2t3d0s2 : Skipping
    Checking device /dev/rdsk/c2t4d0s2 : Skipping
    Checking device /dev/rdsk/c2t5d0s2 : Skipping
    Checking device /dev/rdsk/c2t6d0s2 : Skipping
    Checking device /dev/rdsk/c2t7d0s2 : Skipping
    Checking device /dev/rdsk/c2t8d0s2 : Skipping
    Checking device /dev/rdsk/c3t0d0s2 : Skipping
    Checking device /dev/rdsk/c3t1d0s2 : Skipping
    Checking device /dev/rdsk/c3t2d0s2 : Skipping
    Checking device /dev/rdsk/c3t3d0s2 : Skipping
    Checking device /dev/rdsk/c3t4d0s2 : Skipping
    Checking device /dev/rdsk/c3t5d0s2 : Skipping
    Checking device /dev/rdsk/c3t6d0s2 : Skipping
    Checking device /dev/rdsk/c3t7d0s2 : Skipping
    Checking device /dev/rdsk/c3t8d0s2 : Skipping
    The SMagent service attempted to start but terminated. Possible causes include: [1] The access volume is disabled in NVSRAM. [2] No controllers with compatible firmware were found. [3] The default logical unit number (LUN) assigned to the access volume (typically 7 or 31) is not in the range supported by the host or is already in use by the host for another device. See your storage management documentation for more details.
    Jul 23 13:56:47 sol10 SMagent: The SMagent service attempted to start but terminated. Possible causes include: [1] The access volume is disabled in NVSRAM. [2] No controllers with compatible firmware were found. [3] The default logical unit number (LUN) assigned to the access volume (typically 7 or 31) is not in the range supported by the host or is already in use by the host for another device. See your storage management documentation for more details.
    As per sun documentation i ran the below commands, but still i am getting above error.
    # setenv LD_LIBRARY_PATH /opt/SMgr/agent
    # java -classpath /opt/SMgr/agent/SMagent.jar devmgr.versioned.agent.DeviceIdentifier | grep "Volume Access"
    But any output with above commands.
    Any help would be really help ful.
    Thanks,
    gebilong

    Make sure the mapping to Access Group has not been deleted.
    Use the command /opt/SUNWsefms/bin/lsscs list -a array mappingYou must see samething like
    Volume:Access  LUN: 31mapped.via mapped.via.default.groupmapped.target.type mapped.via.default.group  Permission: Read Only
    ...If you don't see this recreate mapping
    /opt/SUNWsefms/bin/lsscs  map -a array -l 31 volume Accessand restart agent
    /etc/init.d/SMagent start

  • In-Band Management configuration for 2530 array from T5120 on Solaris 10

    Hi All,
    I am trying to configure in-band management for storagetek array 2530 from T5120 server on Solaris 10. I could able to connect the array from CAM software and it is showing as out-of-band. I can able to change the array name and IP address also. But when i try to configure In-Band Management i am having problems.
    OS Installed on the server: Solaris 10 5/08
    Hardware : T5120
    Array : Storage Tek 2530
    Below are the packages i installed:
    SMagent-SOL-90[1].00.00.06.pkg
    SMruntime-SOL-10[1].10.02.00.pkg
    once after i installed the above packages i am getting below error
    "SANtricity Storage Array Host Agent, Version 90.00.00.06
    Built Wed May 23 09:02:26 CDT 2007
    Copyright (C) 1999-2007 LSI Logic Corporation. All rights reserved.
    Checking device /dev/rdsk/c1t0d0s2 : Skipping
    The SMagent service attempted to start but terminated. Possible causes include: [1] The access volume is disabled in NVSRAM. [2] No controllers with compatible firmware were found. [3] The default logical unit number (LUN) assigned to the access volume (typically 7 or 31) is not in the range supported by the host or is already in use by the host for another device. See your storage management documentation for more details.
    The Host Context Agent did NOT start because 0 controllers were found.
    Oct 9 19:51:10 proto-hd1 SMagent: The SMagent service attempted to start but terminated. Possible causes include: [1] The access volume is disabled in NVSRAM. [2] No controllers with compatible firmware were found. [3] The default logical unit number (LUN) assigned to the access volume (typically 7 or 31) is not in the range supported by the host or is already in use by the host for another device. See your storage management documentation for more details.
    Oct 9 19:51:10 proto-hd1 SMagent: The Host Context Agent did NOT start because 0 controllers were found."
    As per sun documentation i ran the below commands, but still i am getting above error.
    # setenv LD_LIBRARY_PATH /opt/SMgr/agent
    # java -classpath /opt/SMgr/agent/SMagent.jar devmgr.versioned.agent.DeviceIdentifier | grep "Volume Access"
    Any help would be really help ful.
    Thanks,
    Raja

    Make sure the mapping to Access Group has not been deleted.
    Use the command /opt/SUNWsefms/bin/lsscs list -a array mappingYou must see samething like
    Volume:Access  LUN: 31mapped.via mapped.via.default.groupmapped.target.type mapped.via.default.group  Permission: Read Only
    ...If you don't see this recreate mapping
    /opt/SUNWsefms/bin/lsscs  map -a array -l 31 volume Accessand restart agent
    /etc/init.d/SMagent start

  • Aspose.Excel for Java Plan before End of June, 2005

    Now we are working on Aspose.Excel for Java. It�s a Java equivalent of Aspose.Excel. The first version will be released at the end of June which will include the following feature list:
    1. Edit cells� data
    2. Style settings
    3. Manipulate worksheets
    4. Protect/Unprotect a worksheet
    5. Access rows and columns
    6. Excel file options settings
    7. Hyperlinks
    8. Freeze panes
    9. Page Setup
    10. Pagebreaks
    11. Data formats
    12. Formula
    13. Import/Export JDBC data abstractions
    14. Keep pictures, charts,drawing objects in template file
    15. Keep VBA/Macro in template file
    16. Keep Pivot Table/Chart in template file

    Sorry but you have the wrong forum.
    ka

  • Best Tips for Java Beginners?

    Hello all,
    I study at Open United kingdom (Information Technology), and started to study basics of Java.
    We use Netbeans, & I wanted to ask experts here what's the best way to develop myself at Java programming?
    "Practice, Practice, & Practice...", thats what the material says.. But I need some sources to guide me with simple Java programs to start to practice with...
    so please share any tip may be useful to Java beginners from your own experience.
    Thanks.

    Tips for beginners that I have taught in the past and from me:
    0 - The debugger is your friend. Learn to use it, before you lean any more Java. REALLY!!!
    1 - Do NOT use the GUI development tool in your IDE, Code it yourself.
    2 - Read the Java Tutorials.
    3 - Java arrays begin with index 0.
    4 - Do NOT confuse leaning Java with learning to program. They are 2 distinct things.
    The language is a tool, but knowing how to program is a skill that will apply to many different tools.
    5 - There are more languages than Java, keep in mind each, including Java, were created for different tasks.
    6 - Develop your own style.
    7 - You are never done learning. NEVER.
    8 - Don't be afraid to modify your style, when you see something elegant, adopt it, make it part of your style.
    9 - If you're not having fun, you're doing the wrong thing.
    10 - Math is a major part of programming: you can never have too many Math skills.
    11 - Embrace the Java philosophy... write once, run anywhere a JVM exists.
    12 - Dumb code is actually better: don't get overly involved in optimizing your code--write it clean--Java will do the rest.
    13 - Learn to use your profiler, for when you really need to see if you can optimize. The problem is usually not where you think.
    14 - No matter how good you are, someone is always better and faster--when you encounter them, learn from what they do and use the good parts.
    15 - 800 lines of buggy code is not as good as 50 lines of clean, well designed code.
    16 - Your teacher is not always right, but they give you the grades.
    17 - Your boss may be an idiot, but he had the good sense, or lapse there of, to offer you a job and you accepted. He's your boss now, act like it, and help him look good--you'll go farther with a lot less stress. Also remember you future boss may want to contact him for a reference.

  • Java arrays contiguous in memory?

    are java arrays always contiguous in memory? or how does java save his arrays?
    i need to know because i wrote an algorithm with a lot of array length changing, and i wonder if it consumes a lot or not, maybe java uses virtual memory arrays like those here :
    http://developers.sun.com/solaris/articles/virtual_memory_arrays.html
    any answer is welcome,
    Nck.

    The internal layout of objects (including arrays) is explicitly undefined by the JVM standard:
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/Overview.doc.html#16066
    So you can't assume that arrays are implemented in any particular way on any given JVM. But the Get<Type>ArrayElements JNI functions can give you a clue about it for the current JVM.
    But I don't really understand the background of the question. What do you mean by "a lot of array length changing"? Java arrays can't be resized, whether from bytecode or JNI.
    -slj-

Maybe you are looking for

  • IPhone to speaker-wire speakers.

    I'm not really a 'speaker guy' I know how to take two pieces of wire and plug my big speakers into the standard dvd surround sound player and all that. But I had a rather interesting idea today that I am sure someone else has thought of before. I hav

  • Wpeinit -unattend not working

    In SCCM 2007, I used the (Wpeinit –unattend:"C:\Unattend-PE.xml") method by modifying the Startnet.cmd in order to run a prestart command in my boot images (wim) but for some reason this is not working for me in SCCM 2012? The Unattend-PE.xml contain

  • Upload address centrally and link to customer or vendor if they share same

    Need to upload the address centrally and then this address number to be mapped to Customer, Vendor, & etc.  If they share the same address.  With this solution, that only one address is being referred by these multiple objects.

  • OLTP reporting does not end

    Hi ; I try to use CRM interactive reporting so I created an different BI client on CRM.On its logic , CRM client extracts data from BI client via virtual data provider (OLTP not OLAP). I found the function used on CRM from RSO2 so now I can debug it

  • I am new in Java

    javax.management.AttributeNotfoundException: idat com .sun.enterprise.adminconfig.BaseConfigMBean.getAttribute(BaseConfigMbean.java:1 84)at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.get....... I created a new project with no errors and ran it. it g