Enum class

i have written the code like the below.
iam using Enum abstract class it is giving an error at class position.
plz help me how to use the Enum class in our own classes.
import java.io.*;
import java.lang.*;
public static final class MyBaseFrameworkEnum extends Enum {
}

Classes cannot extend enumerations.
public class MyClass {
public void myMethod(){
private enum MyEnum {
        SOMETHING1("something"),
        SOMETHING2("something"),
        SOMETHING3("something"),
        SOMETHING4("something"),
        private String fieldName;
        MyEnum(String fieldName){
            this.fieldName=fieldName;
        public String getFieldName() {
            return fieldName;
}or...
public enum MyEnum {
        SOMETHING1("something"),
        SOMETHING2("something"),
        SOMETHING3("something"),
        SOMETHING4("something"),
        private String fieldName;
        MyEnum(String fieldName){
            this.fieldName=fieldName;
        public String getFieldName() {
            return fieldName;
    }Anyway, fiddle around with it.

Similar Messages

  • Enum class not supported for switch() statement in 12.4 beta?

    Hi fellow 12.4 beta testers,
    It would appear "enum class" isn't supported for switch() statements in the 12.4 beta. This compiles fine under clang and g++. Will this be fixed for the final release? This currently causes compile errors for us, since __cplusplus >= 201103L evaluates to true, so our code uses "enum class" instead of plain "enum". It looks like the C++11 standard says it should be supported:
       Switching on enum class in C++ 0x - Stack Overflow
    Many thanks,
    Jonathan.
    $ cat test.cpp
    #include <iostream>
    enum class Ternary { KnownFalse = 0, KnownTrue = 1, Unknown = 2 };
    int main( void )
       Ternary foo;
       switch ( foo ) {
          case Ternary::KnownTrue:
          case Ternary::KnownFalse:
          case Ternary::Unknown:
             std::cout << "Success\n";
    $ clang++ -std=c++11 test.cpp
    $ g++ -std=c++11 test.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -std=c++11 test.cpp
    "test.cpp", line 8: Error: Cannot use Ternary to initialize integral type.
    "test.cpp", line 8: Error: Switch selection expression must be of an integral type.
    "test.cpp", line 9: Error: An integer constant expression is required for a case label.
    "test.cpp", line 10: Error: An integer constant expression is required for a case label.
    "test.cpp", line 11: Error: An integer constant expression is required for a case label.
    5 Error(s) detected.

    Thanks for reporting this problem! I have filed bug 18499900.
    BTW, according to the C++11 standard, the code is actually not valid. Section 6.4.2, switch statement, says an implicit conversion to an integral type is required, which is not the case for for a scoped enum (one using the "class enum" syntax). This limitation was raised in the C++ Committee as an issue to be fixed, and the C++14 standard makes the code valid.
    As a workaround, or to make the code conform to C++11, you can add casts to int for the enum variable and the enumerators.
    Message was edited by: Steve_Clamage

  • Adding toString() To an Enum Class

    I have a class like the following to create named constants (similar to enums in C++):
    public final class ColorConstant {   // final class!!
         private ColorConstant() {}         // private constructor!!
         public static final ColorConstant.RED = new HoldemConstant();
         public static final ColorConstant.BLUE = new HoldemConstant();
    //etc
    }Now, sometimes I have a handle to a ColorConstant object, and (for dubugging purposes) I want to know what it is. Problem is, If you just do "println(ColorConstant.RED)", for example, you get some garbage which is the string representatin of the object. Is there a way I can add a toString() method to the above class?
    Thanks for suggestions,
    John

    Now, sometimes I have a handle to a ColorConstant
    object, and (for dubugging purposes) I want to know
    what it is. Problem is, If you just do
    "println(ColorConstant.RED)", for example, you get
    some garbage which is the string representatin of the
    object. Is there a way I can add a toString() method
    to the above class?Of course. Just name the method:
    public String toString(), and have it return the appropriate string. If you want ColorConstant.RED to show "Red" for example though, you're going to have to add some state to your object, e.g. make the constructor take a String argument for the human-readable name ("Red"), and save that value as an object member.

  • Accessing enum members from enum Class literal

    I'm using enums to provide a configuration framework. They work well, but I've hit a problem. This may be a bad use-case or just end up as a limitation of the enum support.
    In a nutshell I want to return the enum container type from a method and allow clients to access the members of that enum directly. For example:
    interface Widget
      Class<?> getColours();
    class MyWidget implements Widget
      enum COLOUR { RED, GREEN, BLUE };
      public Class<COLOUR> getColours() { return COLOUR.class;}
    // client
    MyWidget w = new MyWidget();
    w.setColour( w.getColours().BLUE ); // compile error!Of course, this gives a compile error as getColours() returned a class literal which doesn't have the field BLUE. However it seems like there should be a way to do this as all the information is there (the class literal has the necessary type information and can see the type is an enum). I've see Class#getEnumConstants() but this defeats the point by using an id or key to the enum rather than the enum member. Perhaps something like Class#asEnum():
    COLOUR b = w.getColours().asEnum().BLUE;I currently solve this by using naming conventions. Each widget implementer is required (by the framework) to provide an enum with the name 'COLOUR' that provides the colours it supports. However I'd prefer to have this on the interface to remind implementers to expose these configuration options.
    One other workaround is to create a custom container that holds a reference to each enum field ... but its not pretty:
    class MyWidget implements Widget
      public static class COLOURS
        private static COLOURS instance = new COLOURS();
        private COLOURS() {}
        public COLOUR RED = COLOR.RED;
        public COLOUR BLUE = COLOR.BLUE;   
        public COLOUR GREE = COLOR.GREEN;
        enum COLOUR { RED, GREEN, BLUE };
      public COLOURS getColours() { return COLOURS.instance;}
    // client
    MyWidget w = new MyWidget();
    w.setColour( w.getColours().BLUE ); // OKHas anyone hit this before and found a better solution? Is there something I've missed? If not does this seem like a reasonable request for improvement?

    I suspect you're better off using the static values() or valueOf(String) methods on the enum you create.
    So you could do
    Colour c = Colour.valueOf("BLUE");or even
    Color particularColour = null;
    for(Colour c : Colour.values()) {
        if (c.isApplicable(someCriteria)) {
            particularColour = c;
            break;
    }assuming you created a method isApplicable in the Colour enum. All I'm trying to suggest in this latter example is that selection of an enum value might be better delegated to the enum than performed by the caller.

  • Passing general "enum" "class" "thing" :-(

    What I'm trying to do is pass a general enum to a method, like this:
    public void parseEnum(enum toParse)
         for(enum blah : enum.values())
              System.out.println(blah);
    }or whatever (don't care if the stuff inside the method works right now, just threw up an example). I can't do this. Why not? Is there some kind of way I can manage to do this?
    The problem is that I have a whole bunch of enums structured like this:
    enum ListOfElementIds
         ID_ONE( "ThingOne" ),
         ID_TWO( "ThingTwo" ),
         ETC( "ThingThreeOhNoes" ),
         AND_ETC( "ThingFourIsTooMany" );
         private String elementId;
         String getElementId()
              return elementId;
         ListOfElementIds( String elementId )
              this.elementId = elementId;
    }and I'd LIKE to, via a single method, cycle through each of the "values" (ID_ONE would be a value) of any enum I give as a parameter of the method.
    If I'm not explaining this well, please let me know how I can elaborate so as to make my problem as lucid as possible :-P
    (I'm a QA tester writing selenium tests and all the developers that I usually bug about this stuff are OoO :-( )

    import java.lang.reflect.*;
    enum ExampleEnum {HELLO, WORLD};
    public class EnumExample {
        public void iterate(Class<? extends Enum> cls) {
            try {
                Method m = cls.getMethod("values");
                Enum[] values = (Enum[]) m.invoke(null);
                for(Enum e : values) {
                    process(e);
            } catch (NoSuchMethodException exc) {
                exc.printStackTrace();
            } catch (IllegalAccessException exc) {
                exc.printStackTrace();
            } catch (InvocationTargetException exc) {
                exc.printStackTrace();
        public void process(Enum e) {
            System.out.println(e);
        public static void main(String[] args) {
            new EnumExample().iterate(ExampleEnum.class);
    }The values method is static.

  • Why use Java Enum as class attributes?

    From the sample entity code from ADF, I notice that an Enum class is used to contain all attributes of a class (as below). What are the benefits of using Enum here and not the traditional declaration {int EmpId, public int getEmpId(), public void setEmpId(int)} ; ? If this is a design pattern, what pattern is it? Thank you.
    public class EmployeeImpl extends EntityImpl {
    public enum AttributesEnum {
    EmpId {
    public Object get(UsersImpl obj) {
    return obj.getUserId();
    public void put(UsersImpl obj, Object value) {
    obj.setUserId((DBSequence)value);
    }

    I've used InstallAnywhere Now! to deploy basic apps to friends before. You can find it here:
    http://www.zerog.com/downloads_05.html
    It takes care of making your program executable on most operating systems. If you get any jvm errors when running the installer it creates for you then try packaging your program with a specific JVM. The size of your setup file will be a quite a bit larger, but if you're putting it on cd it shouldn't matter. I had a similar problem with InstallSheild when I tried it (maybe it was just me). Anyway, I decided to use this one because it was free and the program I used it for was written for a friend (that I didn't charge :-)
    Ryan

  • Generics usage with combined enum & interface class

    I would like to use an enum to store constants for a drop down list, and be able to reuse the structure in a generics method. What I have done is created a interface with basic functionality, and then created an Enum class that implements my interface. Now that I have a single class, I want to pass the resulting class to a static helper function that will have access to the interface functions, and still have the ability to use the benefits of the enum (foreach loops & access to enum constants).
    Is there a way to do this with Generics? I know that this is not right, but maybe it will give an idea of what I am trying to do: <? extends <Enum extends Menu_Interface>>.
    public interface Selection_List {
         public String getName();
         public void setName( String name );
         public String getValue();
         public void setValue( String value );
         public String getGroup();
         public void setGroup( String group );
         boolean isSelected();
    public enum Tool_Types implements Selection_List
         SAMPLE_ONE( "name1", "value1" ),
         SAMPLE_TWO( "name2", "value2" );
         // ... implementation of interface functions
    public class FormGenerator
         public static <T extends <Enum extends Selection_List>>
              String doCreateDropDown( T selectionList )
              //  ... implementation of function
    };

    You surely can. The following is an example on implementing Runnable:
    public class EnumWithInterface {
        enum Days implements Runnable {
         MON, TUE, WED, THU, FRI, SAT, SUN;
         @Override
         public void run() {
             System.out.println("Running " + this);
        static <E extends Enum<E> & Runnable> void runAll(Class<E> runnableEnum) {
         for (E e : runnableEnum.getEnumConstants()) {
             e.run();
        public static void main(String[] args) {
         runAll(Days.class);
    }

  • What's the best way to use an enum to validate statuses

    I am trying to write and use an enum to represent a status code and validate status code values. Ultimately the input data from another system and the database will be 1 or 2 i.e.the indexes and the java code will use the LIVE and CANCELLED when referring to the status. The code I have written
    public class TestEntityStatus {
         private static EntityStatusImpl es;
         public static void main(final String args[]){
                    es =  new EntityStatusImpl();  
                    es.setStatusCode("1"); // valid test
                    es.setStatusCode("3"); // invalid test
    }The EntityStatusImpl class:
    public class EntityStatusImpl {
        private String statusCode;
        public EntityStatusImpl() {
        public final String getStatusCode() {
            return statusCode;
        public final void setStatusCode(final String statusCode) {
             String allStsIndexesAsRegExpr = "[";                                                                                 //
                EntityStatus allStatuses [] = EntityStatus.values();                                                     // would like to 
                for(EntityStatus e : allStatuses)                                                                                // put this code
                    allStsIndexesAsRegExpr = allStsIndexesAsRegExpr + e.getStatusCode();   // in the enum
                allStsIndexesAsRegExpr = allStsIndexesAsRegExpr + "]";                                        // EntityStatus
                System.out.println(" allStsIndexesAsRegExpr = " + allStsIndexesAsRegExpr);           //
                 if (statusCode.matches(allStsIndexesAsRegExpr)) {
                     this.statusCode = statusCode;          
                 else {
                      throw new IllegalArgumentException("Entity status " + statusCode + " is invalid");     
    }The EntityStatus enum has a method "getAllIndexesAsRegex" which I would like to call. However, my understanding of enums is preventing me from doing so.
    If I declared an EntityStatus, I expected that I would be able to get all of the indexes back as follows in
    EntityStatus x;
    x.getAllIndexesAsRegex();
    Instead I have to copied the code from the enum into the setStatusCode method above, where it works but does not seem to be in the right place.
    public enum EntityStatus {
                     LIVE(1), CANCELLED(2);
                     private int index;
                 private EntityStatus(int index) {
                     this.index = index;
                  public int getStatusCode(){
                           return index; 
                  public String getAllIndexesAsRegex(){
                       String output = "[";
                       PromiseStatus allStatuses [] = PromiseStatus.values();
                       for(PromiseStatus p : allStatuses)
                            output = output + p.getStatusCode();
                       output = output + "]";
                       return output;
         }The java tutorial doesn't seem to throw much light on this type of application of enums for me, neither does Herbert Schilt's excellent book on Java 5.
    Can anyone spot any flaws in my logic or suggest better ways of achieving this?

    If you want to ensure type safety and retrict the user to a range of values it seems to me you are over complicating
    the implementation. Simply change your Impl class accessor and mutator methods to accept and return the enum
    type respectively. For example:
    private EntityStatus entityStatus;
    public EntityStatus getEntityStatus()
       return entityStatus;
    public void setEntityStatus(EntityStatus entityStatus)
      if (entityStatus == null)
        throw new IllegalArgumentException("Invalid entity status!");
      this.entityStatus = entityStatus;
    }The one downside is that you are retrieving the actual underlying enum values from external source systems which you need to map back to your
    enum types. Unfortunately the Enum class does not have a method that will return what you need (the valueOf method returns the enum type
    based on the enum name). However you can provide a method in your enum class that will map the external source values to the enum. Below is
    one such implemetation.
    import java.util.HashMap;
    import java.util.Map;
    public enum EntityStatus
      LIVE("1"),
      CANCELLED("2");
      private String statusCode;
      private static Map<String,EntityStatus> enumMap = new HashMap<String,EntityStatus>(EntityStatus.values().length);
      static
        enumMap.put(LIVE.getStatusCode(),LIVE);
        enumMap.put(CANCELLED.getStatusCode(),CANCELLED);
      private EntityStatus(String statusCode)
        this.statusCode = statusCode;
      public String getStatusCode()
        return statusCode;
      public static synchronized EntityStatus deriveObject(String statusCode)
        return enumMap.get(statusCode);
    }Below is a usage example:
      public static void main(String args[])
        EntityStatus status1 = EntityStatus.deriveObject("1");
        EntityStatus status2 = EntityStatus.deriveObject("2");
        EntityStatus status3 = EntityStatus.deriveObject("3");
        System.out.println(status1);
        System.out.println(status2);
        System.out.println(status3);
      }

  • Enum property editor not rendering

    I am trying to get a simple Enum property editor to work for my custom component but I keep getting an error: "Failed to load/render Property Editor"
    The component XML is:
    <input-parameter  hidden="false"  name="level" required="true" title="Log Level" type="org.apache.log4j.Level">
              <default-value>
            </default-value>
          <property-editor editor-id="com.adobe.idp.dsc.propertyeditor.system.Enum" />
      </input-parameter>
    <class-path>
          libs/log4j.jar
       </class-path>
    Log4j.jar is in the component package and in the component class path
    I have tried the com.adobe.idp.dsc.propertyeditor.system.Enum Class as described in the docs here: http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001419.html
    I also tried using com.adobe.idp.dsc.propertyeditor.system.EnumPropertyEditorComponent as described here: http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001379.html
    Both give the same error. I even tried using my own Enum class insteasd of org.apache.log4j.Level and referencing that, but still get the same error.
    Any ideas would be helpful - thanks
    (Adobe LiveCycle Workbench ES2
    Version: 9.0.0.1.20100511.1.236086)

    Ok after some playing about and changing random things, I seem to have figured it out.
    - org.apache.log4j.Level is not an Enum class, it is a collection of static vars.
    - I refactored my own Enum class to remove everything but the Enumeration values (no constructor, methods or construction parameters)
    - I used com.adobe.idp.dsc.propertyeditor.system.Enum and not com.adobe.idp.dsc.propertyeditor.system.EnumPropertyEditorComponent
    - I added my Enum class to the <export-packages> XML parameter
    Hope this helps someone else with the same issues

  • How to get class and use method on it

    Hi,
    class State {
            String name
            Enum expectedValue
            public State(String name,Enum expectedValue){
                this.name = name;
                this.expectedValue = expectedValue;
    In the same class I need to have a method that takes a String and it should return matching
    Enum value. Since  class already have the expectedValue my idea is to get the Enum class ( using that if possible) and
    the call get() on it see my example below;
    Example:
    expectedValue is HwState.UPGRADED;
        public HwState convertActualToStateType( String actual){
            return  HwState.get(Integer.valueOf(actual));
    How can I get the Enum class (HwState) ? And then use it e.g. HwState.get() ?
    //mike

    Oracle is not allowing to Pesonlize the Buttons.

  • The Best Way to Assign an Enum to the Corresponds value of a String?

    I am reading from and xml file configuration file. The data being returned is stored as a String and corresponds to a Enum value. My question is - What is the best way to assign the enum the value that corresponds to value of the string?
    public enum Names { BOB, FRED, JIM, SAM }
    String name = "FRED";   // This is the data retuned from the xml file.
    Names n =              // I want to assign n the value of Names.FREDI know I could do an "if" statement. However, this is a contrived example with only a few enum values. In the real world, this enum list could be quite large.
    I have looked into reflection, but I don't know whether there is an easier way to achieve my objective?
    Thank you for your time,
    Harold Clements

    dcminter wrote:
    But for looking up "how do I do X with a subclass of type Y", I think the API documentation should be able to answer that.I think I disagree when it's a language feature.That's definitely a point worth observing.
    By that reasoning you'd expect to populate the API docs with definitions for class (and this and super) all over the place.I think you're exaggerate, and you know it ;-)
    If those were to be mentioned in the JavaDoc, they should obviously go into the documentation of java.lang.Object only.
    I suppose you could have a "synthetics" section to the docs in much the same way that the inherited methods and fields are defined but it doesn't seem very useful.It's not useful if it's just clutter that's the same everywhere, of course.
    But in this particular case a simple "note that enum classes have a syntetic valueOf() method that does foo bar baz" in the body of the class documentation would have been a nice guesture (especially since that part is pretty small here anyway).
    And yes, I also think that the length field of arrays should find some mention in the JavaDoc. I don't know how and where, 'though.

  • Help with Switch statements using Enums?

    Hello, i need help with writing switch statements involving enums. Researched a lot but still cant find desired answer so going to ask here. Ok i'll cut story short.
    Im writing a calculator program. The main problem is writing code for controlling the engine of calculator which sequences of sum actions.
    I have enum class on itself. Atm i think thats ok. I have another class - the engine which does the work.
    I planned to have a switch statement which takes in parameter of a string n. This string n is received from the user interface when users press a button say; "1 + 2 = " which each time n should be "1", "+", "2" and "=" respectively.
    My algorithm would be as follows checking if its a operator(+) a case carry out adding etc.. each case producing its own task. ( I know i can do it with many simple if..else but that is bad programming technique hence im not going down that route) So here the problem arises - i cant get the switch to successfully complete its task... How about look at my code to understand it better.
    I have posted below all the relevant code i got so far, not including the swing codes because they are not needed here...
    ValidOperators v;
    public Calculator_Engine(ValidOperators v){
              stack = new Stack(20);
              //The creation of the stack...
              this.v = v;          
    public void main_Engine(String n){
           ValidOperators v = ValidOperators.numbers;
                    *vo = vo.valueOf(n);*
         switch(v){
         case Add: add();  break;
         case Sub: sub(); break;
         case Mul: Mul(); break;
         case Div: Div(); break;
         case Eq:sum = stack.sPop(); System.out.println("Sum= " + sum);
         default: double number = Integer.parseInt(n);
                       numberPressed(number);
                       break;
                      //default meaning its number so pass it to a method to do a job
    public enum ValidOperators {
         Add("+"), Sub("-"), Mul("X"), Div("/"),
         Eq("="), Numbers("?"); }
         Notes*
    It gives out error: "No enum const class ValidOperators.+" when i press button +.
    It has nothing to do with listeners as it highlighted the error is coming from the line:switch(v){
    I think i know where the problem is.. the line "vo = vo.valueOf(n);"
    This line gets the string and store the enum as that value instead of Add, Sub etc... So how would i solve the problem?
    But.. I dont know how to fix it. ANy help would be good
    Need more info please ask!
    Thanks in advance.

    demo:
    import java.util.*;
    public class EnumExample {
        enum E {
            STAR("*"), HASH("#");
            private String symbol;
            private static Map<String, E> map = new HashMap<String, E>();
            static {
                put(STAR);
                put(HASH);
            public String getSymbol() {
                return symbol;
            private E(String symbol) {
                this.symbol = symbol;
            private static void put(E e) {
                map.put(e.getSymbol(), e);
            public static E parse(String symbol) {
                return map.get(symbol);
        public static void main(String[] args) {
            System.out.println(E.valueOf("STAR")); //succeeds
            System.out.println(E.parse("*")); //succeeds
            System.out.println(E.parse("STAR")); //fails: null
            System.out.println(E.valueOf("*")); //fails: IllegalArgumentException
    }

  • Passing any enum type to a method

    Consider I have created some enums:
    public enum Day {
        SUN, MON, TUE, WED, THU, FRI, SAT
    public enum Month {
        JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
    }I want to create a method that will accept any type of enum and display all values. So the call would look something like:
    showAll(Day);
    showAll(Month);I'm not sure what to pass to the method. My understanding of Generics is rudimentary at best, despite reading the tutorial several times now. Here is some uncompilable code that might illustrate:
    public void showAll(EnumType enumType)  // <--- not sure what to pass here
      Enum[] allValues = enumType.values();
      // then, loop over the allValues array and I can proceed from here
    }The actual code is needed is for displaying a list of checkboxes to the user where the input is the enum class, and the checkboxes are every enum value.

    brucechapman wrote:
    You could use this signature
    <T extends Enum<T>> void showall(Class<T> clazz); Then use reflection to invoke the values() method which you know is there because only Class objects for enums can be passed in.I'll be honest, that signature looks very strange to me. However, I tried it anyway and it worked even without reflection.
    public class PassingEnums
      public enum Day {
        SUN, MON, TUE, WED, THU, FRI, SAT
      public enum Month {
        JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
      public <T extends Enum<T>> void showAll(Class<T> clazz)
        T[] types = clazz.getEnumConstants();
        for (int i = 0; i < types.length; i++)
          System.out.println(types.toString());
    public static void main(String[] args)
    PassingEnums test = new PassingEnums();
    test.showAll(Day.class);
    System.out.println("---");
    test.showAll(Month.class);
    }Or were you thinking of something else?
    I guess I'll have to hit the tutorials again, since that signature looks foreign to me.
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Enum in JSF 1.2_06 - EnumConverter Bug

    Hi,
    I have a Enum as such :
    public enum ComponentType {
         AJAX_SUPPORT { public String toString(){ return "Ajax Support";} },
         INPUT_TEXT { public String toString(){ return "Input Text";}},
         OUTPUT_TEXT { public String toString(){ return "Output Text";}},
         PANEL_GRID { public String toString(){ return "Panel Grid";}},
         PANEL_GROUP { public String toString(){ return "Panel Group";}},
         PANEL { public String toString(){ return "Panel";}},
         SELECT_ONE_MENU { public String toString(){ return "Select One Menu";}},
         SELECT_ITEM { public String toString(){ return "Select Item";}}
    }when i put the Enum Values in datatable as such :
    <h:dataTable var="component" value="#{bean.allComponentTypes}">
                             <h:column>
                             </h:column>
    </h:dataTable>
    i get an exception as follows :
    javax.faces.convert.ConverterException: j_id1:j_id3:0:j_id8: 'Ajax Support' must be convertible to an enum from the enum, but no enum class provided.
         at javax.faces.convert.EnumConverter.getAsString(EnumConverter.java:195)
         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:447)
         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:286)
         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:849)
         at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
         at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
         at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:825)
         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
         at com.sun.faces.renderkit.html_basic.TableRenderer.renderRow(TableRenderer.java:312)
         at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:133)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:825)
         at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
         at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
         at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:199)
         at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194)
         at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:825)
         at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
         at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:178)
         at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:126)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:825)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
         at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:825)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
         at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
         at com.bipt.tiva.interceptor.SessionFilter.doFilter(SessionFilter.java:45)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
         at org.springframework.webflow.executor.jsf.FlowSystemCleanupFilter.doFilterInternal(FlowSystemCleanupFilter.java:40)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:766)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:674)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)This was not a problem when i used JSF 1.1 MyFaces
    So what gives ?
    Any knowledge on this would be helpful..

    Ok ok i got the answer
    if i change my Enum into :
    public enum ComponentType {
         AJAX_SUPPORT("Ajax Support"),
         INPUT_TEXT ("Input Text"),
         OUTPUT_TEXT ("Output Text"),     
         private String text;
           ComponentType(String text) {
           this.text = text; }
           public String toString(){
                return text;
    }then it works......
    but i still don't see a reason why the first approach should fail.

  • JNI generated header file does not match the class file

    We have had a JNI project for many years and all has been fine. Within our libraries we have several classes that have inner enum classes.
    Recently we have moved to JDK1.7. Up to now when JNI generated the methods where the signature used the inner enum class, and it was an oveloaded method, we would get something like the following as the signature:
    Java_PackageName_ClassName_methodName_OuterClass_00024InnerEnum_2
    And the class file result of the build would look like the following:
    methodName(OuterClass$InnerEnum)
    Since we have moved to JDK 1.7 the header file looks like the following:
    Java_PackageName_ClassName_methodName_OuterClasss_InnerEnum_2
    The class file is still the same, and because of that when we run the program we get an UnsatisfiedLinkError. I understand that this error is because the VM cannot find the implementation. So why JDK 1.7 generates a header file that does not match the class file?
    Thank you in advance.

    I don't have 1.6 to verify but your statements about what is generated for 1.7 for the header appear correct.
    The 000024 represents the '$' and for 1.7 the inner class is still named using '$'. So for example after compiling in 1.7 the inner class file is named the following...
    MyClass$InnerEnum.class
    So a one to one conversion should have kept the 000024 (presuming it does in fact do it that way in 1.6.)
    You might want to look at the release notes for 1.7.
    If you need a solution you could add a post javah step that renames the file.

Maybe you are looking for

  • How to connect my  AirPort Express to the DSL

    Hi, I bought my AirPort in Finland and go with it to home. In home I have DSL connection. When I try to connect it to the internet, it says that my internet modem not connected or broken, but with my first router it works. Help me please. Thanks for

  • Live 1.2km of xchange: 1.367Kps down/Was: 2.5Kps- ...

    1.2Kilometres from the exvhange and I now get 1.367Kps- downstream, it was never near it's full potential of 20meg+ADSL2+ speed, or even the ADSL 8meg service. For a long time I was the reciepent of a 2.5meg service. I would like to think that I know

  • DVD remote controls work differently on a Mac?

    I created an SD DVD in DVD Studio Pro 4, and when I tested it on a standard TV DVD player, the remote controls work just as they should. But, when I play it on a Mac computer using a remote, it doesn't work the same. For example, if I have a video tr

  • ALE error in BD64

    hi, IAm getting error message 'sender & reciever should  be different' in BD64 when i  create MODEL VIEW. There is one logical system erp800 which is assigned to client 800. I have created RFC connection in which the destination & target system are s

  • Reg: Smartforms Table Painter

    Hi  Folks, In the smart forms in the main window I have used table for printing data of the internal table.  Also for giving the borders in the table I have used the framed patterns in the table. So I have declared the main window sizes same as paper