Author Archives: Robins

error: Vue Project lang=“less“ Error [How to Solve]

Error reason:

The version of the less-loader is too high. Uninstall and reinstall version 7.0

1. Install the less-loader command: npm install — save dev less loader less

Solution:

1. Uninstall command: npm uninstall — save less loader

2 The command to install version 7.0: npm install – D [email protected]

After executing the above command, continue to check the less-loader and less versions in the package.json file, the less-loader version has been reduced to 7.X. Just re-run the project without errors. If the version has not changed after installation, you need to manually change the less-loader and less versions in the package.json file to version 7.0

[Solved] PyTorch Lightning Error: KeyError: ‘hidden_states‘

How to Solve PyTorch Lightning error KeyError: ‘hidden_ states’

Problem description: PyTorch Lightning error: KeyError: ‘hidden_ states’.

model = BertModel.from_pretrained('bert-base-uncased')

Solution: add a parameter after the above code, config=BertConfig.from_pretrained(‘bert-base-uncased’,output_hidden_states=True), as below:

model = BertModel.from_pretrained('bert-base-uncased', config=BertConfig.from_pretrained('bert-base-uncased',output_hidden_states=True))

[Solved] Linux error E: dpkg is broken, you must manually run ‘sudo dpkg –configure -a’ to resolve this issue

Executes the Linux commandsudo apt install curland reports an error:

E: dpkg is interrupted. You must manually run ‘sudo dpkg — configure – a’ to solve this problem

System version: Ubuntu 20.04 LTS

Solution: three-step command line

sudo rm /var/lib/dpkg/updates/*
sudo apt-get update
sudo apt-get upgrade

[Solved] React Error: ReactDOM.render is no longer supported in React 18.

Error message:

ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it’s running React

 

ReactDOM.React 18 no longer supports rendering. Use createRoot instead. Before you switch to the new API, your application will behave as if it is running React 17

Reason:
React team has launched the latest version of 18.0, in which React 18 no longer supports ReactDOM.render

Console error:

Solution:
Use createRoot in the index.js file

import React from 'react'
import ReactDOM from 'react-dom'
import TopList from './TopList'

// Use createRoot
import { createRoot } from 'react-dom/client';
const container = document.getElementById('root')
const root = createRoot(container)
root.render(<TopList/>)

// report error
// ReactDOM.render( < TopList /> , document.getElementById('root'))

 

API Failed to Connect phoenix Error: java.sql.SQLException: ERROR 726 (43M10): Inconsistent namespace mapping properties

The error is reported as follows:

java.sql.SQLException: ERROR 726 (43M10):  Inconsistent namespace mapping properties. Cannot initiate connection as SYSTEM:CATALOG is found but client does not have phoenix.schema.isNamespaceMappingEnabled enabled
	at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:494)
	at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:1113)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1501)
	at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2721)
	at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1114)
	at org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:192)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:408)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:391)
	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:390)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1806)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2569)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2532)
	at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2532)
	at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
	at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150)
	at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1596)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1662)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:929)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1311)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1307)
	at com.atguigu.app.func.MyBroadcastFunction.CheckAndCreate(MyBroadcastFunction.java:72)
	at com.atguigu.app.func.MyBroadcastFunction.processBroadcastElement(MyBroadcastFunction.java:65)
	at com.atguigu.app.func.MyBroadcastFunction.processBroadcastElement(MyBroadcastFunction.java:19)
	at org.apache.flink.streaming.api.operators.co.CoBroadcastWithNonKeyedOperator.processElement2(CoBroadcastWithNonKeyedOperator.java:118)
	at org.apache.flink.streaming.runtime.io.StreamTwoInputProcessorFactory.processRecord2(StreamTwoInputProcessorFactory.java:221)
	at org.apache.flink.streaming.runtime.io.StreamTwoInputProcessorFactory.lambda$create$1(StreamTwoInputProcessorFactory.java:190)
	at org.apache.flink.streaming.runtime.io.StreamTwoInputProcessorFactory$StreamTaskNetworkOutput.emitRecord(StreamTwoInputProcessorFactory.java:291)
	at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:134)
	at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:105)
	at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:66)
	at org.apache.flink.streaming.runtime.io.StreamTwoInputProcessor.processInput(StreamTwoInputProcessor.java:98)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:419)
	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:204)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:661)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:623)
	at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:776)
	at org.apache.flink.runtime.taskmanager.Task.run(Task.java:563)
	at java.lang.Thread.run(Thread.java:748)

Prerequisites: The following configuration is available in the hbase-site.xml file, which must not be deleted later, and the resource folder of the API, hbase, and phoenix are already configured

<! -- Note: In order to enable the mapping of hbase's namespace and phoenix's schema, you need to add this configuration file to your application, and also on linux services, you need to add the above two configurations to the hbase-site.xml configuration files of hbase and phoenix, and use xsync for synchronization ( This is explained in the documentation in section 1).-->
    <property>
        <name>phoenix.schema.isNamespaceMappingEnabled</name>
        <value>true</value>
    </property>

    <property>
        <name>phoenix.schema.mapSystemTablesToNamespace</name>
        <value>true</value>
    </property>

Reason: The hbase-site.xml file in resource is not read, manually copy it to target\generated-sources folder.

Problem-solving!

[Solved] yii Frame Error: Warning!symlink() has been disabled for security reasons

Error Messages:

A symlink for "/www/wwwroot/www.atepaoutdoors.com/lib/web/mage/requirejs/mixins.js" can't be created and placed to "/www/wwwroot/www.atepaoutdoors.com/pub/static/frontend/Zemez/theme115/en_US/mage/requirejs/mixins.js". Warning!symlink() has been disabled for security reasons

When deploying the PHP project to the PHP environment on the new server, an error occurs: scandir() symlink() has been disabled for security reasons.

 

How to Solve:

In this case, just go to the PHP installation directory, find php.ini, ctrl+F and search for “disable_functions”, and find the following property configuration.

disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pls. restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen

Delete scandir and symlink from “disable_functions”, save the php.ini file, restart the service, and refresh the page. This will solve the error problem.

[Solved] STM8L151 IAR Project Compile Error: Fatal Error[Pe035]: #error directive: “Please select first the target STM8L…

Project scenario:

STM8L151G4XX MCU IAR engineering compilation error


Problem description

Fatal Error[Pe035]: #error directive: “Please select first the target STM8L device used in your application (in stm8l15x.h file)”
Open stm8l15x.h, and we can see the following code:

#if !defined (STM8L15X_MD) && !defined (STM8L15X_MDP) && !defined (STM8L15X_HD) && !defined (STM8L15X_LD) \
&& !defined (STM8L05X_LD_VL) && !defined (STM8L05X_MD_VL) && !defined (STM8L05X_HD_VL) && !defined (STM8AL31_L_MD)
 #error "Please select first the target STM8L device used in your application (in stm8l15x.h file)"
#endif
/* Uncomment the line below according to the target STM8L15x device used in your
   application
  */
