Author Archives: Robins

Vue project reports an error on ie11 white screen. Script1002: syntax error

Problem phenomenon

The project is a front-end project built with Vue/cli3 scaffold, and Vue version is 2.6.10.

Ie11 error reporting problems are as follows:

  (there was no screenshot in the error report at that time, but someone else’s picture was used)

 

It’s annoying that there’s no way to check mistakes like this

Baidu a pile, all copy to copy, the key has not been able to solve the problem, shit! Omnipotent Google up

  In fact, this problem is obviously a syntax error, that is, the problem that ie does not support, ie garbage

Since it’s a syntax problem, it’s a compilation problem. Let’s directly compile the corresponding package, but which package is it

Here’s the point: when you click the error message, you will find that the place where the breakpoint is is the place where the error is reported. That must be the problem here, but this is the compiled code. How to check which package is a headache!

When I was having a headache, I found that the comment above was the name of the package???

It’s like discovering a new world

It’s him. This picture is not my error information. My error information is

./node_modules/[email protected]@js-base64.js

Since the package with the problem is found, specify that it be compiled; Using webpack

Directly configure the compiled code in vue.config.js

transpileDependencies: [
    /[/\\]node_modules[/\\][email protected]@js-base64[/\\]/,
 ],

Then directly NPM run serve

be accomplished! It’s done! go off work!

[Solved] PostgreSQL Remote Access Error: could not connect to server

1. Turn off the postgresql service first
. 2. If you want postgresql to support remote access, you need to modify the two configuration files in the data folder under the directory

postgresql.conf
Set the value of the listen_addresses item in the file to ‘*’
pg_hba.conf
Add the following configuration under the host all all 127.0.0.1/32 md5 line after the ipv4 configuration of the configuration file, or directly modify this line to the following configuration host all 0.0.0.0/0 trust
If you do not want to allow all IP remote access, You can set 0.0.0.0 in the above configuration items to a specific IP value.
3. Right-click management on my computer-find service-find postgresql service, right-click to start

The vscode installation plug-in liveserver specified browser reported an error and could not be found

Problem Description:

After installing vscode, you do not want to use the default IE browser. You want to specify chrome or Firefox, but install the plug-in lever server or other browser plug-ins. When specifying the default browser, windows reports an error and cannot find chrome or Firefox
after reading many posted on the Internet, they are configured in settings.json. After personal practice, they have no effect. Later, after their own exploration, they found that the plug-in can’t find your chrome or Firefox. It’s not that you haven’t installed it on your computer, let alone on disk C; But because when a plug-in such as lever server specifies a browser, the windows system will find the installation directory of the software according to the system variables.

terms of settlement:

1. Open the control panel of the computer – & gt; System and security —– & gt; System
2. Open advanced system settings, click environment variables, system variables, and add a new variable named path: D: \ Kiki \ Mozilla Firefox
this directory is the directory where your Google or Firefox exe files are located
3. After configuring environment variables and saving, restart vscode

Solution of adding judgment error in the iterative process of Java iterator iterator

        The first time I tried to use a blog to record my Xiaobai’s learning process, which is mainly convenient for me to query in the future, but it would be great if I could help other friends!

1、 Scenario description

        This is the function of reading data from the database and then exporting excel tables. The value is assigned by the iterator to realize the export. The code is as follows:

protected void generate() {
   XSSFCellStyle xssfCellStyle = defaultStyle();
   defineHeader(this.meta);
   headerDataCount = this.defaultSheet.getPhysicalNumberOfRows();
   for (int i = 0; i < this.data.size(); i++) {
      List<Map<String, Object>> cellList = this.data.get(i);
      for (int j = 0; j < cellList.size(); j++) {
         renderCell(0, i, String.valueOf(i + 1), xssfCellStyle);
         Iterator<Object> iterator = cellList.get(j).values().iterator();
         while (iterator.hasNext()) {
            String value = String.valueOf(iterator.next());
            renderCell(j + 1, i, value, xssfCellStyle);
            beautifyColumn(j + 1, value, xssfCellStyle);
         }
      }
   }
}

        The problem encountered is that the null value (null value) displayed in the Oracle library is displayed as “null” in the exported excel table. I want to add a judgment during iteration to make the read null directly change to “”.

