Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to update from 2.0.11 to 2.2.3?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to update my application which is using the quite old 2.0.11 version of struts2.
However, that seems to be everything, but not easy...

What do I have to do in order to update the struts2 version?

I tried to simply replace the struts2-core-2.0.11.jar with the new one, but then the start of the tomcat fails with this error:
______
23.08.2011 16:30:57 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.NoClassDefFoundError: Lcom/opensymphony/xwork2/util/logging/Logger;
...
Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.logging.Logger
______

I don't understand what causes this error.
The only thing I can imagine is that updating the struts2 core lib also requires an update of other libs.
But how shall I now which one I need?

Hope you can help me!

Greetings,
Manuel
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
refer this thread https://coderanch.com/t/434954/Struts/First-Struts-Application-Unable-load and make sure that you are included xwork-core-2.2.1.jar
 
Manuel Oetzi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mohana,

I got the tomcat starting again.
But that was now very much experimenting instead of knowing what I do :-)
Therefore I would be very glad to know where I can see which libs I need in case of updating struts2. Otherwise I will probably open a similar thread in several month ;-)

For others who have the same problem. I did the following:
- Replace struts2-core-2.0.11.jar with struts2-core-2.2.3.jar
- Replace xwork-2.0.4.jar with xwork-core-2.2.3.jar
- Add commons-fileupload-1.2.2.jar

Greetings
Manuel



EDIT:
unfortunately I have another problem, which I assume has something to do with the update of the xwork lib.
After this line here
ActionContext context = ActionContext.getContext();
context is null and therefore I get NullPointerExceptions if I try to access it.

Since the ActionContext is provided by the xwork2 lib which I updated, I am wondering if I have to take anything else into account?


EDIT2:
Funny..., in the API (xworks API you can find the following paragraph:

getContext

public static ActionContext getContext()

Returns the ActionContext specific to the current thread.

Returns:
the ActionContext for the current thread, is never null.



Nevertheless this code here

produces the output:
context: null

Curios!?
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic