Tag Archives: ProgrammerAH

Unable to access javax.servlet.servletexception [How to Solve]

Using idea, a spring boot project based on Maven is created. In the process of deploying the project with war package and Linux (providing JDK environment, Tomcat), when packaging, you will be prompted that javax. Servlet. ServletException
cannot be accessed

You need to remove tomcat from the web dependency
		<dependency>
		  <groupId>org.springframework.boot</groupId>
		  <artifactId>spring-boot-starter-web</artifactId>
		  <exclusions>
		    <exclusion>
		      <groupId>org.springframework.boot</groupId>
		      <artifactId>spring-boot-starter-tomcat</artifactId>
		    </exclusion>
		  </exclusions>
		</dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
 <plugin>		No web required for packaging
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
    </plugin>

[Solved] Mavenwas cached in the local repository

Today I was prompted with an error message when compiling a maven project using the command mvn compile:

 was cached in the local repository, resolution will not be reattempted until the update interval of


Cause of the problem :
By default, Maven will use the local cached repository to compile the project, for the last failed library download, maven will create xxx.lastUpdated file in ~/.m2/repository/<group>/<artifact>/<version>/ directory. Once this file exists, the dependencies will not be updated until the next nexus update. Add the following. <repositories> <repository> <id>public</id> <url>地址</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories>

[Solved] Circular view path [index]: would dispatch back to the current handler URL [] again. Che

Error report content
circular view path [index]: would dispatch back to the current handler URL// login/index] again. Check your viewresolver setup( Hint: This may be the result of an unspecified view, due to default view name generation.)

Change @ controller to @ restcontroller

The @restcontroller annotation is equivalent to the function of @ResponseBody + @ controller
without annotation, @ResponseBody or @restcontroller will set the return value to JSON format, otherwise it will automatically think that you are returning a page
in the @ controller annotation, you can return a string or a template name that matches the string, that is, directly render the view and use it with HTML pages,

In this case, the front-end and back-end requirements are relatively high. The Java back-end code should be rendered in combination with HTML. The data of the model object (or modelandview) will be used to fill in the relevant attributes in the user view, and then displayed to the browser. This process can also be called rendering

In @restcontroller, you should return an object, that is, return a user object. At this time, you can also see that the return is a JSON string corresponding to a user object without a page. The function of the front end is to use the returned JSON to parse and render the page, and the code of the Java back end is relatively free.

[Solved] ORA-00020: maximum number of processes (150) exceeded

[oracle@db ~]$ sqlplus/as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 16 15:16:06 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-00020: maximum number of processes (150) exceeded
Method 1: Change the processes parameter
To solve the ORA-00020 error, you can increase the parameter value of processes, but you need to start the database normally and log in successfully before you can modify it.
1. Firstly, log in the database successfully by adding the parameter “-prelim”.

1
2
3
4
5
[oracle@db ~]$ sqlplus -prelim/as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 16 15:22:07 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

At this point, the database can be closed and opened normally, following the following command to solve the problem.

1
2
3
4
5
6
7
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter processes;
SQL> alter system set processes=1000 scope=spfile;
SQL> startup force;
SQL> show parameter processes;
SQL> exit;

2.Start-up example

1
2
3
4
5
6
7
8
9
SQL> startup
ORACLE instance started.
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0SQL> exit
Disconnected from ORACLE

It means that it is already open.
3. Modify the parameters

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[oracle@db ~]$ sqlplus/as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 16 15:22:35 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter process

NAME                                 TYPE        VALUE
———————————— ———– ——————————
aq_tm_processes                      integer     1
cell_offload_processing              boolean     TRUE
db_writer_processes                  integer     2
gcs_server_processes                 integer     0
global_txn_processes                 integer     1
job_queue_processes                  integer     1000
log_archive_max_processes            integer     4
processes                            integer     150
processor_group_name                 string
SQL> select status from v$instance;

STATUS
————
STARTED

SQL> alter system set processes=1000 scope=spfile;

System altered.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

4. Restart the instance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[oracle@db ~]$ sqlplus/as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jun 16 15:24:59 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 6313463808 bytes
Fixed Size                  2264976 bytes
Variable Size            1476395120 bytes
Database Buffers         4815060992 bytes
Redo Buffers               19742720 bytes
Database mounted.
Database opened.
SQL> show parameter processes;

NAME                                 TYPE        VALUE
———————————— ———– ——————————
aq_tm_processes                      integer     1
db_writer_processes                  integer     2
gcs_server_processes                 integer     0
global_txn_processes                 integer     1
job_queue_processes                  integer     1000
log_archive_max_processes            integer     4
processes                            integer     1000

.
Method 2: Kill all oracle processes

1
2
$ ps -ef |grep $ORACLE_SID|grep -v grep|awk ‘{print $2}’ | xargs kill -9
$ ipcs -m | grep oracle | awk ‘{print $2}’ | xargs ipcrm shm

Installing R’s “mvtnorm” package in Windows system: solving the problem of the R package “mvtnorm” is not installed

When R language library is installed, some packages will be brought with it, which can be called directly. However, not all expansion packages come with them. Some packages need to be installed separately. For example, “mvtnorm” needs to be downloaded and installed manually
the following two methods have been tried, but the second one is easier to use. For the official documentation of mvtnorm, see the link: mvtnorm

1. Use the command to install

Open the command line interface (executable program exe) under the path of R, and several interfaces can be used, such as r.exe and rgui.exe. It is recommended to use rgui.exe because it has GUI interface, which is more convenient to operate
then enter the following command:

install.package("mvtnorm")

Choose the image source of cran, it’s better to choose the domestic one, so that the download speed is not too slow
select package – “install package –” and then select the package you want to install in the pop-up box. Note that package names are case sensitive. The reason why I choose this installation method is that I don’t need to search for the matching expansion package on the image URL. It’s easier than the first command line installation

