• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XWorks throws Missing Dependency Exception for HelloWorld? HELP!

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to learn Struts, starting with the HelloWorld sample here, but on startup, Tomcat is showing me this in the logs:


I have the following in the lib directory for the webapp, so I don't know what xworks isn't finding...

commons-logging-1.1.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
xwork-2.1.2.jar


Can anyone tell me what this means?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If nothing else, you need commons-io and commons-fileupload (we're in the process of updating some of the docs still). See if that fixes it, although I had thought that missing those would give a different error message-so that might not be the only problem.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I fixed this by moving the struts.xml file into the class path (WEB-INF/classes). Even though I had configured the FilterDispatcher to look in a specific location for the file, (see below) it wasn't finding the config. Don't know why it was giving an xwork error, though.

snip from my previous web.xml, which apparantly didn't work.

Maybe you can help me with my next problem? How do I get Struts to use a different extension from the default .action? I'm trying to get it to recognize, say, "index.do", which resides in a specific subdirectory of the webapp. Like I want Struts to handle all requests that look like

http://localhost:8080/mywebapp/strutspages/myaction.do

Looks like no matter what I do, Struts ignores the "strutspages" part, and the ".do" part. I can't use <url-pattern>/strutspages/*.do</url-pattern> in web.xml, because Tomcat barfs on load (bad url pattern apparently, though it looks fine to me).

Is the url being handled by the Struts filter somehow related to the "name" and "namespace" attributes of struts-config.xml <package> elements? I'm not clear on what those attributes do, whether they are local identifiers (like a Spring context file), or somehow related to the actual path of the request...

Any ideas?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure you'd want to set the filter to anything other than "/*" at this point anyway; S2 serves static content from its jar files. It's not *necessary* to do it this way, though.

The action extension is configured via the "struts.action.extension" constant, which defaults to "action,,".

In general it's best to start new threads for new topics; this helps other people find topics of interest to them.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic