Category Archives: How to Fix

Solution to a Jenkins serious error recorded by automation platform

Error message: when Jenkins slave, the provided port 50000 is not reachable exception is reported, which leads to the serious problem that slave cannot be mounted

terms of settlement:

Step 1: modify the configuration in Jenkins, and specify that the port to boot from the node is 8081

Step 2: close the Jenkins service (service Jenkins stop), and then permanently open the specified port (firewall CMD – zone = public – add port = 8081/TCP – permanent), overload the firewall information (firewall CMD – reload), and start Jenkins (service Jenkins start Jenkins – P 8080:8080 – P 8081:8081 – v/home/Jenkins/var/Jenkins) on the specified port (8080 and 8081) jenkins/ jenkins:lts )

It is also important to note that when CMD starts slave, it is necessary to enter CMD from the specified jar path, and then execute the startup command

This is a serious error in system integration, which will probably be encountered later. It took a long time to solve this problem. It can be recorded for subsequent reference

Error handling when ABP specifies map object during map operation

Error handling in map operation of ABP

When mapping an entity object into dto in ABP, the entity defines an object of type long. In dto, there is an object with the same name, but the type is guid,

// StudentEntity
public class StudentEntity
{
		public Guid RelatedStudentId
		{
				get; set;
		}
}

// StudentDto
public class StudentDto
{
		public Guid StudentId
		{
				get;  set;
		}
		
		public Long RelatedStudentId
		{
				get; set;
		}
}

Take studententity and studentdto for example. Due to the change of business, when the back-end modifies the database and does not change the front-end code for the time being,

Directly map the relatedpatientid in entity to the studentID in dto , In this way, an error will occur when mapping, indicating that the type conversion error is wrong, and the data of the guid cannot be assigned to long,

CreateMap<StudentEntity, StudentDto>()
            .ForMember(d => d.StudentId, map => map.MapFrom(o => o.RelatedStudentId))

At this time, the entity’s guid type relatedpatientid will be mapped to the long type relatedpatientid in dto,

This kind of data definition should be avoided in map operation.

When configuring ROS distributed / Error report solution and command requirements encountered in the process of master-slave computer

    Error: SSH: connect to host * * port 22: network is unreachable
    cause: network is disconnected
    solution: restart virtual machine or manually connect or command to restart network connection

    sudo service network-manager restart
    

      Error: Unit network.service Not found.
      reason: wrong command

        Error: ROS error: the window cannot be opened remotely qxcbconnection: could not connect to display
        qxcbconnection: could not connect to display
        reason: the graphical window cannot be opened remotely

          Error: under Ubuntu 16.04, the terminal input sudo The problem of sudo: unable to resolve host Ubuntu: connection timed out occurs
          cause: this problem is caused by the inconsistency between the host name (localhost) in hosts and the host name in the “etc” folder of the system disk.
          Solution: set hosts to be consistent

            Requirements: view the SSH connection of Linux
            command:

            ps aux | grep sshd
            

              Requirements: use the service command to start the SSH service. The command execution is as follows.
              Command:

              service sshd start
              

                Requirement: how to view the Pi of the host connected through SSH in Ubuntu
                command:

                who
                

                  Requirements: how to modify user password in Ubuntu
                  command:

                  [email protected]:~$passwd usrname
                  

                com.alibaba.druid.sql.parser.ParserException: syntax error

                Remember a simple mistake.

                sql.append("select"
                +"a.MEMBER_NAME, b.ACTION_NAME"
                +"from CLUB_MEMBER a,CLUB c, MEMBER_ACTION_RECORD d");
                sql.append("WHERE a.CLUB_MEMBER_ID = d.CLUB_MEMBER_ID"
                				+ "AND a.CLUB_ID = b.CLUB_ID"
                				+ "AND d.ACTION_ID = ?"); 
                

                It’s wrong, why is it wrong? No spaces, SQL prints.
                selecta.MEMBER_NAME, b.ACTION_NAMEfrom CLUB_MEMBER a,CLUB c, MEMBER_ACTION_RECORD dWHERE a.CLUB_MEMBER_ID = d.CLUB_MEMBER_IDAND a.CLUB_ID = b.CLUB_IDAND d.ACTION_ID = ?
                Now you know why it’s wrong, right?
                Correct Codes.

                sql.append("select"
                +" a.MEMBER_NAME, b.ACTION_NAME"
                +" from CLUB_MEMBER a,CLUB c, MEMBER_ACTION_RECORD d");
                sql.append(" WHERE a.CLUB_MEMBER_ID = d.CLUB_MEMBER_ID"
                				+ " AND a.CLUB_ID = b.CLUB_ID"
                				+ " AND d.ACTION_ID = ?"); 
                

                It doesn’t seem to make a big difference, but it’s enough to take half an hour and patience to look at the code.

                Why not manage controller in spring container

                Spring container and spring MVC container

                 

                1. Question: why not use spring to manage all classes?

                In our configuration of spring MVC, why does the controller not be directly managed by spring, but the spring MVC container should be managed separately

                 

                 

                 

                2. The relationship between spring container and spring MVC

                Spring container is a parent-child relationship with spring MVC container. The child container can access the objects of the parent container, but the parent container can’t access the classes of the child container. If we scan all classes directly in the spring MVC configuration file and hand over service, Dao and controller to spring MVC for management, but if spring is used to manage contoller, it can’t access this class, because Co The ntoller is in the spring MVC container. If you configure spring to scan all classes directly, including controller, but do not configure spring MVC, the request sent by the server will have a 404 problem, because it can’t find the controller and spring can’t inject the controller

                Example.
                Configure in applicationContext-service.
                <! -- Scan package to load Service implementation classes -->
                <context:component-scan base-package="com.easybuy"></context:component-scan>
                will scan for @Controller, @Service, @Repository, @Compnent
                
                Springmvc.Xml does not scan.
                Conclusion: springmvc. cannot provide services because there is no controller object in the springmvc subcontainer.
                

                3. Why not directly SpringMVC.xml Scan all classes in?

                In principle, we can leave the service, Dao and controller to spring MVC for management, and just let it scan all packages directly in the spring MVC configuration file. However, for the sake of future expansion, spring and spring MVC are configured separately, and spring manages the service, which is conducive to later expansion. Even if multiple struct2 are added in the future, the original configuration will not be affected

                Eclipse PyDev “interpreter does not exist in filesystem”

                The reason for the problem: this kind of problem is generally should be will python.exe The file has been renamed

                Solution: there are generally two ways:

                1: change the file name back (basically, it won’t be changed back, because the file name is usually changed to include both python2 and python3 on the computer. In order to add environment variables and successfully run two different versions of python, the file name is usually changed)

                2: modify the python path of eclipse

                Modify in window – & gt; preferences – & gt; pydev – & gt; interpreters – & gt; Python interpreter

                      

                Use the remove button to delete the paths of the two Python versions, then click browse for Python/pypy exe, re select the path of python, and finally click apply and close

                 

                At this time, the project file still reports an error. At this time, select the project that reports an error, right-click and select the properties option – & gt; pydev interpreter/grammar, then switch to interpreter and select the corresponding Python Version (default)– currently:python2 Finally, click apply and close. Finally, restart eclipse