Issue with name space handler - spring

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

Related

java.lang.AbstractMethodError with Spring-data-elasticsearch

I'm using:
Those versions:
Spring core 4.3.7
Spring-data-elasticsearch 3.0.9 RELEASE
ES: "version": "6.3.0"
org.elasticsearch.client:rest:5.5.0 and transport 5.5.0
Spring-data-commons 1.12.8.RELEASE
Created IAuditElasticRepository.java with empty interface:
public interface IAuditElasticRepository extends ElasticsearchRepository<AuditDocument, String> {
}
Created an ch-elastic.xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/data/elasticsearch
http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:spring-configured />
<context:annotation-config />
<elasticsearch:repositories base-package="com.**.ch.db.elasticsearch" />
</beans>
Autowired it in my Manager class:
#Autowired
private IAuditElasticRepository elasticRepository;
And there is a parent xml called ch-db.xml which imports this ch-elastic.xml to it.
I have read latests posts about abstractMethodError, but couldn't find anything helpful. is it related to my Spring Core Version?
Stack trace:
2018-07-30 07:02:25,472 INFO [org.springframework.data.repository.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode!
2018-07-30 07:02:25,633 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml]
Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml]
Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
2018-07-30 07:02:25,650 WARN [org.eclipse.jetty.util.component.AbstractLifeCycle] - FAILED o.e.j.w.WebAppContext{/ws,file:/C:/workspaces/ConnectedHome/Foundation/CH/main/ws/src/main/resources/webapp/}: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml]
Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/ch-db.xml]
Offending resource: class path resource [META-INF/ch-ws.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/META-INF/ch-elasticsearch.xml]
Offending resource: class path resource [META-INF/ch-db.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/ch-elasticsearch.xml]; nested exception is java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
Caused by: java.lang.AbstractMethodError: org.springframework.data.elasticsearch.repository.config.ElasticsearchRepositoryConfigExtension.getRepositoryFactoryClassName()Ljava/lang/String;
at org.springframework.data.repository.config.RepositoryBeanDefinitionBuilder.build(RepositoryBeanDefinitionBuilder.java:87)
Walla I got a Friend !!! I am also badly stuck in this problem
But the weirdest fact is its working with
spring version ==> 5.1.0.RC1
spring data elastic search ==> 3.1.0.BUILD-SNAPSHOT
using this extra repository
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>
I think the reason its not working is version conflict that spring-data-commons part of spring-data-elastic(it uses above 5) and core spring version (where as we are using below 5)
Also as far as i know Elastic server 6.2 only supported transport client above 5.6.0+
so it should also not support elastic version 5.5.0

Maven jars classes conflicts

We are using maven in our project, we are facing some issue with
jars
Issue is :
We have ss_css2 jar and cssparser jar in project. Those two are being
used in different functionality.
The problem is those two jars have same class with same package
com.steadystate.css.parser.CSSOMParser
Because of that we are getting conflicts. The place where it actually
needs to get CSSOMParser class from cssparser instead it is
resolving class in ss_css2 jar because of that am getting below
exception
com.steadystate.css.parser.CSSOMParser.<init>(Lorg/w3c/css/sac/Parser;)V
java.lang.NoSuchMethodError:
com.steadystate.css.parser.CSSOMParser.<init>(Lorg/w3c/css/sac/Parser;)V
at
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.parseCSS(CSSStyleSheet.java:882)
at
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.<init>(CSSStyleSheet.java:193)
at
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.loadStylesheet(CSSStyleSheet.java:341)
at
com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement.getSheet(HTMLLinkElement.java:152)
at
com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList.item(StyleSheetList.java:167)
at
com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1687)
at
com.gargoylesoftware.htmlunit.html.DomNode.isDisplayed(DomNode.java:749)
at
com.gargoylesoftware.htmlunit.html.HtmlElement.isDisplayed(HtmlElement.java:1319)
at
org.openqa.selenium.htmlunit.HtmlUnitWebElement.isDisplayed(HtmlUnitWebElement.java:490)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement$1.call(
If we remove that ss_css2 jar other functionality getting failed,
getting below exception while doing text to pdf convertion
ERROR core.JobRunShell:211 - Job
com.scraper.ScheduledAgentLauncher.ScheduledAgent_DMSAgentProcessor_8
threw an unhandled Exception:
org.springframework.scheduling.quartz.JobMethodInvocationFailedException:
Invocation of method 'run' on target class [class
com.highradius.dms.scheduler.DMSAgentScheduledAction] failed; nested
exception is java.lang.NoClassDefFoundError:
com/steadystate/css/parser/SACParser at
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:273)
at
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.lang.NoClassDefFoundError:
com/steadystate/css/parser/SACParser at
org.zefer.html.doc.css.d.<init>(Unknown Source) at
org.zefer.html.doc.css.c.<init>(Unknown Source) at
org.zefer.html.doc.css.c.<init>(Unknown Source)
Please suggest what is the best approach to solve this.
you may use maven-dependency-plugin and configure the include/exclude parameters to include or exclude classes.
See Unpacking specific artifacts
hope this helps.

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

Ehcache intrigation with Spring project

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 .

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