at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1416) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:125) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:93) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:356) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:120) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at javax.portlet.GenericPortlet.init(GenericPortlet.java:107) [portlet.jar:private-2011/04/13-23:33:42]
at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:246)
at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:216)
at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:139)
at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:40) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:310)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:524)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:302)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:115)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:111) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:188) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:40) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:101) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:45) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:833)

I do not have pom, I put all the spring jars in "Liferay-6.1.0\jboss-7.0.2\modules\org\spring" and then put in individual folders like asm goes ...\asm folder, created module.xml file , compile time error told me to required dependcy jars, so once I removed all dependency error, I am getting the above exception, I created my .war using Eclipse indigo. Let me know what do you think, thanks for your reply...RD

Ranen Das
Greenhorn

Joined: May 31, 2012
Posts: 4

posted May 31, 2012 12:01:08

0

Ok, one more development, if I put commenting in component scan and mvc annotation and use spring old settings, it works fine

Is there a reason you are not using maven to handle your dependency management?

Taking the spring-context.jar for example (since you are Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context] )

If you open that jar with 7zip or a similar program there are 2 files to pay attention to :

META-INF/spring.handlers
META-INF/spring.schemas

This is what is referenced. If you open the file spring.schemas you will often see the path (within the same jar) to the actual XSD's in case you need to validate against them offline.

So the dilemma is this. If you are just copying dependencies into your METAINF directory your are copying the spring.handlers and spring.schemas from each jar and they are overwriting one another. So perhaps the one that is there is from spring-beans.jar and that is why it is working. If you are going to do things this way you are going to have to append the contents of each jars spring.handlers and spring.schemas files together into one file so everything it is looking for can be found.

Unless there is a good reason for doing things this way I would consider using Maven.

Ranen Das
Greenhorn

Joined: May 31, 2012
Posts: 4

posted May 31, 2012 13:06:40

0

Hi Bill, thanks for your suggestion, now I understand the problem. See, my application is already developed quite a lot, so now if we go for maven, I don't know my manager will allow me to do or not, but certainly a good suggestion, even I also thought that way initially.

Now come to your suggestion - what I did - I created those 2 files inside my one particular portlet's META-INF, but still same error.

Now my question to you is which META-INF I should put those 2 files. I created 2 new files(.handler and .schemas) and put all the spring jars information inside 2 files and it has got all the settings for all spring jars.

Now my question you is which location I should put these 2 files, becauseputting individual portlets META-INF does not work, plus its not a decent idea, becausewe will have lot of portlets

Honestly I have never tried what you are doing. It is similar to what was done back when there was a Spring uber jar.

You can try to create a META-INF directory in your resources directory (same place you keep your application-context.xml) and create both the 2 files (its spring.handlers and spring.schemas not .handlers and .schemas) then you will need to go through every single spring jar in your project and concatenate the contents of each within those 2 files.

plus its not a decent idea, becausewe will have lot of portlets

I agree this is why you should probably use maven.

If your manager will not buy into using maven for your project (save you lots of time and headaches later) then you can look at using maven with the Maven Shade Plugin and try to build your own spring Uber jar (like they used to provide) that contains all of the needed dependencies and let the plugin do the concatenation of those files.

You will have to configure a transformer for concatenating those files something like below: