aspose file tools*
The moose likes Struts and the fly likes error in struts program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "error in struts program" Watch "error in struts program" New topic
Author

error in struts program

Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
i am doing a project in tsruts problem is that sometimes it gives error



please tell me what this error can be
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

Check the version of JDK that is trying to execute your code, It might be the unsupported version of the source code


Regards,
Deepakkumar Devarajan
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
@ deepak thanks for your reply

i am using java EE 5.0 during struts program &


jdk1.5.0_09
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

Aditi agarwal wrote:i am using java EE 5.0 during struts program &
jdk1.5.0_09


If you are using eclipse check the "Java Compiler Compliance level", check the version JDK libraries, Please make sure that JDK supports your source code, if any of the predefnied class files imported are not supported with JDK you use then you will get this error
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
I am using MyEclipse 8.5 please guide me for that

thnak you
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

I am not sure for MyEclipse but in Eclipse i do this way,Right click on the project, select Properties,then select Java Compiler from the list shown , check the version the compiler uses. Then Click java build path, check whether the required JDK library is added.
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

Please check whether all your predfined classes are supported by the current version you use.
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
@deepak thanks for your replie

i have checked the same way you have told in eclipse

my java compiler level is 1.4 &

in java build path all my J2EE 1.4 libraries are already added

now please tell me how to check that my all predefined classes are supported by current version that i use ?

thank you
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

Just change the compiler level to 1.5,Remove your j2ee 1.4 library and add JDK 1.5 , hope that might resolve the issue..

I am not sure whether a perfect tool exists to find out the JDK version of a class file but you can code for this

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 507
Hello,
I think this is related to something like class being compiled with the JDK that has higher version(say 1.6) than the one you are trying to run the class on(say 1.5).
Backward compatibility is always there so class compiled using 1.4 as in your case should run fine on the Java EE 5.

What version of Struts you are using? I am not sure if Struts 2 can work with JDK 1.4 as I havent worked with it yet.

Regards,
amit
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

@Aditi Any improvement?
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
nope deepak no improvement nothing can be done in this case tll now
Deepakkumar Devarajan
Ranch Hand

Joined: Apr 19, 2011
Posts: 52

Did you check the versions of your predefined classes? change java compiler level to 1.5 and add JDK 1.5 to build path, remove 1.4.
Aditi agarwal
Ranch Hand

Joined: Feb 23, 2011
Posts: 225
i have done every possible change which i can try
 
Don't get me started about those stupid light bulbs.
 
subject: error in struts program
 
Similar Threads
unable to display charts in tomcat6.x
JSTL configuration problem in Eclipse
Need help for JSP to call C API using JNI
UnsupportedClassVersionError with Tomcat 5.0.28
Error message