Spring Async method or event throws HystrixRequestContext.initializeContext() exception - hystrix

Our code has a few #Async methods, and ApplicationListeners. These classes and methods end up calling API services that have the #Hystrix annotation. These calls throw the following exception:
java.lang.IllegalStateException: HystrixRequestContext.initializeContext() must be called at the beginning of each request before RequestVariable functionality can be used.
at com.netflix.hystrix.strategy.concurrency.HystrixRequestVariableDefault.get(HystrixRequestVariableDefault.java:76) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.strategy.concurrency.HystrixRequestVariableHolder.get(HystrixRequestVariableHolder.java:68) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.HystrixRequestLog.getCurrentRequest(HystrixRequestLog.java:85) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.AbstractCommand.<init>(AbstractCommand.java:274) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.HystrixCommand.<init>(HystrixCommand.java:142) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.HystrixCommand.<init>(HystrixCommand.java:128) ~[hystrix-core-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.command.AbstractHystrixCommand.<init>(AbstractHystrixCommand.java:55) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.command.GenericCommand.<init>(GenericCommand.java:33) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.command.GenericHystrixCommandFactory.create(GenericHystrixCommandFactory.java:32) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.command.GenericHystrixCommandFactory.create(GenericHystrixCommandFactory.java:21) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.command.AbstractHystrixCommandFactory.create(AbstractHystrixCommandFactory.java:78) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect.methodsAnnotatedWithHystrixCommand(HystrixCommandAspect.java:81) ~[hystrix-javanica-1.4.10.jar:1.4.10]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) [spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) ~[spring-aop-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at com.intuit.platform.common.aop.InstrumentationAspect.profile(InstrumentationAspect.java:25) ~[classes/:na]
at sun.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
Adding HystrixRequestContext.initializeContext() in the Async method does not help.

You need to initialize the value before the request sends.
Override HystrixRequestVariableDefault
For more info this issue on Github: https://github.com/Netflix/Hystrix/issues/895

Related

java.lang.NoClassDefFoundError: org/apache/flink/util/function/SerializableFunction

flink version:1.14.2
hive version:2.1.1
use flink connect hive exec batch process,happend err.
use flink sql exec query
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError:
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/apache/flink/util/function/SerializableFunction
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.build(JdbcOutputFormatBuilder.java:100)
at org.apache.flink.connector.jdbc.table.JdbcDynamicTableSink.getSinkRuntimeProvider(JdbcDynamicTableSink.java:89)
at org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecSink.createSinkTransformation(CommonExecSink.java:121)
at org.apache.flink.table.planner.plan.nodes.exec.batch.BatchExecSink.translateToPlanInternal(BatchExecSink.java:59)
at org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:134)
at org.apache.flink.table.planner.delegation.BatchPlanner$$anonfun$1.apply(BatchPlanner.scala:82)
at org.apache.flink.table.planner.delegation.BatchPlanner$$anonfun$1.apply(BatchPlanner.scala:81)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at org.apache.flink.table.planner.delegation.BatchPlanner.translateToPlan(BatchPlanner.scala:81)
at org.apache.flink.table.planner.delegation.PlannerBase.translate(PlannerBase.scala:185)
at org.apache.flink.table.api.internal.TableEnvironmentImpl.translate(TableEnvironmentImpl.java:1665)
at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeInternal(TableEnvironmentImpl.java:752)
at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeInternal(TableEnvironmentImpl.java:872)
at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeSql(TableEnvironmentImpl.java:742)
at com.zhhainiao.wp.stat.PaidConversationRate$.main(PaidConversationRate.scala:172)
at com.zhhainiao.wp.stat.PaidConversationRate.main(PaidConversationRate.scala)
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 org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222)
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:812)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:246)
at org.apache.flink.client.cli.CliFrontend.parseAndRun(CliFrontend.java:1054)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1132)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698)
at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1132)
Caused by: java.lang.NoClassDefFoundError: org/apache/flink/util/function/SerializableFunction
at java.lang.ClassLoader.defineClass1(Native Method)
Have you added the correct Hive dependencies, as explained on https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/connectors/table/hive/overview/#dependencies ?

