Following the online teacher’s learning, I typed a simplified traditional Chinese conversion code as follows:
found the seventh line of code error, and moved the mouse to the code. The method covertotraditional (string) is undefined for the type zhconverterutil. In fact, it’s a jar package error. The zhconverterutil class in the jar package has no coverttotraditional method
we just need to change coverttotraditional to totraditional to complete the conversion from simplified to traditional Chinese
summary: if you report any error in this aspect in the future, you can go to the jar package to see if there is such a method.
Java error invaliddefinitionexception
Scenario: this error occurs when transferring parameters between springcloud and seat microservices. A service has the function of uploading files,
Service B needs to call the upload file interface of service A. there is a common parent class reference C between a and B.
The method defined in C is
| @RequestMapping(“/file/upload”) public R uploadFile(MultipartFile file); td> |
The method defined in a is
| @RequestMapping(“/file/upload”) public R uploadFile(MultipartFile file){ … } |
Call statements defined in B
| b.uploadFile(file); td> |
After writing in this way, report an error, such as the title
Add the annotation @ requestparam before the request parameter file in methods a and C.
div>
Failed to retrieve platformtransactionmanager for @ transactional test: [defaulttest]
Foreword: This is JUnit test class. I hope that the data can be rolled back after the test, and the previous data will not be affected. But I have no problem in other tutorials. I report an error, and then I check a lot of data, but it is fruitless. Finally, I solve it by myself
Error message: java.lang.illegalstateexception: failed to retrieve platformtransactionmanager for @ transactional test
java.lang.IllegalStateException: Failed to retrieve PlatformTransactionManager for @Transactional test: [DefaultTestContext@6356695f testClass = SystemServiceTest, testInstance = com.****.****.oc.coresystem.service.SystemServiceTest@716f94c1, testMethod = update@SystemServiceTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@4f18837a testClass = SystemServiceTest, locations = '{}', classes = '{class com.****.****.Application, class com.****.****.Application}', contextInitializerClasses = '[]', activeProfiles = '{dev}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@4d3167f4, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@87f383f, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@5891e32e, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@42607a4f], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> false]]
at org.springframework.util.Assert.state(Assert.java:94) ~[spring-core-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.transaction.TransactionalTestExecutionListener.beforeTestMethod(TransactionalTestExecutionListener.java:185) ~[spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:291) ~[spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) [spring-test-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) [junit-rt.jar:na]
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) [junit-rt.jar:na]
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) [junit-rt.jar:na]
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) [junit-rt.jar:na]
The core reason for this problem in my project is that I have three different data sources in this large project, and JUnit does not know which data source transaction you want to roll back! It requires you to specify a platform transaction manager
Configuration of one of the primary data sources:
The test class then specifies the transactionmanager
Re run the test method, the problem is solved!
div>
Unhandled project rejection type error: webassembly instance
Today, I created a new small program project in wechat developer tool
but when I opened it, such a bug appeared
which made me feel very confused
Unhandled promise rejection TypeError: WebAssembly Instantiation: Argument 0 must be a buffer source or a WebAssembly.Module object

It was very uncomfortable
I went to the wechat developer community and asked
it turned out that the default version of the basic debugging library was too high, which led to an error
A simple solution
Click the details button in the upper right corner
and select local settings
to adjust the basic debugging library back to 2.14.4

