0

I am making a Struts 2 application using jTable which requires use of JSON. For this I am adding a Struts 2 JSON plugin jar to my project

struts2-json-plugin-2.3.8.jar

Without that jar my project is working fine (obviously without json capabilities) but when I am adding the above jar my landing page shows error

404 - resource not available.

The different jar that I am using are :

commons-fileupload-1.2.1.jar, 
commons-io-1.3.2.jar, 
commons-lang3-3.1.jar, 
commons-logging-1.1.jar, 
freemarker-2.3.13.jar, 
javassist-3.11.0.GA.jar, 
junit-3.8.1.jar, 
ognl-2.6.11.jar, 
servlet-4.0.6.jar, 
struts2-core-2.1.6.jar, 
struts2-json-plugin-2.3.8.jar, 
xwork-2.1.2.jar

I am following this Setting up jQuery jTable plugin in Struts 2 framework.

Roman C
  • 49,761
  • 33
  • 66
  • 176
sam100rav
  • 3,733
  • 4
  • 27
  • 43
  • If you are *following* some post, follow it to the point. – Aleksandr M Aug 06 '14 at 11:33
  • 1
    Two issues: (1) Apparently arbitrary mixing-and-matching of Struts 2 tag library versions; it doesn't work like that--use Maven or similar, and (2) You cannot arbitrarily add libraries without also adding their transitive dependencies. In this case it might actually work, if you were using the right versions of everything, which you're not, but in general, you should not be doing dependency management yourself unless there are explicit conflicts. – Dave Newton Aug 06 '14 at 12:04

1 Answers1

0

This is required set of libraries found in the lib.txt:

commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.19.jar
gson-2.2.2.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
struts2-core-2.3.8.jar
struts2-json-plugin-2.3.8.jar
xwork-core-2.3.8.jar

But in your project you are using a mix of libraries different versions of Struts. Such as

struts2-core-2.1.6.jar, 
struts2-json-plugin-2.3.8.jar, 
xwork-2.1.2.jar

You should not copy any of the servlet libraries to the server such as

servlet-4.0.6.jar, 

The server already has dependencies for all servlet versions. Change the scope of the library to be not included in the final war.

A note about

commons-io-1.3.2.jar,

which doesn't work with Struts 2.3.8 should be updated.

Roman C
  • 49,761
  • 33
  • 66
  • 176