aspose file tools*
The moose likes Spring and the fly likes Context Loader problem : IllegalStateException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Context Loader problem : IllegalStateException" Watch "Context Loader problem : IllegalStateException" New topic
Author

Context Loader problem : IllegalStateException

Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

This is the following error


| B.E IT | SCJP 6.0 98 % |
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

Well it says


What does your web.xml look like?


[How To Ask Questions][Read before you PM me]
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

Now it says...

Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

My web.xml :

Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

I would definitely take a look at some spring tutorials examples to get you started. Typically your web.xml would look something more like this:

https://github.com/SpringSource/spring-mvc-showcase/blob/master/src/main/webapp/WEB-INF/web.xml

If you wanted to use java config things would be a little different but I am not sure which route you are going. Notice a couple important differences from what is in the link and what you have.

1. You are missing the ContextLoaderListener
2. You are not defining a ContextConfig for spring to bootstrap
3. Your dispatcher servlet mapping is typically / (your jsp's are mapped via view resolvers from the controllers handler mappings, see the same link for examples)
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

I am new to the Spring Framework and don't know any thing about it.
I know servlets & jsps but Spring is completely new to me.
I found lots of working examples but each examples configuration is different from other and i am stuck in finding which is the right one?
Kindly guide me in right direction.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

Well I can help you with a specific problem but Spring is a big subject to teach in a forum post. Here is what I would do:

1. search this forum for 'Spring Book' or 'Learning Spring' to get a bunch of ideas of where to start as these questions have been answered many times.
2. Search google for 'spring tutorials' or 'spring examples'. Try to use examples that are Spring 3 or later if possible. Googling around for some basic hello world type stuff I found these:
http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example/
http://www.giantflyingsaucer.com/blog/?p=2395
3. Check out the spring reference documentation it is really well written and probably the best single source of information out there. If you supplement it with a book like 'Spring in Action 3rd Edition' you will be well on your way.
4. Post back to this forum if you run into specific problems or questions and I am sure somebody will help you

Good Luck,
 
wood burning stoves
 
subject: Context Loader problem : IllegalStateException