Couldn't parse stream - CXF Issue

I am receiving below CXF exception while receiving supplier response. I am using apache cxf 2.7.18 version. Not able to identify the issue. Please help to resolve the issue. Please find below stack-trace for details also attaching exception screenshot
[http-bio-6099-exec-48] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://www.travelport.com/service/universal_v41_0}AirService#{http://www.travelport.com/service/universal_v41_0}service has thrown exception, unwinding now
java.lang.RuntimeException: Couldn't parse stream.
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1705)
at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:123)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:849)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1520)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1317)
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:223)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
at com.sun.proxy.$Proxy72.service(Unknown Source)
at com.vtech.appxtension.tdpms.blackbox.vendorapi.galileouapi.WrapGalileouapiAirServiceImpl.bookGalileoUAPILCC(WrapGalileouapiAirServiceImpl.java:364)
at com.vtech.appxtension.tdpms.blackbox.vendorapi.galileouapi.WrapGalileouapiAirServiceImpl.doBooking(WrapGalileouapiAirServiceImpl.java:268)
at com.vtech.appxtension.tdpms.blackbox.productimpl.WrapAirBlackboxControlUnit.bookAir(WrapAirBlackboxControlUnit.java:822)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.vtech.appxtension.tdpms.blackbox.WrapBlackBoxProductBookControlEngine.bookAirProduct(WrapBlackBoxProductBookControlEngine.java:237)
at com.vtech.appxtension.tdpms.blackbox.WrapBlackboxControlEngine.doBooking(WrapBlackboxControlEngine.java:419)
at com.vtech.appxtension.tdpms.blackbox.WrapBlackboxControlEngine.processRequestXml(WrapBlackboxControlEngine.java:79)
at com.vtech.webservice.WebServiceSearchBookServlet.doPost(WebServiceSearchBookServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxIOException: stream is closed
at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:550)
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:605)
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:628)
at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1703)
... 48 more
Caused by: java.io.IOException: stream is closed
at sun.net.www.http.ChunkedInputStream.ensureOpen(ChunkedInputStream.java:174)
at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:673)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3066)
at com.ctc.wstx.io.BaseReader.readBytes(BaseReader.java:155)
at com.ctc.wstx.io.ISOLatinReader.read(ISOLatinReader.java:83)
at com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:250)
at com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:133)
at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:545)
I am using CXF version 2.7.18

