This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi everyone, I have a Maven project which I have been working with since June in STS IDE with no issues. But on Monday morning, few days ago now, I opened my workspace and was not able to get it compiled again. The error I'm getting apparently is related to STS not seeing Maven Dependency in WEB-INF/lib. This error is:
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
So the cure for that is to add Maven Dependencies. When I do that (project -> Properties -> Deployment Assembly -> Add -> Java Build Path -> Maven Dependencies) and click Apply And OK, I attempt to "Start the Server"/build again. But this time I get a different build error which is a lot more verbose, the error:
2012-11-27 13:29:13,670 [pool-2-thread-1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'proscmAuthenticationProvider' while setting bean property 'providers' with key ; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.proscm.resources.ProscmAuthenticationProvider] for bean with name 'proscmAuthenticationProvider' defined in file [C:\Users\liliyaw\Desktop\springsource\vfabric-tc-server-developer-2.7.0.RELEASE\spring-insight-instance\wtpwebapps\proscm\WEB-INF\classes\META-INF\spring\applicationContext-security.xml]; nested exception is java.lang.ClassNotFoundException: com.proscm.resources.ProscmAuthenticationProvider
So the file applicationContext-security.xml did not change. File resources.ProscmAuthenticationProvider does exist and was not updated. Am I missing something? I should mention - this Maven Project is my first one, my experience setting up Maven projects is minimal.
Exactly what was the spring dependency that you added? (You can find this in the pom.xml file, looking at the source.)
It appears that the spring dependency you are relying on requires another dependency. The thing is, that such a dependency should be automatically included (which is why I asked for the exact dependency text). But if the spring component is not properly configured, you will have to add the "proscm" resource in as a dependency to your project. Or is 'proscm' your project?
Hi Peter, STS is Spring + Eclipse IDE (SpringSourse Tool Suite).
I was able to finally build the project, without doing anything different from what I was already doing. I'm not sure what happened to my IDE - it was finding dependencies fine, then it stopped. Now, I can build fine, but I need to physically delete target folder, where freshly compiled files stored for my edits to the files to take place... From what I found on the web STS and Maven are finicky together and some things are not compatible between the two. So I don't know, I don't want to go through the process of re-installing everything if I don't have to.
I usually do two things to get m2e and Eclipse to peacefully co-exist:
1) I often do Project > Clean and then clean all projects without automatically rebuilding (this accomplishes the same thing as removing the target folder that you mentioned)
2) I even more often to right-click project > Maven > Update Project (or Update Dependencies for older versions of m2e) and select all projects. This causes m2e to re-evaluate the dependencies and refresh the build classpath that Eclipse uses.
Usually these two actions remove all of the false errors reported by Eclipse.
Joined: Apr 11, 2006
Hi Peter, I've tried building as you suggested. The second step takes out my Maven Dependencies and doesn't add them back, so I have to add them back manually. "Clean Project" doesn't get rid of the old target dir entirely - target and m2e-wtp dirs are there, but empty. One thing that's also happening, and equally annoying, in this build precess - now I need to do a maven build, then I need to refresh the project to bring in the fresh target files, then I do tc server build. In the past, I did only the server build and that by it self took care of everything, no cleaning or refreshing of the project.