/* #define STM8L15X_LD */     /*!< STM8L15X_LD: STM8L15x Low density devices */
/* #define STM8L15X_MD */     /*!< STM8L15X_MD: STM8L15x Medium density devices */
/* #define STM8L15X_MDP */    /*!< STM8L15X_MDP: STM8L15x Medium density plus devices */
/* #define STM8L15X_HD */     /*!< STM8L15X_HD: STM8L15x/16x High density devices */
/* #define STM8L05X_LD_VL */  /*!< STM8L05X_LD_VL: STM8L051xx3 Low density value line devices */
/* #define STM8L05X_MD_VL */  /*!< STM8L05X_MD_VL: STM8L052xx6 Medium density value line devices */
/* #define STM8L05X_HD_VL */  /*!< STM8L05X_HD_VL: STM8L052xx8 High density value line devices */
/* #define STM8AL31_L_MD */   /*!< STM8AL31_L_MD: STM8AL3x Medium density devices */


/*  Tip: To avoid modifying this file each time you need to switch between these
        devices, you can define the device in your toolchain compiler preprocessor.

 - Low density STM8L15x devices are STM8L151C3, STM8L151K3, STM8L151G3, STM8L151F3,
   STM8L151C2, STM8L151K2, STM8L151G2 and STM8L151F2 microcontrollers where the 
   Flash memory density ranges between 4 and 8 Kbytes.
 - Medium density STM8L15x devices are STM8L151C4, STM8L151C6, STM8L152C4,
   STM8L152C6, STM8L151K4, STM8L151K6, STM8L152K4, STM8L152K6, STM8L151G4,
   STM8L151G6, STM8L152G4 and STM8L152G6 microcontrollers where the Flash memory
   density ranges between 16 and 32 Kbytes.
 - Medium density Plus devices are STM8L151R6, STM8L152R6 microcontrollers where
  the Flash memory density is fixed and equal to 32 Kbytes and a wider range of
  peripheral than the medium density devices.
 - High density STM8L15x devices are STM8L151x8, STM8L152x8, STM8L162R8 and STM8L162M8
   microcontrollers where the Flash memory density is fixed and equal to 64 Kbytes with 
   the same peripheral set than Medium Density Plus devices.
 - Value line low density STM8L05xx devices are STM8L051x3 microcontrollers
   with 8-KB Flash
 - Value line medium density STM8L05xx devices are STM8L052x6 microcontrollers 
   with 32-KB Flash
 - Value line high density STM8L05xx devices: STM8L052x8 microcontrollers
   with 64-KB Flash
 - Medium density STM8AL31xx/STM8AL3Lxx devices: STM8AL3168, STM8AL3166, 
   STM8AL3148,STM8AL3146, STM8AL3138, STM8AL3136, STM8AL3L68, STM8AL3L66, 
   STM8AL3L48, STM8AL3L46 microcontrollers with 8-KB, 16-KB or 32-KB Flash
 */