Cannot register bean definition [Root bean: class [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]

1.I set the allowBeanDefinitionOverriding=false as below:
package com.everbridge.platform.framework.web;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.web.context.support.XmlWebApplicationContext;
/**
* Created by Sharon on 2016/11/21.
*/
public class SpringApplicationContextInitializer implements ApplicationContextInitializer<XmlWebApplicationContext> {
#Override
public void initialize(XmlWebApplicationContext xmlWebApplicationContext) {
xmlWebApplicationContext.setAllowBeanDefinitionOverriding(false);
}
}
and I add config into web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:portal-config/*.xml
</param-value>
</context-param>
2.I restart my project and it throws an exception:
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0' defined in null: Cannot register bean definition [Root bean: class [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': There is already [Root bean: class [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.
at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:808)
at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.registerBeanDefinition(BeanDefinitionReaderUtils.java:148)
at org.springframework.beans.factory.xml.ParserContext.registerBeanComponent(ParserContext.java:120)
at org.springframework.data.mongodb.config.MappingMongoConverterParser.getValidator(MappingMongoConverterParser.java:183)
at org.springframework.data.mongodb.config.MappingMongoConverterParser.potentiallyCreateValidatingMongoEventListener(MappingMongoConverterParser.java:159)
at org.springframework.data.mongodb.config.MappingMongoConverterParser.parse(MappingMongoConverterParser.java:139)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1427)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4717)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1702)
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 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
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 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
3.Then I debug the project.I find this configuration in the applicationContext-business.xml cause the problem.
<mongo:mapping-converter id="mappingConverter" mapping-context-ref="mappingContext" />
When the Spring container use MappingMongoConverterParser.class to parse the BeanDefinition,it called this.potentiallyCreateValidatingMongoEventListener-->this.getValidator.In the function of getValidator,
String validatorName = parserContext.getReaderContext().registerWithGeneratedName(validatorDef);
the codes above made LocalValidatorFactoryBean registered in the BeanDefinitionMap,so when use these codes as below:
parserContext.registerBeanComponent(new BeanComponentDefinition(validatorDef, validatorName));
it can't register LocalValidatorFactoryBean again.And throws Exception at DefaultListableBeanFactory .
enter image description here
How should I solve this problem?

Exception with EmbeddedSolrServer : java.lang.NoClassDefFoundError

I'm trying to use the EmbeddedSolrServer with Solrj, but when I run my program, I get an exception :
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa der.java:58)
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/util/Resou rceLoader
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 2)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 2)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at Main.Main.main(Main.java:35)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.util.Res ourceLoader
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 28 more
I've seen another post that shows the same problem but I didn't understand how to set the classpath they've talked about.
I've got the solr-core-4.2.1.jar. I checked that this JAR file contains ResourceLoader Class and it does. So I'm a bit lost... Why this class is missing when I run my program ?
Posts related to my problem :
solr java.lang.NoClassDefFoundError: org/apache/solr/common/ResourceLoader
Edit : I'm trying to index files in a document through SOLR and lucene..
Could someone explain ?
Thanks
Corentin

Deferred binding failed for GWTP PlaceManager

This is the error I get when running my application:
java.lang.RuntimeException: Deferred binding failed for
'com.gwtplatform.mvp.client.proxy.PlaceManager' (did you forget to
inherit a required module?)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.myapp.client.gin.ClientGinjectorImpl.create_Key$type$com$gwtplatform$mvp$client$proxy$PlaceManager$_annotation$$none$$(ClientGinjectorImpl.java:597)
at com.myapp.client.gin.ClientGinjectorImpl.get_Key$type$com$gwtplatform$mvp$client$proxy$PlaceManager$_annotation$$none$$(ClientGinjectorImpl.java:611)
at com.myapp.client.gin.ClientGinjectorImpl.getPlaceManager(ClientGinjectorImpl.java:27)
at com.myapp.client.MainAppEntryPoint.onModuleLoad(MainAppEntryPoint.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:722) Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.myapp.client.gin.ClientGinjectorImpl.create_Key$type$com$gwtplatform$mvp$client$proxy$PlaceManager$_annotation$$none$$(ClientGinjectorImpl.java:597)
at com.myapp.client.gin.ClientGinjectorImpl.get_Key$type$com$gwtplatform$mvp$client$proxy$PlaceManager$_annotation$$none$$(ClientGinjectorImpl.java:611)
at com.myapp.client.gin.ClientGinjectorImpl.getPlaceManager(ClientGinjectorImpl.java:27)
at com.myapp.client.MainAppEntryPoint.onModuleLoad(MainAppEntryPoint.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:722)
Although I have these on the .gwt.xml file:
<inherits name="com.google.gwt.inject.Inject"/>
<inherits name='com.gwtplatform.mvp.Mvp'/>
<inherits name='com.gwtplatform.dispatch.Dispatch'/>
<define-configuration-property name='gin.ginjector' is-multi-valued='false' />
<set-configuration-property name='gin.ginjector' value='com.myapp.client.gin.ClientGinjector' />
In the application WEB-INF/lib:
guice-assistedinject-3.0-rc2.jar
guice-servlet-3.0.jar
guice-3.0.jar
gin-1.5.0.jar
gin-1.5-post-gwt-2.2.jar
gwtp-all-0.7.jar
What could be missing?

Resources