Tag Archives: Report an error

[error reported] [Python] [Matplotlib] importerror: failed to import any QT binding

error message

ImportError: Failed to import any qt binding

complete error message:

Traceback (most recent call last):
  File "/home/xovee/Desktop/codes/www20/plot/cascade_plot.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2355, in <module>
    switch_backend(rcParams["backend"])
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/pyplot.py", line 221, in switch_backend
    backend_mod = importlib.import_module(backend_name)
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt4agg.py", line 5, in <module>
    from .backend_qt5agg import (
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 11, in <module>
    from .backend_qt5 import (
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py", line 15, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 13, in <module>
    from matplotlib.backends.qt_compat import QtGui
  File "/home/xovee/miniconda3/envs/tf-2.0-a0/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py", line 158, in <module>
    raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding

environment

  • Ubuntu 18.4 LTS
  • Python 3.6
  • Matplotlib 3.1.1

    solution

    pip install PyQt5
    

    <标题>引用

      <> Foad。(2018年11月22日)。导入任何qt绑定、Python – Tensorflow失败。李从https://stackoverflow.com/questions/52346254/importerror-failed-to-import-any-qt-binding-python-tensorflow获取

Failed to instantiate org.mybatis.spring.SqlSessionTemplate Constructor threw exception

2020-05-26 17:17:44.455 ERROR 752 --- [main] o.s.b.SpringApplication                  815 : Application startup failed org.springframework.beans.factory.Bean
CreationException: Error creating bean with name 'xxxMapperScannerConfigurer': Cannot create inner bean 'SqlSessionTemplate' of type [org.mybati
s.spring.SqlSessionTemplate] while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: E
rror creating bean with name 'SqlSessionTemplate#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanIns
tantiationException: Failed to instantiate [org.mybatis.spring.SqlSessionTemplate]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1531)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
        at com.xxx.xxx.recall.rpc.Main.main(Main.java:35)
        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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SqlSessionTemplate#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.SqlSessionTemplate]: Constructor threw exception; nested exception is java.lang.NullPointerException
...skipping...
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
        at com.xxx.xxx.recall.rpc.Main.main(Main.java:35)
        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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SqlSessionTemplate#1': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.SqlSessionTemplate]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:279)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
        ... 26 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.mybatis.spring.SqlSessionTemplate]: Constructor threw exception; nested exception is java.lang.NullPointerException
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        ... 31 more
Caused by: java.lang.NullPointerException
        at org.mybatis.spring.SqlSessionTemplate.<init>(SqlSessionTemplate.java:94)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
        ... 33 more

reason:

database JDBC link failed, check whether the user name and password are correct, I here because the password copy was wrong, resulting in.

IDEA报Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA

IDEA Failed to save Settings. Please restart IntelliJ IDEA
said the solution is to uninstall a “identifier Highlighter” plug-in, but my IDEA does not have this plug-in.
after Google finally found a solution.

solution

first make sure you have read/write access to the config file

if the permissions are okay and the error is still reported, move on to the next step.

view log file

find the cause of the error, which may vary from person to person. Therefore, the solution is different.

2017-11-15 17:20:55,720 [ 196716]   WARN - mponents.impl.stores.StoreUtil - Save settings failed 
java.lang.RuntimeException: java.lang.Exception: Cannot get RunManager component state
    at com.intellij.util.ExceptionUtil.rethrow(ExceptionUtil.java:179)
    at com.intellij.util.lang.CompoundRuntimeException.throwIfNotEmpty(CompoundRuntimeException.java:148)
    at com.intellij.configurationStore.ComponentStoreImpl.save(ComponentStoreImpl.kt:199)
    at com.intellij.openapi.components.impl.stores.StoreUtil.save(StoreUtil.java:49)
    at com.intellij.openapi.project.impl.ProjectImpl.save(ProjectImpl.java:349)
    at com.intellij.openapi.components.impl.stores.StoreUtil.saveDocumentsAndProjectsAndApp(StoreUtil.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl.saveAll(ApplicationImpl.java:1437)
    at com.intellij.ide.SaveAndSyncHandlerImpl.saveProjectsAndDocuments(SaveAndSyncHandlerImpl.java:126)
    at com.intellij.ide.SaveAndSyncHandlerImpl$2.a(SaveAndSyncHandlerImpl.java:94)
    at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:86)
    at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:109)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:118)
    at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
    at com.intellij.ide.SaveAndSyncHandlerImpl$2.onFrameDeactivated(SaveAndSyncHandlerImpl.java:92)
    at com.intellij.ide.FrameStateManagerImpl.a(FrameStateManagerImpl.java:84)
    at com.intellij.ide.FrameStateManagerImpl.access$500(FrameStateManagerImpl.java:32)
    at com.intellij.ide.FrameStateManagerImpl$2.a(FrameStateManagerImpl.java:70)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
    at com.intellij.util.Alarm$Request.runSafely(Alarm.java:417)
    at com.intellij.util.Alarm$Request.access$700(Alarm.java:344)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:384)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:314)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:416)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:821)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:649)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.Exception: Cannot get RunManager component state
    at com.intellij.configurationStore.ComponentStoreImpl.save(ComponentStoreImpl.kt:166)
    ... 38 more
