• 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

StrutsTestCase and SEVERE: [03:03.503] Dispatcher Initialization Failed

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I am trying to use struts2-core-2.1.8.1.jar in conjuction with struts2-junit-plugin-2.1.8.1.jar. I am attempting to write unit tests for my Struts 2 components by extending StrutsTestCase.

I am a bit perplexed because the super methods contain reference to Spring, but I have seen fragments from the web suggesting that you can use StrutsTestCase without the need for Spring (which we do not use for this particular project). When I try to include org-springframework.core-3.0.3.jar, I get the error in the title with no further log information, just that one line. If I do not include Spring and attempts to use the protected methods and attributes from the superclass(es) I end up with extensive loggin information giving me various class missing errors from say within the org.springframework.core.io package (such as ResourceLoader).

Just to throw it out, I use xwork-core-2.1.6.jar because I saw that as a possible issue.

1) Is it really possible to use StrutsTestCase with no reference to Spring?
2) Is there some group of Spring jar files and dependecies that are needed to really use StrutsTestCase.

Be happy to provide additional information on configuration.
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to carry on a conversation with myself, but I have done enough to move on even though what I have sort of makes my stomach queasy. For future users of the forum, let me document what I did.

Instead of spring3 (tsk tsk tsk), I used the spring2.5.6 that came with the struts distribution, always the better idea. I took the spring-core-2.5.6 which satisfies the ResourceLoader class need and the spring-test-2.5.6.jar which gives me the Spring mock objects needed. I eliminated the Dispatcher Initialization Failed error by noting that Junit was looking at the WEB-INF/lib directory I had and so the same xwork bean was being loaded twice which causes an error. Lesson, make sure duplication of libraries/classes is not present on your classpath. We put our libs in one directory and then copy them automatically in our ant build and hence two copies of everything.

But still, please, oh please, oh please ... if anyone can point out how to use StrutsTestCase without the use of Spring libraries, please tell me.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Greg Werner wrote:
But still, please, oh please, oh please ... if anyone can point out how to use StrutsTestCase without the use of Spring libraries, please tell me.



Sorry to bump an old thread, but I too am interested in this.
 
reply
    Bookmark Topic Watch Topic
  • New Topic