Author Archives: Robins

[Solved] This.getoptions is not a function when installing sass loader and less loader

After installing sass loader and less loader, we report module build failed: typeerror: this.getoptions is not a function with lang = “less” or lang = “sess”

less:

npm install [email protected] --save-dev 

Version reduced to 5.0.0

sess:

npm uninstall sass-loader // unisntall current version
 
npm install [email protected] --save-dev

Reinstall version 7.3.1

[Solved] In case of “transactionmanager” while setting bean property “transactionmanager” error

When learning to write XML transactions in spring, you can refer to ‘transactionmanager’ while setting bean property ‘transactionmanager’

Warning: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [D:\Codeworkstation\IDEAGuigu\Spring5\spring5_tedemo1\out\production\spring5_tedemo1\com\atgui\spring\service\UserService.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txadvice': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' available

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [D:\Codeworkstation\IDEAGuigu\Spring5\spring5_tedemo1\out\production\spring5_tedemo1\com\atgui\spring\service\UserService.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txadvice': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' available

XML configuration transaction code

 <!-- Create the transaction manager - >
    <bean id="dataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<! -- Inject data source -- >
        <property name="dataSource" ref="dataSource"></property>
    </bean>

    <! -2 Configuration Notifications-->
    <tx:advice id="txadvice">
        <! -- Configure transaction parameters -->
        <tx:attributes>
            <! -- Specify which rule's method to add a transaction on top of -->
            <tx:method name="account" propagation="REQUIRED"/>
            <! --<tx:method name="account*"/>-->
        </tx:attributes>
    </tx:advice>

    <! -3 Configuring entry points and cut-planes -->
    <aop:config>
        <! -- Configure entry points -->
        <aop:pointcut id="pt" expression="execution(* com.atgui.spring.service.UserService.*(...))" />
        <! --configuration cutscene ->
        <aop:advisor advice-ref="txadvice" pointcut-ref="pt"/>
    </aop:config>

Service layer code

@Service
//@Transactional
public class UserService {

    @Autowired
    private UserDao userDao;

    public void account(){

        //Reduce money
        userDao.reducemo();
        int i=13/0;
        //Increase money
        userDao.addmo();
    }
}

The above error appears when running

You can modify the error code section in XML

 <!-- Creating a Transaction Manager-->
    <bean id="dataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!--        Injecting data sources-->
        <property name="dataSource" ref="dataSource"></property>
    </bean>

Change the above id = “datasourcetransactionmanager” to id = “transactionmanager”\

That’s it

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!--        Injecting data sources-->
        <property name="dataSource" ref="dataSource"></property>
    </bean>
``

This will solve the above problem


How to Solve Turtle_tf Error in ROS

Software configuration

Operating system: Ubuntu 16.04
ROS version: kinetic
Python version: python2.7, python3.5, python3.8

Function package and routine

Refer to “ROS robot development and practice” section 4.2.3 using turtle simulator routine turtle_ TF, execute the command:

roslaunch turtle_tf turtle_tf_demo.launch

report errors

Traceback (most recent call last):
   File "/opt/ros/kinetic/lib/turtle_tf/turtle_tf_broadcaster.py", line 37, in <module>
        import tf   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>
        from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>     
        from tf2_py import *   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>     
        from ._tf2 import * ImportError: dynamic module does not define module export function (PyInit__tf2) Traceback (most recent call last):   
   File "/opt/ros/kinetic/lib/turtle_tf/turtle_tf_broadcaster.py", line 37, in <module>     
        import tf   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>    
        from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>     
        from tf2_py import *  
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>     
        from ._tf2 import * ImportError: dynamic module does not define module export function (PyInit__tf2) 
Traceback (most recent call last):   
   File "/opt/ros/kinetic/lib/turtle_tf/turtle_tf_listener.py", line 37, in <module>     
        import tf   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>     
        from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException  
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>     
        from tf2_py import *   
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>     
        from ._tf2 import * ImportError: dynamic module does not define module export function (PyInit__tf2) 

find by hard and thorough search

At the beginning, try the methods mentioned on the Internet, such as modifying the python version and soft link, and input on the terminal:

python --version

After getting python2.7, the running routine still reports an error, so I want to find the reason according to the error

Find the error report file from the first line of the error report:

/opt/ros/kinetic/lib/turtle_tf/turtle_tf_broadcaster.py

Turn on Turbo_ tf_ After editing the broadcast.py file, it is found that the first line of the file states:

#!/usr/bin/env python

Input in the terminal:

/usr/bin/env python

It shows the python version pointed by the python variable in the environment variable, which is different from the routine’s requirement of python2.7.

Problem solving: modify Python in environment variables

//Modify the priority of different python versions
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

//Manual priority selection
sudo update-alternatives --config python

*Remember to input “/ usr/bin/env Python” in the terminal to check whether the modification is successful.

After the modification is successful, run the routine again to see two little turtles. The little turtle at the bottom moves towards the little turtle at the center.

[Solved] ORA-04063: package body “SYS.DBMS_DATAPUMP“ has errors

Due to the manual modification of the default parameter value of cluster_ok in start_job of sys.DBMS_DATAPUMP, 1 is 0, which leads to export error after successful compilation.
ORA-04063: package body “SYS.DBMS_DATAPUMP” has errors
SQL> CREATE TABLE “test”
2  (       ”   ” VARCHAR2(255), “YPID” VARCHAR2(255));
Table created.
SQL> insert into “test”  values(‘aa’,’bb’);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;

——————————————————————————–
YPID
——————————————————————————–
aa
bb

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0

[oracle@oem ~]$ expdp jyc/jyc@jyc dumpfile=t.dmp logfile=t.log directory=dmp tables=jyc.test
Export: Release 19.0.0.0.0 – Production on Tue Jun 29 16:54:57 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
UDE-04063: operation generated ORACLE error 4063
ORA-04063: package body “SYS.DBMS_DATAPUMP” has errors
ORA-06508: PL/SQL: could not find program unit being called: “SYS.DBMS_DATAPUMP”
ORA-06512: at line 1
[oracle@oem ~]$ sqlplus jyc/jyc@jyc
SQL*Plus: Release 19.0.0.0.0 – Production on Tue Jun 29 16:57:00 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Last Successful login time: Tue Jun 29 2021 16:54:57 +08:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0
SQL> select * from dba_errors where OWNER=’SYS’ and NAME=’DBMS_DATAPUMP’;
OWNER
——————————————————————————–
NAME
——————————————————————————–
TYPE                                     SEQUENCE       LINE   POSITION
————————————– ———- ———- ———-
TEXT
——————————————————————————–
ATTRIBUTE          MESSAGE_NUMBER
—————— ————–
SYS
DBMS_DATAPUMP
PACKAGE BODY                                    1       7294         17
OWNER
——————————————————————————–
NAME
——————————————————————————–
TYPE                                     SEQUENCE       LINE   POSITION
————————————– ———- ———- ———-
TEXT
——————————————————————————–
ATTRIBUTE          MESSAGE_NUMBER
—————— ————–
PLS-00593: default value of parameter “CLUSTER_OK” in body must match that of sp
ec
ERROR                         593
OWNER
——————————————————————————–
NAME
——————————————————————————–
TYPE                                     SEQUENCE       LINE   POSITION
————————————– ———- ———- ———-
TEXT
——————————————————————————–
ATTRIBUTE          MESSAGE_NUMBER
—————— ————–

SQL>
select * from dba_objects where status = ‘INVALID’
select owner, name, text, message_number from all_errors where owner=’SYS’;

Solution:
Execute rebuild dbms_datapump under cdb
cd $ORACLE_HOME/rdbms/admin
sqlplus/as sysdba
@dbmsdp.sql;
@utlrp.sql;
exit
Redirection is normal.
[oracle@oem admin]$ expdp jyc/jyc@jyc dumpfile=t.dmp logfile=t.log directory=dmp tables=jyc.test
Export: Release 19.0.0.0.0 – Production on Thu Jul 1 10:29:24 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
FLASHBACK automatically enabled to preserve database integrity.
Starting “JYC”.”SYS_EXPORT_TABLE_01″:  jyc/********@jyc dumpfile=t.dmp logfile=t.log directory=dmp tables=jyc.test
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/PROCACT_INSTANCE
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported “JYC”.”TEST”                                    0 KB       0 rows
Master table “JYC”.”SYS_EXPORT_TABLE_01″ successfully loaded/unloaded
******************************************************************************
Dump file set for JYC.SYS_EXPORT_TABLE_01 is:
/home/oracle/dmp/t.dmp
Job “JYC”.”SYS_EXPORT_TABLE_01″ successfully completed at Thu Jul 1 10:29:32 2021 elapsed 0 00:00:08

How to Solve Maven Error: Failure to transfer com.thoughtworks.xstream:xstream:jar:1.3.1 from https://repo.maven.ap

Report error in full: Failure to transfer com.thoughtworks.xstream:xstream:jar:1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval
of central has elapsed or updates are forced. Original error: Could not transfer artifact com.thoughtworks.xstream:xstream:jar:1.3.1 from/to central (https://repo.maven.apache.org/maven2): The operation
was cancelled.
Should be the time to download the package error, go to the repository to delete, re-download it!
After the deletion, maven clean, done!
Similar question.
Failure to transfer org.apache.maven.shared:maven-filtering:jar:1.0-beta-2 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.shared:maven-filtering:jar:1.0-beta-2 from/to central (https://
repo.maven.apache.org/maven2): The operation was cancelled.

The same method to solve, are half of the download interrupted, the reason for the package is not complete.

 

[Solved] Echarts Error: There is a chart instance already initialized on the dom!

On the current page, when you execute charts drawing for many times, the console will give a warning “there is a chart instance already initialized on the DOM”, which means: “a chart instance has been initialized on the DOM”

Solution:

Add the method of drawing ecarts to judge whether it already exists. If it exists, it can be destroyed. The code example is as follows:

data() {
	return {
		myRingChart1:null
	}
}
drawRing1() {
      if (
        this.myRingChart1 != null &&
        this.myRingChart1 != '' &&
        this.myRingChart1 != undefined
      ) {
        this.myRingChart1.dispose() //Solve the error reported by echarts dom already loaded
      }
      // Initialize the echarts instance based on the prepared dom
      this.myRingChart1 = echarts.init(this.$refs['myRingChart1'])
}

Exception on start hive: caused by: java.net.noroutetohostexception: no route to host

When we start hive, we will encounter the problem that the router is unable to connect. At this time, the most likely problem is that the firewall is turned on. At this time, we just need to turn it off. Baidu is very simple.

  Another problem may be our IP address. Let’s start all Hadoop clusters: start-all.sh,

See if there are five processes showing that if it is missing, it may be that our I IP address has changed. At this time, we need to modify the hadoop-env.sh file, CD   ~/ hadoop/etc/hadoop

vi hadoop-env.sh

Just change our IP address.

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file o

Lack of shared library, with root permission:
1. Find the installation package:
Yum whatprovides libstdc + +. So. 6

2. Install: Yum – y install libstdc+ ± 4.8.5-44.el7.i686

If you don’t have root permission, you can only install it manually:
1. Download the corresponding RPM file libstdc+ ± 4.8.5-44. EL7. I686. RPM
Add Link description

2. Send it to the server and decompress it:
directly decompress it in the user’s root directory: rpm2cpio libstdc+ ± 4.8.5-44.el7.i686.rpm | CPIO – idvm
after decompressing, the usr directory will be generated in the root directory

3. Configure environment variables (some of them are not effective at the beginning, but they are effective as follows for reference):

Encountered a problem — Python — Python 3 uses Sqlalchemy to report an error‘

situation   follow the instructions in the flash Sqlalchemy document to configure the  
SQLALCHEMY_ DATABASE_ URI = ‘ mysql://username:password@server/db ‘  
1  
after operation, MySQL reports an error importerror: no module named ‘MySQL db’.  
why  
since there is no MySQL DB module, follow the normal idea  
pip install MySQLdb  
1  
it should be able to solve this problem, but no corresponding module can be found. After checking, this is because mysql-3.23 through 5.5 and python-2.4 through 2.7 are currently supported.  
solutions  
looking for alternatives  
in Python 3, we generally use pymysql.  
implementation  
pip install PyMySQL
1  
change the database connection to  
mysql+ pymysql://username:password@server/db
1  
the next operation is normal original link: https://blog.csdn.net/zzq900503/article/details/89096311