Ehcache intrigation with Spring project - spring

i am facing this error:-
ERROR: org.springframework.web.context.ContextLoader - Context
initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://www.springmodules.org/schema/ehcache]
Offending resource: ServletContext resource
[/WEB-INF/spring/application-context.xml]
If any solution for this give me suggestion.

This seems to be a library issue . Check if you have the ehcache jar in your classpath . Else download it from here .

Related

Liferay upgrade 7.2 to register spring beans with osgi

While I am trying to configure a spring mvc portlet with beans and bring up the deployed war on my server I get following errors
I tried all the stuff related to spring inorder to solve NameSpaceHandler issue, but I still get error related to portlet.xml, registration of beans with container
I am using spring 4.2.5-RELEASE and XML schema all I using 3.0 version for XSD inorder for it to be compliant with webapp 3.0 XSD just to be safe.
Logs are as mentioned below
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]_Offending resource: ServletContext resource [/WEB-INF/spring-context/portlet-application-context.xml]_ [Sanitized]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:110)
2020-05-18 08:16:53.947 ERROR [fileinstall-/project_war_Path/][HotDeployImpl:232] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for project-spring-portlet-1.0.0
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for project-spring-portlet-1.0.0
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:40)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.doInvokeDeploy(ServletContextListenerHotDeployListener.java:73)
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDeploy(ServletContextListenerHotDeployListener.java:37)
... 63 more
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]_Offending resource: ServletContext resource [/WEB-INF/spring-context/portlet-application-context.xml]_ [Sanitized]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:118)
2020-05-18 08:16:53.957 WARN [fileinstall-/project_war_Path/][PortletLocalServiceImpl:881] Portlet with the name apiusersspring_WAR_apiusersspringportlet100 is described in portlet.xml but does not have a matching entry in liferay-portlet.xml
2020-05-18 08:16:53.958 WARN [fileinstall-/project_war_Path/][PortletLocalServiceImpl:893] Portlet with the name apiusersspringportlet_WAR_apiusersspringportlet100 is described in liferay-portlet.xml but does not have a matching entry in portlet.xml
2020-05-18 08:16:53.958 ERROR [fileinstall-/project_war_Path/][PortletBagFactory:288] java.lang.ClassNotFoundException: org.springframework.web.portlet.DispatcherPortlet cannot be found by project-spring-portlet-1.0.0_1.0.0
java.lang.ClassNotFoundException: org.springframework.web.portlet.DispatcherPortlet cannot be found by project-spring-portlet-1.0.0_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
2020-05-18 08:16:53.963 ERROR [fileinstall-/project_war_Path/][PortletBagFactory:214] javax.portlet.PortletException: java.lang.NullPointerException
javax.portlet.PortletException: java.lang.NullPointerException
at com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:111)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortletFactoryImpl.create(MonitoringInvokerPortletFactoryImpl.java:115)
at com.liferay.portlet.internal.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:275)
at com.liferay.portlet.internal.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:181)
Caused by: java.lang.NullPointerException
at com.liferay.portlet.internal.InvokerPortletImpl.<init>(InvokerPortletImpl.java:122)
at com.liferay.portlet.internal.InvokerPortletFactoryImpl.create(InvokerPortletFactoryImpl.java:107)
... 80 more
2020-05-18 08:16:53.966 ERROR [fileinstall-/project_war_Path/][HotDeployImpl:232] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for project-spring-portlet-1.0.0
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for project-spring-portlet-1.0.0
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:38)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:99)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:229)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:189)

Spring Hadoop - Unable to locate Spring NamespaceHandler for XML schema namespace

I want to enable Hive in my Spring Hadoop project. I understand that we can't use JavaConfiguration so I am using XML. I have an error regarding the Spring Namespace.
Error starting ApplicationContext. To display the auto-configuration
report re-run your application with 'debug' enabled. [2017-10-03
10:26:51.292] - 44342 SEVERE [main] ---
org.springframework.boot.SpringApplication: Application startup failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://www.springframework.org/schema/hadoop]
Offending resource: class path resource [hiveContext.xml]
My pom has the following dependency.
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-boot</artifactId>
<version>2.5.0.RELEASE</version>
</dependency>
I know some other posts talks about SpringSecurity, but I don't have access to a spring-hadoop-config dependency.

Issue with name space handler

Please help us to resolve the below issue.
The following is the issue we are facing, when we are building the interface via Maven command(mvn clean package).
Can you please try to help on this issue?
java.lang.RuntimeException:
org.mule.api.config.ConfigurationException: Configuration problem:
Failed to import bean definitions from URL location
[classpath:common-config.xml]
Offending resource: URL [file:C:/AnypointStudio/projectname/src/test/munit/new-test-suite.xml];
nested exception is
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.mulesoft.org/schema/mule/spring-security]
Offending resource: class path resource [common-config.xml] (org.mule.api.lifecycle.InitialisationException)
at org.mule.munit.runner.mule.SuiteRunner.(SuiteRunner.java:59)
at org.mule.munit.runner.mule.SuiteRunner.(SuiteRunner.java:45)
at org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
at org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
at org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)
Caused by: org.mule.api.config.ConfigurationException: Configuration problem: Failed to import bean definitions from URL
location
Offending resource: URL [file:/C: Projectname/new-test-suite.xml]; nested exception is
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.mulesoft.org/schema/mule/spring-security]
I got the solution by adding jersey dependency in pom.xml
Thanks for your time , who look into issue

Spring JDO configuration parsing error

I have a spring test case that annotated as following
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(locations = {"classpath:conf/allocadia-base.xml", "classpath:META-INF/jdoconfig.xml"})
my jdoconfig is
<?xml version="1.0" encoding="utf-8"?>
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
when I run the test I get
java.lang.IllegalStateException: Failed to load ApplicationContext
.
.
.
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from class path resource [META-INF/jdoconfig.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'jdoconfig'.
if I changed jdoconfig to
<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_2_3.xsd">
the error is
Caused by:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://java.sun.com/xml/ns/jdo/jdoconfig]
Offending resource: class path resource [META-INF/jdoconfig.xml]
I use the latest spring 3.2 and JDO 2.3-e
the application works fine when I deploy it to tomcat I'm just getting this error when trying to run the test
Your jdoconfig.xml consist incorrect url. Try this:
xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd"
Validating jdoconfig with incorrect url
How to solve validation error on xsi:noNamespaceSchemaLocation in jdoconfig.xml

spring framework Error: Context initialization failed

i am deploying application(spring-hibernate) in tomcat6 but it is giving error-
ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: com.myPackage.myProject.calendar.bpo.BusinessDirectoryBPOImpl; nested exception is java.io.FileNotFoundException: class path resource [com/myPackage/framework/bpo/BaseBPOImpl.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:180)
......
all jar files are already in \WEB-INF\lib*.jar.
am i missing any class file or any jar file.
how to solve this error.
Thanks
Yugal
com.myPackage.myProject.calendar.bpo.BusinessDirectoryBPOImpl is looking for
com/myPackage/framework/bpo/BaseBPOImpl.class
which it cannot find.
Check for sure if this specific class is present under WEB-INF\lib in a jar or WEB-INF\classes as a class file.

Resources