Category Archives: How to Fix

java.lang.IllegalArgumentException: Receiver not registered:

Problem: the radio receiver is not registered;

Recurrence: register the broadcast in oncreate() and de register in onstop(). In this activity, the device enters the screen saver state and executes onstop(). At this time, the broadcast has been de registered. Click the screen to return to the interface and no longer execute oncreate(). If you enter the screen saver interface again, an exception will be generated.

Solution: if receiver registration and de registration are placed in onresume and onpause, these two processes will definitely appear in pairs, which can avoid this exception.

Solutions to the problem of vulnerable missing firmware in Ubuntu

Question: potentially missing firmware/lib/firmware/RTL_ NIC/rtl8125a-3.fw for module r8169
solution:
1. Enter the following address, the firmware file is very comprehensive, and find the version suitable for you

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/

2. Switch to the directory that just reported that there is no firmware, and there are few files in the download area

cd /lib/firmware/rtl_nic/
sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/rtl8125a-3.fw

3. Check again

sudo update-initramfs -u

“21442;” 32771e; https://www.cnblogs.com/magikos/p/Possible-missing-firmware.html

Caused by: java.lang.ClassNotFoundException: com.alibaba.nacos.api.naming.NamingMaintainService

About the exception caused by: java.lang.classnotfoundexception: com.alibaba.nacos.api.naming.namingmaintainservice

I recently reported this exception when I started the project with springboot. I searched the Internet for various reasons and finally found that:

<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>1.2.0</version>
</dependency>

Plus the above dependence to solve this problem, troubled for more than an hour, wait to calm down just want to understand, record here!!!

React create project error

npm ERR! code 1
npm ERR! path /Users/tangwenjing/Html/imooc/my-app1/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! /bin/sh: pkg-config: command not found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/tangwenjing/Html/imooc/my-app1/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.4.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/tangwenjing/Html/imooc/my-app1/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/tangwenjing/Html/imooc/my-app1/node_modules/canvas
npm ERR! gyp ERR! node -v v14.17.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tangwenjing/.npm/_logs/2021-06-03T09_55_42_223Z-debug.log

Solution: install nodejs installation package directly because of the NPM version problem

Android notex Q9: pop up settings can be touched

If it is set to true, it will still be dropped by miss when clicking outside. Why?

/**
 * <p>Controls whether the pop-up will be informed of touch events outside
 * of its window.  This only makes sense for pop-ups that are touchable
 * but not focusable, which means touches outside of the window will
 * be delivered to the window behind.  The default is false.</p>
 *
 * <p>If the popup is showing, calling this method will take effect only
 * the next time the popup is shown or through a manual call to one of
 * the {@link #update()} methods.</p>
 *
 * @param touchable true if the popup should receive outside
 * touch events, false otherwise
 *
 * @see #isOutsideTouchable()
 * @see #isShowing()
 * @see #update()
 */
public void setOutsideTouchable(boolean touchable) {
mOutsideTouchable = touchable;
}

According to the interpretation of the official API, when focusable = false, setting setoutsidetouchable is meaningful. If focusable = true is set, it is meaningless, because focusable = true will take away the focus event. If outside can’t get the focus, then the touch of outside is useless.

So how to set focusable = true and keep external clicks from being ignored?

var isForceDismiss = false
override fun dismiss() {
if (isForceDismiss) {
super.dismiss()
isForceDismiss = true
    }
}

Rewrite the Miss method of popupwindow and make a logical judgment

Gradle tasks disappeared after upgrading Android stuido 4.2?

Recently, many people asked that after upgrading Android studio 4.2, tasks could not be seen in the gradle window

Before 4.2
4.2, there were only dependencies and no tasks

The answer is found in the official issue:

https://issuetracker.google.com/issues/185420705

Gradle task list is large and slow to populate in Android projects. This feature by default is disabled for performance reasons. You can re-enable it in: Settings | Experimental | Do not build Gradle task list during Gradle sync.

Gradle tasks is closed by default due to performance problems. You can open it in the following ways:

File -> Settings -> Experimental

Remove the check below

Do not build Gradle task list during Gradle sync

After re engineering sync, you can see gradle tasks.

File C:\Users\admin\Documents\WindowsPowerShell\profile.ps1 cannot be loaded because running scripts

CONDA activate error

File C:\Users\admin\Documents\WindowsPowerShell\profile.ps1 cannot be loaded because running scripts is disabled on this system.

resolvent

Refer to the answer of stackoverflow
the steps are as follows:

    open the PowerShell in administrator mode. If you don’t know how to open it as an administrator, you can press win + R , then enter shell , and then press Ctrl + shift + Enter . typing

    Set-ExecutionPolicy RemoteSigned
    

This should allow your system to run CONDA scripts. If you want to set it back, type it in the PowerShell administrator mode

Set-ExecutionPolicy Restricted

Asp.netcore project publishing and deploying to IIS needs aspnetcore module v2

PS: the. Net framework can be directly published and can be accessed normally when specified by IIS. However, the aspnetcore project is slightly different. An additional module needs to be installed. If it is not installed, an HTTP error of 500.19 – internal server error will be reported.

1. Official version address: https://dotnet.microsoft.com/download/dotnet

Find the version 3.1 or 5.0 and click to enter.

2. Page   IIS runtime support (asp.net core module V2), that is, IIS running support needs modules. In the windows column, click download.

3. For aspnetcore 3.1, Download dotnet-hosting-3.1.15-win.exe and install it. Then you can see aspnetcore module V2 in the module of IIS

Oracle can’t start the database due to deleting DBF file by mistake

Statement

First of all, this method can not recover the data. The purpose of this paper is to restore the database to normal, data can be discarded, mostly in the test environment.

Phenomenon

Delete the data file of the table space, resulting in an error when shutting down the database and the startup database, as follows:

SQL> startup;
ORACLE instance started.


Total System Global Area 4008546304 bytes
Fixed Size		    2259440 bytes
Variable Size		  872416784 bytes
Database Buffers	 3120562176 bytes
Redo Buffers		   13307904 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/data/oracle/oradata/orclstd/PSR1.dbf'

Because an 8K table space can only have a maximum of 32g, this table space specifies multiple DBF files, and several DBF files are deleted at one time. There is an operation [drop user XXX cascade;], Delete the user’s, and the table space does not exist, but [startup;] Database, or error. Use the following statement to close the data file:

SQL> alter database datafile '/data/oracle/oradata/orclstd/PSR1.dbf' offline drop;


Database altered.


SQL>  alter database open;
 alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/data/oracle/oradata/orclstd/PSR2.dbf'




SQL> alter database datafile '/data/oracle/oradata/orclstd/PSR2.dbf' offline drop;


Database altered.


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
ORA-01110: data file 9: '/data/oracle/oradata/orclstd/psr1_02.dbf'




SQL>  alter database datafile '/data/oracle/oradata/orclstd/psr1_02.dbf' offline drop;


Database altered.


SQL> alter database open;


Database altered.


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.


Total System Global Area 4008546304 bytes
Fixed Size		    2259440 bytes
Variable Size		  872416784 bytes
Database Buffers	 3120562176 bytes
Redo Buffers		   13307904 bytes
Database mounted.
Database opened.
SQL> exit

If other dBfs affect the database startup, execute [alter database open;] When the error is detected, continue the cycle until no error is detected.