Solution:

Method 1:
Modify directly in the stm8l15x.h file, delete the comment symbols of the macro definition needed, take STM8L151G4XX as an example, according to the above description, the model belongs to Medium density.

/* Uncomment the line below according to the target STM8L15x device used in your
   application
  */
/* #define STM8L15X_LD */     /*!< STM8L15X_LD: STM8L15x Low density devices */
 #define STM8L15X_MD   		/*!< STM8L15X_MD: STM8L15x Medium density devices */
/* #define STM8L15X_MDP */    /*!< STM8L15X_MDP: STM8L15x Medium density plus devices */
/* #define STM8L15X_HD */     /*!< STM8L15X_HD: STM8L15x/16x High density devices */
/* #define STM8L05X_LD_VL */  /*!< STM8L05X_LD_VL: STM8L051xx3 Low density value line devices */
/* #define STM8L05X_MD_VL */  /*!< STM8L05X_MD_VL: STM8L052xx6 Medium density value line devices */
/* #define STM8L05X_HD_VL */  /*!< STM8L05X_HD_VL: STM8L052xx8 High density value line devices */
/* #define STM8AL31_L_MD */   /*!< STM8AL31_L_MD: STM8AL3x Medium density devices */

Method 2:
Set the path: Options->C/C++ Compiler->Preprocessor-Defined symbols

Android activity Fail to Switch to androidx AppCompatActivity Error

java.lang.IllegalStateException: You need to use a Theme. AppCompat theme (or descendant) with

Error reason:

1, style.xml file has properties that are inherited from ordinary android, however, your activity has inherited AppCompatActivity, so the properties of style should also be changed to the properties below androidx.

Solution:

Find the properties of the normal android package in the style.xml file and replace them with the properties of androidx.

IDEA Maven Fail to Download Dependencies Error: ERROR – #org.jetbrains.idea.maven – Cannot reconnect.

Full Error Log:

2022-09-29 16:35:52,637 [  41134]  ERROR -      #org.jetbrains.idea.maven - Cannot reconnect. 
java.lang.RuntimeException: Cannot reconnect.
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
	at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:526)
	at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:394)
	at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:103)
	at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:62)
	at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:655)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:555)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:500)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:461)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:432)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:60)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:132)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:32)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:107)
	at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:449)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is: 
	java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:161)
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:66)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
	at org.jetbrains.idea.maven.server.MavenServerManager.lambda$applyProfiles$3(MavenServerManager.java:526)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
	... 20 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
	at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at com.intellij.execution.rmi.RemoteProcessSupport.lambda$acquire$2(RemoteProcessSupport.java:260)
	at com.intellij.openapi.util.ClassLoaderUtil.runWithClassLoader(ClassLoaderUtil.java:66)
	at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:231)
	at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:258)
	at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:164)
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:158)
	... 24 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at java.net.Socket.connect(Socket.java:538)
	at java.net.Socket.<init>(Socket.java:434)
	at java.net.Socket.<init>(Socket.java:211)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
	... 34 more

Solution:
1.IntelliJ IDEA –> Preferences –> Build,Execution,Deployment –> Build Tools –> Maven –> Importing –>JDK for importer select the JDK version that We installed

If the problem is not solved, perform the following two actions
2.maven -> Importing -> VM options for importer
-Xmx768m -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Djava.net.preferIPv4Stack=true

3. maven -> Runner -> VM Options
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Djava.net.preferIPv4Stack=true

Here the JRE originally selected Project JDK, I changed to JAVA_HOME, I do not know if there is no effect, and finally is successful without error.

Driver error 11: System 0.500000: CAN 1 : Message with ID = 630 could not be sent. Driver error 11 in TransmitCANFrame

System 0.500000: CAN 1 : Message with ID = 630 could not be sent. Driver error 11 in TransmitCANFrame

Driver error 11

1. Select Real Bus mode when Canoe physical device is connected

2. Check the network hardware configuration. If the current can channel is abnormal, click the Driver in the lower right corner to set it

3. Terminal resistance

Check whether the terminal resistance is faulty.

4. Check channel mapping