aspose file tools*
The moose likes Struts and the fly likes Version problem with com.opensymphony.xwork2 49 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Version problem with com.opensymphony.xwork2 49" Watch "Version problem with com.opensymphony.xwork2 49" New topic
Author

Version problem with com.opensymphony.xwork2 49

biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
Dear all,
Its my 4th day i am speding for this problem and i need a solution for it. I am new to struts actaully. when i compile my class file i am getting an error message says that [jar file version is xwork-2.0.1]


error: Invalid class file format: C:\Program Files\Java\jdk1.6.0\lib\com\opensym
phony\xwork2\ActionSupport.class, wrong version: 49, expected 45
userLogin.java:2: Class com.opensymphony.xwork2.ActionSupport not found in impor
t.
import com.opensymphony.xwork2.ActionSupport;
^
userLogin.java:4: Superclass com.opensymphony.xwork2.ActionSupport of class user
Login not found.
public class userLogin extends ActionSupport{
^




Hope a fast replay..


Biny Balan
binypanackal@gmail.com
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

First of all, the XWork library almost certainly shouldn't be in the JDK library directory: it should be with your application.

Secondly, you're most likely having an issue with the JDK version used to compile something, either XWork or your code--although 45 is JDK 1.1, which I find... unlikely. 49 is JSE 5.
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
i had plased my jar files in lib directory of jdk1.6.0 and i am compiling it using the same.i had mention below as my classpath.I had no refrence to jdk 1.1 in my machine

CLASSPATH=
___________
C:\Program Files\Java\jdk1.6.0\lib;C:\Program Files\Java\jdk1.6.0\lib\xwork-2.0.1.jar;E:\jboss-4.2.2.GA\server\default\deploy\strBLG.war\WEB-INF\classes\bean;C:\Program Files\Java\jdk1.6.0\lib\struts2-core-2.0.6


Hope you can find a solution
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm telling you not to put the XWork libraries in your JDK lib directory. You *can*, but you'd be the first person I've heard of ever doing that. When you deploy the app you have to deploy the libraries--so keep them in the application.

You're also missing the other libraries S2 depends on (off the top of my head there's OGNL, FreeMarker, commons-logging, and one or two more).

You're also using a relatively older version of S2--I'd highly recommend using a more recent version--there are changes between such an early version and what's being distributed now; it'd be easier if you just used a recent version.

Try putting the libraries in a reasonable location and using all the required libraries first, then take it from there. You might also want to post your webapp directory layout just to make sure it's correct.
biny panackal
Ranch Hand

Joined: Apr 12, 2007
Posts: 72
sory for the vary later replay. i got it working. there was reference to jdk117. it cam alogn witht the sybase installation. When i removed it form class path it worked fine. Thank you
 
jQuery in Action, 2nd edition
 
subject: Version problem with com.opensymphony.xwork2 49