after the installation, the prompt of package: mvtnorm “successfully unpacked and MD5 sums checked” will appear, and the installation path of binary package will be displayed
to check whether the installation is successful, you can enter the

from rpy2.robjects.packages import importr
mvt=importr('mvtnorm')

You can check whether the installation is successful. If there is no display, the mvtnorm package is successfully installed. If: the R package “mvtnorm” is not installed.

3. References

R realization method of multivariate normal distribution test

Solution of maven pom.xml dependency invalidation in IntelliJ

https://blog.csdn.net/weixin_33400820/article/details/78855594?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

The Maven project was created in IntelliJ, and the dependencies of slf4j and log4j were added to pom.xml. However, when writing the program, we found that IntelliJ had no text assistance about slf4j and log4j at all. After checking, we found that although the dependencies in pom.xml had been downloaded to the local repository, they were not added to the extended libraries of the project path
as shown in the figure:

After Google and Baidu, they didn’t find the same type of problems, so they had to explore their own solutions. They found that there was a management window for Maven project in IntelliJ

View –> Tool Windows –> Maven Projects

If the dependencies folder is not found, there is no dependency in the project, but the content required for dependency has been added to the pom.xml file. Later, it is found that the content of Maven’s pom.xml file needs to be re imported, as shown in the figure:

Re import can find all the dependent packages in external libraries

nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property

Project startup error

  nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property [class ***] of primitive type setter of ***

The error content indicates a field of the entity class for the following reasons

Field types are basic types, such as int, long, float, and so on. These types are not allowed to save null values. This field may already exist in the database and has data. You need to directly modify the database field properties and modify or clear all null in the existing data. No error will be reported after restart after modification

@Error in restcontroller annotation

If the @ restcontroller annotation can’t recognize the red, the reason is that there is no web dependency added to the POM file.

<dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
</dependency>

If a web dependency is added or an error is reported, it may be that there is no specified version number, so Maven can’t recognize


the solution is to enter the pom.xml file, click this location, find the dependency with the corresponding version number, replace the original dependency and import it again


Alpine Linux executable file crash report error / lib / x86 not found_ 64 Linux GNU / libc.so solution

reason:

reason:

Most linux software is connected with glibc, GNU libc Library (libc provides standard C library and POSIX API).

Most Linux distributions are based on glibc.

Alpine Linux is based on the musl libc library, which is a minimal implementation and strictly follows POSIX.

For example, executable files built on glibc distribution depend on/lib/x86_ 64 Linux GNU/libc. So. 6, which cannot be used on Alpine (except for static links).

resolvent:

Method 1: install the libc6 compatible package: APK add libc6 compat. This wrapper provides a lightweight glibc compatible layer. For simple applications, that’s enough.

Method 2, install the appropriate glibc on alpine, and provide all glibc methods and functions. Alpine can be built using glibc and should be installed in the following programs (for example):

# Source: https://github.com/anapsix/docker-alpine-java

ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc
ENV GLIBC_VERSION=2.30-r0

RUN set -ex && \
    apk --update add libstdc++ curl ca-certificates && \
    for pkg in glibc-${GLIBC_VERSION} glibc-bin-${GLIBC_VERSION}; \
        do curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/${pkg}.apk -o /tmp/${pkg}.apk; done && \
    apk add --allow-untrusted /tmp/*.apk && \
    rm -v /tmp/*.apk && \
    /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib

Method 3, using statically linked executable files. The static executable does not have dynamic dependencies and can run on any Linux.

Method 4, the software execution file can be built on alpine

 
 

Python uses cxfree to package script files into executable programs

  I have tried to package Python scripts with pyinstall before, but I encountered many problems in the process of using pyinstall, such as too large volume of packaged files, too many irrelevant files in the root directory of packaged programs, and so on.

  So instead of pyinstaller, I use cxfree to package Python scripts. Without saying much, let’s get to the point.

1. Install CX_ Freeze:

  The version of Python I use is 3.8.8. I can install CX directly with pypi_ Freeze。

  Command: PIP install CX_ Freeze

  CX installed_ The version of freeze is 6.6. After installation, you can start to package the script. Let’s simply create a script file for packaging.

hello.py:

import datetime

Print (‘Hello, the current date and time are: ‘, datetime. Datetime. Now())

input()

I store this script in the pinstar folder under disk D

Next, we introduce two ways to package the above script as. Exe

  First, after win + R, enter CMD to enter the command line, and then CD   C: Enter the scripts directory in the python installation path.

Here, the path following the CD is the installation path of Python in my computer. Just replace this path with the path of Python in my computer. For example, if anaconda is used, the path can be changed to the path of scripts folder under anaconda.

  After the path is switched, use the command cxfree D:: (pinstarr) Hello. Py — target dir D:: (pinstarr) dist, and press enter

How to bypass screen time password with itolab unlockgo for Mac

If your device has screen usage enabled, you will be subject to various restrictions when using your phone. Forget the screen time, don’t know what to do?The future software park will bring you a guide to how to use itolab unlockgo for Mac to bypass screen time password. Come and have a look!

Itolab unlockgo for Mac supports M1 chip

How to bypass screen time password with itolab unlockgo for Mac

Step 1: connect your device to your computer

After connecting the device, open itolab unlockgo and select unlock screen time password, then click unlock now.

Step 2: enter the password to trust the computer

Next, you need to unlock the device and click the trust button, then enter the password to continue.

Step 3: unlock screen time password

Now, unlockgo will begin to unlock the screen time password, and the whole process will take a few seconds. When you are finished, you will see the screen that was successfully deleted.