Category Archives: Error

[Solved] Oracle Error: SGA_MAX_SIZE cannot be set to more than MEMORY_TARGET

Oracle reports error: SGA_MAX_SIZE cannot be set to more than MEMORY_TARGET

When logging in to the database, you will be prompted that the database listening does not exist

Log in to the oracle account and log in to the database server to check whether the database monitoring is enabled

lsnrctl status Check the database monitoring, the result is as follows, the database service is not started.

SQL>startupSqlplus / as sysdba sqlplus interface login as dba

Start the database, the error message is

SGA_MAX_SIZE 536870912 cannot be set to more than MEMORY_TARGET 411041792

Problem analysis : In Oracle 11g, MAX(SGA+PGA)<= memory_target, when SGA is greater than memory_target, an exception may occur when using startup nomount

Processing steps: At this time, the following steps need to be performed:

SQL> create pfile=’/home/oracle/init0321.ora’ from spfile;

File created.

SQL> !vi /home/oracle/init0321.ora

Then modify:

*.memory_target=1073741824

*.sga_max_size=805306368

*.sga_target=805306368

SQL> startup pfile=’/home/oracle/init0321.ora’;

SQL> create spfile from pfile=’/home/oracle/init0321.ora’;

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup;

The database starts normally, and you can log in to the database using the tool normally.

[Solved] yarn: Unable to load the File C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, Because running scripts is prohibited on this system.

Problem Description: yarn is used in vscode terminal to report an error

Specific error information:

yarn: Unable to load the File C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, Because running scripts is prohibited on this system. For more information, please refer to https:/go.microsoft.com/fwlink/?LinkID=135170
About_Execution_Policies.
Location Line: 1 Character: 1
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Solution:

1. Open windows PowerShell in administrator mode (the general shortcut key win + X can wake up for selection)

2. Enter get executionpolicy in PowerShell and return restricted

3. PowerShell input set executionpolicy remotesigned

4. PowerShell returns the result and enters y for setting

Execute policy changes
Execution strategies can help you prevent the execution of untrusted scripts. Changing the execution strategy may create security risks, such as https:/go.microsoft.com/fwlink/?LinkID=135170
As described in the about_Execution_Policies help topic. Do you want to change the execution strategy?
[Y] Yes (Y) [A] All Yes (A) [N] No (N) [L] All No (L) [S] Pause (S) [?] Help (default is "N"):

[Solved] C++ get file size via ifstream and set mode as ios::ate

void getSize21()
{
    ifstream wFile;
    wFile.open("log3.txt",ios::ate);
    if(!wFile.is_open())
    {
        cout<<"Open log3.txt failed!"<<endl;
    }
    streampos size;    
    size=wFile.tellg();
    cout<<"Size="<<size<<endl;
    cout<<"Finished in getSize21() and now is "<<getTimeNow()<<endl;
}

The key located at set ios::ate,ate stands for at end.
Then when size=wFile.tellg();

void getFileSize19()
{
    streampos begin,end;
    ifstream rFile("log3.txt",ios::in);
    if(!rFile.is_open())
    {
        cout<<"Open log3.txt failed!"<<endl;
    }

    begin=rFile.tellg();
    cout<<"Begin is "<<begin<<endl;
    rFile.seekg(0,ios::end);
    end=rFile.tellg();
    cout<<"End is "<<end<<endl;
    rFile.close();
    cout<<"Size is "<<(end-begin)<<" bytes"<<endl;
}

java.lang.nullpointerexception: cannot unbox null value [How to Solve]

Solution: first, locate the key sentence according to the error report

list<charginPileVO>......

Then the breakpoint and add this sentence to watch will show a real exception: Java.Lang.nullpointerexception: cannot unbox null value
because the object is empty when unpacking, an error is reported when unpacking. The basic type from integer object to int will be unpacked automatically. And integer is empty, so an error is reported

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Error when elasticsearch is started:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

It means that the value of the virtual memory limit is set too small, at least 262144

Temporary method:

sysctl -w vm.max_map_count=262144

Permanent method:

vim /etc/sysctl.conf

Add a row:

vm.max_map_count=262144

Update configuration

sysctl -p

[Solved] Error: unable to find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain

About zoomeeper decompressing the compressed package in windows, an error occurs when starting zoomeeper

Error: unable to find or load main class org apache.zookeeper.server.quorum.QuorumPeerMain

Eliminate the data path problem. The error is that the class package cannot be found and the jar package folder lib is missing

To solve the problem, first configure the directory where the configuration file data is stored, and copy and modify it in the conf folder

Modify data path

The key to error reporting is

The first one has no lib files. You need to unzip the second one, copy and paste lib into the zookeeper directory where the first one is unzipped.

[Solved] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)

When compiling a java program using Maven’s Tomcat control, the error {failed to execute goal Is reported org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project **-web: Failed to clean project: Failed to delete E:\**\target\tomcat\logs\access_log

Such errors

This error usually occurs because you have started another Tomcat process or run javaw Exe process, resulting in an error.

Solution:

1. Click x to close the failed console page (if it is run multiple times, the program console will only be placed here)

After closing, you should see the small red square. Click to make the Tomcat process or run javaw Exe process stopped.

Just recompile.

——————————–

If the above is not enough, go to the task manager} process to find the process (the last column is the name), end this, and then run the project.

[Solved] Spring Error: java.sql.SQLException: Access denied for user ‘${user}’@’localhost’ (using password: YES)

Spring properties configuration file problem

error message

Spring loads JDBC Error in properties content, original configuration file:

Error message:

Solution:

When connecting to the database, the role name of root should be root@localhost. The role name of root reporting error here is Sang@localhost , sang here is the user name of idea. When idea loads root, it automatically replaces root with sang, so use Sang@localhost An error will be reported when connecting to the database.

Solution 1: modify the configuration file to

driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/hellospring?serverTimezone=UTC
user=root
password=123456

Modification method 2: modify the configuration file to

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hellospring?serverTimezone=UTC
jdbc.username=root
jdbc.password=123456