2、 Something went wrong

I changed it this way:

   String value = iterator().next()==null?"":String.valueOf(iterator().next());

However, an error is reported:

         java.util.NoSuchElementException

3、 Settle

Cause of problem:

         The next () method of iterator class cannot appear twice in the same loop, which will cause the last cursor to point to a null value.

Modification:

         Add a variable to receive the iterator:

    Object a = iterator.next();
    String value = a==null?"":String.valueOf(a);

 

Solution to the error cannot resolve symbol reported by build.sbt

Solution to the error cannot resolve symbol reported by build.sbt

1. Background 2. Error reporting 3. Solution

1. Background

Idea version 2017.2, development language Scala, when re importing the SBT project, build.sbt became popular and cannot resolve symbol

2. Error reporting

As shown below

3. Solutions

3.1 delete the. Idea folder

3.2 using file – & gt; Invalidcaches/restart restart


3.3 after restarting, wait for the idea to regenerate the. Idea folder and solve the error!

Solution to error reporting on the client caused by adding fields on the CXF server

To solve this problem, turn off the field verification function

1. Spring framework:

Add the following configuration in the configuration file

<cxf:properties>
   <entry key="set-jaxb-validation-event-handler" value="false"/>
</cxf:properties>

2. Springboot framework:

Add @ endpointproperties annotation on WebService implementation class

@WebService(
        targetNamespace = "http://ws.test.com/",
        serviceName = "demoWebService",
        endpointInterface = "com.test.ws.DemoWebService")
@EndpointProperties({@EndpointProperty(key = "set-jaxb-validation-event-handler", value ="false")})
@Configuration
public class FaultOrderWebServiceImpl implements DemoWebService {

}

Easycvr package Linux version error net_DVR_DownFileByName_Stop

As we all know, easycvr is a protocol integration platform that supports the most protocols among the platforms developed by tsingsee Qingxi video. Easycvr can be compatible with the private SDKs of Haikang and Dahua. At the same time, it also has the characteristics of gb28181, cascading of home protocols, voice intercom and so on. According to your own system, you can freely choose Windows version or Linux version for deployment.

When our developers packaged the Linux version of easycvr, easy appeared_ NET_ DVR_ DownFileByName_ Stop error.

As can be seen from the error, the prompt cannot find easy_NET_DVR_DownFileByName_Stop,
EASY_NET_DVR_DownFileByName_Start, NET_DVR_Startremoteconfig these three defined types.

In the corresponding source_hksdk_corresponding type is not found in the linux.go file, but it is used in the file.

So we need to find the source in the project_hksdk_Linux.go file, merge the missing code in source_hksdk_Add to linux.go. The reference code is as follows:

int Easy_NET_DVR_StartRemoteConfig(int loginhandle, int channelNum, int year, int month, int day, int hour, int minute, int second, char* path,int size){
	char pathArr[128];
	memset(pathArr, 0, sizeof(pathArr));
	memcpy(pathArr, path, size);
	NET_DVR_GET_FIGURE_COND cond;
	memset(&cond, 0 ,sizeof(NET_DVR_GET_FIGURE_COND));
	cond.dwLength = sizeof(NET_DVR_GET_FIGURE_COND);
	cond.dwChannel = channelNum;
	cond.struTimePoint.wYear = year;
	cond.struTimePoint.byMonth = month;
	cond.struTimePoint.byDay = day;
	cond.struTimePoint.byHour = hour;
	cond.struTimePoint.byMinute = minute;
	cond.struTimePoint.bySecond = second;

	int ret = NET_DVR_StartRemoteConfig(loginhandle, 6610, &cond, sizeof(cond), EasyDownloadPictureByTimeCallback, path);
	if (ret < 0)
	{
		return ret;
	}
	sleep(2);
	NET_DVR_StopRemoteConfig(ret);
	return ret;
}