Caused by: java.lang.RuntimeException: Cannot save scheme workspace/Jetty Server: jetty (level: WORKSPACE)
    at com.intellij.configurationStore.SchemeManagerImpl.save(SchemeManagerImpl.kt:535)
    at com.intellij.configurationStore.Scheme_implKt.save(scheme-impl.kt:154)
    at com.intellij.execution.impl.RunManagerImpl.getState(RunManagerImpl.kt:500)
    at com.intellij.execution.impl.RunManagerImpl.getState(RunManagerImpl.kt:63)
    at com.intellij.configurationStore.ComponentStoreImpl.a(ComponentStoreImpl.kt:227)
    at com.intellij.configurationStore.ComponentStoreImpl.save(ComponentStoreImpl.kt:159)
    ... 38 more

I found this sentence:

under Caused by: Java. Lang. RuntimeException: always save scheme workspace/Jetty Server: Jetty (level: workspace)

is my jetty configuration problem because I don't need jetty, so I temporarily removed the jetty related configuration.

problem solved, no more annoying prompts.

Exception in thread “main“ java.lang.ClassCastException: com.sun.proxy.$Proxy8 cannot be cast to XXX

:
note that the following two errors may be caused by not properly configuring the values of proxy-target-class:
error 1 : No qualifying bean of type ‘com. PJH. Service. Imp. ServiceImp’ available
error : The Exception in the thread “main” Java. Lang. ClassCastException: com. Sun. Proxy. $Proxy8 always be cast to XXX — — — — — — — dynamic proxy (proxy – target – the meaning of the class attribute)

this means roughly : no type is’ com. PJH. Service. Imp. ServiceImp “qualified bean available
H2> why?

proxy: this is caused by not configuring proxy-target-class
proxy-target-class has two values: true/false
determines whether a proxy is created based on the interface or based on the class .
if the proxy-target-class attribute value is set to true, then the class-based proxy will come into play (in which case the cglib library is required). If the proxy-target-class attribute value is set to false or this property is omitted, the standard JDK interface-based proxy will come into effect.

I use this code for:
statement : serviceImp is to implement the service interface is the parent of the
serviceImp bean1 = (serviceImp) classPathXmlApplicationContext. GetBean (serviceImp. Class);
and serviceImp is a class, not an interface
, but I did not configure proxy-target-class attribute when I was woven in, the default is proxy-target-class=false, this is based on the interface proxy, so the error is
, which is the content of the error : No type is’ com. PJH. Service. Imp. ServiceImp “qualified bean available

 <aop:config>
      <aop:pointcut id="txPointcut" expression="execution(* com.pjh.service.Imp.serviceImp.*(..))"/>
      <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>
  </aop:config>

solution

solution 1:

when I change the value of the code’s proxy-target-class to true, I will not report an error, that is, I will change the class-based proxy

<aop:config proxy-target-class="true">
      <aop:pointcut id="txPointcut" expression="execution(* com.pjh.service.Imp.serviceImp.*(..))"/>
      <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>
  </aop:config>

To change the passed parameters to interface, there is no need to add proxy-target-class, because the default is false, which is based on the interface proxy
declaration : serivce is the parent class of serviceImp is an interface

 service bean1 =(service) classPathXmlApplicationContext.getBean(service.class);

above is the error encountered today and its solution, if there is help, please pay attention to thumb up, this is the greatest support for bloggers, I will often update my study notes and problems encountered