[JS] use date. Now(). Tostring() to generate serial number
Date. Now() returns the number of milliseconds from 00:00:00 (UTC) on January 1, 1970 to the current time.
console.log(Date.now());
output: 1623740295900
type is number,
tostring() method returns string type.
To solve the problem of repeated password input when operating sourcetree on MAC
After installing sourcetree, no matter the pull or push code, it will prompt the shell layer to input the password. What should I do?
Copy the following code to the terminal for execution:
git config –global credential.helper osxkeychain
Then enter the computer power on password, and check always allow.
Problem solving!!! You can safely push and pull code ~
the specified workspace directory is either invalid or read-only
Solution: delete this folder
![]()
Nodejs: TypeError: The super constructor to “inherits“ must not be null or undefined
Recently, when using statsd, this sentence is util. Inherits (configurator, process. Event emitter); Error: “typeerror: the super constructor to” inherits “must not be null or undefined”
The reason is that there is no event emitter object in process in the newer nodejs version. The solution is to create an event emitter object for process before calling util. Inherits, as follows:
process.EventEmitter = require('events').EventEmitter
CentOS execution command error: – bash: fork: cannot allocate memory processing / viewing process number
Contents of articles
Error reported by CentOS when executing command: – bash: fork: cannot allocate memory
Error reported by CentOS when executing command: – bash: fork: cannot allocate memory
Background:
executing any command will report – bash: fork: cannot allocate memory, but there is still a lot of free memory.
Problem analysis:
the reason is that the number of processes is full, which exceeds the default value set by the system
View the maximum number of processes
sysctl kernel.pid_max
View the number of processes
ps -eLf | wc -l
You will find that the number of all processes is almost more than the default number of processes
After modifying the maximum number of processes, the system can recover without restarting the process.
echo 1000000 > /proc/sys/kernel/pid_max
Permanent effect
echo "kernel.pid_max=1000000 " >> /etc/sysctl.conf
sysctl -p
Unity3D error CS0227: Unsafe code may only appear if compiling with /unsafe…
describe
Unity3D error CS0227: Unsafe code may only appear if compiling with /unsafe...
solve
set up
File - > BuildSettings -> PlayerSettings -> Player -> OtherSettings -> Allow 'unsage' Code
Keepalived add service self-start error analysis [How to Solve]
After installing keepalived, set it to start the service automatically
Copy the file keepalived whose path is /usr/local/src/keepalived-1.3.4/keepalived/etc/init.d to /etc/init.d
cp /usr/local/src/keepalived-1.3.4/keepalived/etc/init.d/keepalived /etc/init.d/
Copy the file whose path is /usr/local/keepalived-1.3.4/etc/sysconfig/keepalived to /etc/sysconfig/keepalived
cp /usr/local/keepavlied-1.3.4/etc/sysconfig/keepalived /etc/sysconfig/
Add execute permission
chmod +x /etc/init.d/keepalived
Add keepalived to the system service
chkconfig --add keepalived
start up
[root@localhost ~]# service keepalived start
Starting keepalived (via systemctl): Job for keepalived.service failed because the control process exited with error code. See "systemctl status keepalived.service" and "journalctl -xe" for details.
[failure]
Report an error, start failure, use status to check the specific reason
[root@localhost ~]# systemctl status keepalived ● keepalived.service - LVS and VRRP High Availability Monitor Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 四 2019-04-25 14:25:01 CST; 24s ago Process: 17642 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=203/EXEC) 4月 25 14:25:01 localhost.localdomain systemd[1]: Starting LVS and VRRP High Availability Monitor... 4月 25 14:25:01 localhost.localdomain systemd[1]: keepalived.service: control process exited, code=ex...203 4月 25 14:25:01 localhost.localdomain systemd[1]: Failed to start LVS and VRRP High Availability Monitor. 4月 25 14:25:01 localhost.localdomain systemd[1]: Unit keepalived.service entered failed state. 4月 25 14:25:01 localhost.localdomain systemd[1]: keepalived.service failed. Hint: Some lines were ellipsized, use -l to show in full.
Warning: ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=203/EXEC)
Check that the ll /usr/sbin/keepalived file does not exist, there are two ways to solve it at this time
1. Copy a keepalived to /usr/sbin/
2. Modify the /lib/systemd/system/keepalived.service file, and change the /usr/sbin/ path to the path where we store the keepalived file
[root @ localhost ~] # vi / lib / systemd / system / keepalived.service [Unit] Description=LVS and VRRP High Availability Monitor After=syslog.target network-online.target [Service] Type=forking PIDFile=/var/run/keepalived.pid KillMode=process EnvironmentFile=-/etc/sysconfig/keepalived ExecStart=/usr/local/bin/keepalived $KEEPALIVED_OPTIONS ExecReload=/bin/kill -HUP $MAINPID [Install]
3. Take effect
systemctl daemon-reload
4. Restart
[root@localhost keepalived-1.3.4]# systemctl start keepalived
[root@localhost keepalived-1.3.4]# systemctl status keepalived
● keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
Active: active (running) since 四 2019-04-25 14:30:01 CST; 2s ago
Process: 17691 ExecStart=/usr/local/bin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 17692 (keepalived)
CGroup: /system.slice/keepalived.service
├─17692 /usr/local/bin/keepalived -D
├─17693 /usr/local/bin/keepalived -D
└─17694 /usr/local/bin/keepalived -D
4月 25 14:30:02 localhost.localdomain Keepalived_vrrp[17694]: VRRP_Instance(VI_1) Changing effective p...52
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: VRRP_Instance(VI_1) Entering MASTER STATE
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: VRRP_Instance(VI_1) setting protocol VIPs.
4月 25 14:30:03 localhost.localdomain Keepalived_healthcheckers[17693]: Netlink reflector reports IP 17...d
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: Sending gratuitous ARP on em1 for 172.28...09
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: VRRP_Instance(VI_1) Sending/queueing gra...09
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: Sending gratuitous ARP on em1 for 172.28...09
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: Sending gratuitous ARP on em1 for 172.28...09
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: Sending gratuitous ARP on em1 for 172.28...09
4月 25 14:30:03 localhost.localdomain Keepalived_vrrp[17694]: Sending gratuitous ARP on em1 for 172.28...09
Hint: Some lines were ellipsized, use -l to show in full.
success
[Solved] Zabbix-server startup error: cannot start alert manager service: Cannot bind socket to “/var/run/zabbix/zabbix_server_alerter.sock”: [13] Permission denied.
The following error is reported when starting zabbix-server:
29171:20180714:084911.367 cannot start alert manager service: Cannot bind socket to "/var/run/zabbix/zabbix_server_alerter.sock": [13] Permission denied.
29142:20180714:084911.368 One child process died (PID:29171,exitcode/signal:1). Exiting ...
29225:20180714:084923.611 cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [13] Permission denied.
29213:20180714:084923.613 server #18 started [poller #2]
29195:20180714:084923.614 One child process died (PID:29225,exitcode/signal:1). Exiting ...
29195:20180714:084925.615 syncing history data...
29195:20180714:084925.615 syncing history data done
29195:20180714:084925.615 syncing trend data...
29195:20180714:084925.615 syncing trend data done
29195:20180714:084925.615 Zabbix Server stopped. Zabbix 3.4.10 (revision 81503).
The above is only pasted part of the error log.
The above reason is because SELINUX starts
sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
The solution is as follows:
vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Modify the SELINUX=disabledconfiguration file and close it permanently.
setenforce 0: Temporarily close SELINUX.