int EASY_NET_DVR_DownFileByName_Start(int loginhandle, char* srcfile, char* destfile){
    int bRes = 1;
    int hPlayback = 0;
    if( (hPlayback = NET_DVR_GetFileByName(loginhandle, srcfile, destfile)) < 0 ){
        printf( "GetFileByName failed. error[%d]\n", NET_DVR_GetLastError());
        bRes= -1;
        return bRes;
    }
    int pos = 0;
    if(!NET_DVR_PlayBackControl_V40(hPlayback, NET_DVR_PLAYSETPOS, &pos,4,NULL,NULL)){
        printf("play back control failed [%d]\n",NET_DVR_GetLastError());
        bRes=-1;
        return bRes;
    }
    if(!NET_DVR_PlayBackControl_V40(hPlayback, NET_DVR_PLAYSTART, NULL,0,NULL,NULL)){
        printf("play back control failed [%d]\n",NET_DVR_GetLastError());
        bRes=-1;
        return bRes;
    }
   return 0;
}

int EASY_NET_DVR_DownFileByName_Stop(int filehandle){
	int bRes = 0;
    int nPos = NET_DVR_GetDownloadPos(filehandle);
    printf("have got %d\n", nPos);
    if(!NET_DVR_StopGetFile(filehandle)){
        printf("failed to stop get file [%d]\n",NET_DVR_GetLastError());
        bRes = -1;
        return bRes;
    }
    if(nPos<0||nPos>100) {
        printf("download err [%d]\n",NET_DVR_GetLastError());
        bRes=-1;
        return bRes;
    }else {
        return 0;
    }
 return 0;
}

Package again without error:

Kafka opens JMX port and reports that the error port is occupied

Kafka turns on JMX_ After port, when using Kafka command-line tools (Kafka topics, kafka-console-consumer.sh, etc.), an exception will be reported that the port is occupied, such as:

bash-5.1# /opt/kafka_2.13-2.7.0/bin/kafka-topics.sh --create --topic chat --partitions 5 --zookeeper 172.16.5.16:2181 --replication-factor 3
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9999; nested exception is:
        java.net.BindException: Address in use (Bind failed)
sun.management.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 9999; nested exception is:
        java.net.BindException: Address in use (Bind failed)
        at sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:480)
        at sun.management.Agent.startAgent(Agent.java:262)
        at sun.management.Agent.startAgent(Agent.java:452)
Caused by: java.rmi.server.ExportException: Port already in use: 9999; nested exception is:
        java.net.BindException: Address in use (Bind failed)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:346)
        at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:254)
        at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:412)
        at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
        at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:237)
        at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:213)
        at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:173)
        at sun.management.jmxremote.SingleEntryRegistry.<init>(SingleEntryRegistry.java:49)
        at sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:816)
        at sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:468)
        ... 2 more
Caused by: java.net.BindException: Address in use (Bind failed)
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
        at java.net.ServerSocket.bind(ServerSocket.java:392)
        at java.net.ServerSocket.<init>(ServerSocket.java:254)
        at java.net.ServerSocket.<init>(ServerSocket.java:145)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:45)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:345)
        at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:670)
        at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335)
        ... 11 more

terms of settlement:

Modify the bin/kafka-run-class.sh file:

Find this code

if [  $JMX_PORT ]; then
  KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
fi

Replace with the following:

ISKAFKASERVER="false"
if [[ "$*" =~ "kafka.Kafka" ]]; then
    ISKAFKASERVER="true"
fi
if [  $JMX_PORT ] && [ -z "$ISKAFKASERVER" ]; then
  KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
fi

Then create topic and solve the problem.

bash-5.1#
bash-5.1# /opt/kafka_2.13-2.7.0/bin/kafka-topics.sh --create --topic chat --partitions 5 --zookeeper 172.16.5.16:2181 --replication-factor 3
Created topic chat.
bash-5.1#

Solutions to remote or adding SSH key errors

 

 

Method 1

ssh-keygen -R XX.XX.XX.XX  

Method 2

【1】 Delete the corresponding IP in known_ Hosts related information

vim /.ssh/known_ hosts

The problem is solved. The reason is that after the system is reinstalled, the remote connection is made again. After entering yes, this opportunity writes the information of the remote machine to/users/Wangdong /. SSH/known_ Hosts file, so if you reinstall the system remotely, you must clean up the machine first.