Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2011
    Posts
    35
    Rep Power
    0

    Default error cannot access class com.opensymphony.xwork2.ActionContext, wrong version

    Error(1,32): cannot access class com.opensymphony.xwork2.ActionContext; class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0
    Java Code:
    import com.opensymphony.xwork2.ActionContext;
    import com.opensymphony.xwork2.ActionSupport;
    import java.util.Map;
    
    public class loginAction extends ActionSupport 
    {
    private String userId;
      private String password;
      public String execute() throws Exception{
    
        if ("admin".equals(userId) && "admin".equals(password)) {
          Map session = ActionContext.getContext().getSession();
          session.put("logged-in","true");
                return SUCCESS;
            }
        else{
           return ERROR;
        }
        }
    
        public String logout() throws Exception {
    
        Map session = ActionContext.getContext().getSession();
        session.remove("logged-in");
            return SUCCESS;
        }
    
        public String getPassword() {
            return password;
        }
    
        public void setPassword(String password) {
            this.password = password;
        }
    
        public String getUserId() {
            return userId;
        }
    
        public void setUserId(String userId) {
            this.userId = userId;
        }
    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    You have a version of opensymphony that was compiled with a later version of the JDK than the one you are using.

    ETA: Sorry, meant JRE...which could still be your JDK.
    48 is 1.4 (so you're waaay old).
    49 is 1.5.

  3. #3
    Join Date
    Mar 2011
    Posts
    35
    Rep Power
    0

    Default

    thank you sir..which version should i use.any download link if you can provide for that version, I have downloaded 2-3 more versions for that jar file but same error when i add them to library
    thank you
    Last edited by gurpreet.singh; 03-31-2011 at 10:05 AM.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    No idea.
    My suggestion would be to upgrade your Java.
    I wouldn't be surprised if open symphony didn't bother supporting pre 1.5 anymore.

  5. #5
    Join Date
    Mar 2011
    Posts
    35
    Rep Power
    0

    Default

    I m having latest version of java ,i am using jdeveloper 10 G

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0
    49.0 is 1.5.
    48.0 is 1.4.

    You are running this under a 1.4 JRE.

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2011, 08:02 AM
  2. Class Version in Serialization
    By Gunas in forum New To Java
    Replies: 5
    Last Post: 02-04-2010, 04:01 AM
  3. Wrong version of javac/java
    By amir650 in forum Eclipse
    Replies: 0
    Last Post: 09-12-2008, 11:33 PM
  4. Replies: 1
    Last Post: 08-09-2007, 07:32 PM
  5. Replies: 1
    Last Post: 08-07-2007, 07:53 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •