Author Archives: Robins

Error running ‘xxxapplication’: no JDK for module ‘xxx’

When I was running the project today, I suddenly found that the project that had been well before could not be started. An error was reported

Error running ‘XXXApplication’: No jdk for module ‘XXX’

Normally, JDK is set in file – & gt; project structure, and there is no problem after checking

Later, after several twists and turns, through a direct search of JDK in settings, we found that there was such a place

The arrow points to the current state. Change this to the normal 1.8, and the project can run happily

 

Docker command error during connect: get http://2F2F.2Fpipe2Fdocker_ engine/v1.36/containers/json: open//.

Error during connect: get http://% 2F% 2F.% 2fpipe% 2fdocker_ engine/v1.36/containers/json: open //./pipe/docker_ Engine: the system cannot find the file specified. In the default configuration on windows, the docker client must be run upgraded to connect. This error may also indicate that the docker day is not running.
the error message is as follows:

resolvent

1. Execute command: docker machine env default

2. Method 1: copy the displayed command for execution

after execution, execute docker PS and other commands, and you can use it normally
3. Method 2: only the last REM @ for/F "tokens = *"% I in ('docker machine env default ') do @% I The command is executed without REM, that is, @ for/F "tokens = *"% I in ('docker machine env default ') do @% I

after execution, the docker command can be used normally, and the environment variable needs to be set first for each new CMD window.
Note: when using method 2 in bat script, if you directly put for statement into bat script to run, an error will be reported. Change % I in the command to %% I . For details, please refer to my other article, bat script execution for error reporting

When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request

Error occurred while trying to proxy request/login/from 127.0.0.1:8080 to http://127.0.0.1 :8081 (ECONNREFUSED) ( https://nodejs.org/api/errors.html#errors_ common_ system_ errors)

I searched for information on the Internet and found various answers. Then I tried several answers and found that there should be a problem with the port,

Finally, change the proxy address to http://127.0.0.1 9090 is the solution!

The docker runtime container reported an error: error response from daemon: OCI runtime create failed

Today, when the virtual machine runs docker image, it always reports an error (the specific reason for the error remains to be analyzed). After checking the system kernel and operating system version, no result is found.

[ root@bogon ~]# cat /etc/redhat-release

CentOS Linux release 7.2.1511 (Core)

[ root@bog [ root@bogon ~]# docker version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:15:20 2018
OS/Arch: linux/amd64

Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:17:54 2018
OS/Arch: linux/amd64

Experimental: false

Error information:

[ root@bogon yum.repos .d]# docker run -it centos echo haha

docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/docker/containerd/daemon/ io.containerd.runtime .v1.linux/moby/6602807a7f1a03689a847741b0a10171788f7bed2aa92a4dff35c429b02248d1/ log.json : no such file or directory): docker-runc did not terminate sucessfully: docker-runc: symbol lookup error: docker-runc: undefined symbol: seccomp_ version

resolvent:

Upgrade the system to 7.4

It takes a long time to execute Yum update and wait patiently.

[ root@bogon ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

[ root@bogon ~]# docker run -it centos echo haha

haha

Another solution is to install a lower version of docker, which is highly dependent on the version of the operating system. You must pay attention to it when installing!

Foreigners interpret it as follows:

RHEL 7.2 is no longer supported and Docker does not test their release against unsupported versions. You need to upgrade your OS, preferably to 7.4, to resolve this issue.

I’ve seen a few people with similar issues in the past few days that resolved this same error message by upgrading their OS. Some of the older packages no longer work with newer docker releases. One of those problems is an outdated libseccomp: https://github.com/moby/moby/issues/35906

Error: path not specified when the docker 1.7 file is uploaded to the container in CentOS

I tried to find many ways to transfer files to the docker container on the Internet, and found a bug in version 1.7

docker cp e0ce13a27784:/home/website/default  /appuweichao/credit_ passport/web/

Error: Path not specified

The error message “error: path not specified” has been fixed in docker 1.8.0.

Error: path not specified

Solution: copy from the host to the container’s Mount directory

First, get the real ID of the container

docker inspect -f ‘{{.Id}}’ c37ca9beb746

cp /home/yulong/Downloads/file.txt /var/lib/docker/devicemapper/mnt/c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155/rootfs/mnt

/var/lib/docker/devicemapper/mnt/c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155/rootfs/mnt

This folder is actually a local shared folder where the container is mounted

Here are the folders for all the containers

c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155

After entering the terminal/MNT, you can see it below file.txt It’s a document

 

Error report in idea compilation Error:Android Dex : [Project] java.lang.OutOfMemoryError : GC overhead limit exceeded

Recommended website http://jingyan.baidu.com/album/9c69d48fa0290013c9024e3f.html

When using IntelliJ idea or Android studio to develop Android applications, if there is a large amount of code, there will be problems when compiling

java.lang.OutOfMemoryError : Java heap space

It’s a mistake. Let’s talk about how to solve this problem.

When using IntelliJ idea or Android studio to develop Android applications, if there is a large amount of code, there will be problems when compiling

java.lang.OutOfMemoryError : Java heap space

Error reported by:

When using IntelliJ idea or Android studio to develop Android applications, if there is a large amount of code, there will be problems when compiling

java.lang.OutOfMemoryError : Java heap space

Error report of:
0

To solve this problem, we need to increase the heap of the corresponding compiler.

Now in the file menu, open the settings interface,
and

Then, in the search box, enter “heap”, and the settings related to heap will be displayed below. Find the corresponding development language settings, and increase heap. In this case, Java heap is not enough, so click Android compiler to increase the corresponding heap.

If the heap of other languages is not enough, turn up the heap in the corresponding menu.

@Solution of error failed to get response from / Vue cli version marker

thank: CSDN@beeegood Questions provided.

Today, they encountered a very interesting bug. When they created a project with @ Vue/cli, they reported an error, which they had never seen before:

At first, I thought it was a version problem. After all, the error message said update, but the version of CLI was the latest. After asking, the node and NPM versions were also the latest (12.16.1, which was the latest as of the time I wrote this article). Most importantly, there was no old version of Vue cli

That’s very interesting. According to convention, when encountering the front-end problem, the first reaction is to unload and reload

npm uninstall -g @vue/cli
npm cache clean --force
npm install -g @vue/cli

However, it’s useless. After checking for a long time, we can’t find the relevant error report on the Internet, which is very embarrassing.

Later, I noticed that there is an output of yarn below. Is the built-in yarn in cli?But this shouldn’t be:

although I think it’s incredible, I still decided to look at the version of yarn. Yarn is highly suspected. Sure enough:

the problem was found. But what is this?Hadoop?

Later, I remembered that yarn is also a part of Hadoop, which is used to schedule resources:

NVM ERROR open \settings.txt: The system cannot find the file specified

    1. when installing other software, the environment variable of NVM was accidentally deleted. After restoring the installation path of NVM in the system path, an error was reported using NVM
    1. error open\ settings.txt : the system cannot find the file specified after comparing my environment variables with those of other people, I find that I am missing% NVM_ HOME%,%NVM_ Symlink% two variables add two paths to the path

    1. add two variables to the system variables, and the variable values can be found in the NVM installation file settings.txt
    1. root: NVM_ home
    1. path: nvm_ Symlink

    restart the computer, open CMD in administrator mode, type NVM, OK reference link: https://github.com/coreybutler/nvm-windows/issues/39

Error starting ApplicationContext. To display the auto-configuration report re-run your application

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-09-08 02:07:28.798 ERROR 10540 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).


Process finished with exit code 1

When the springboot project is started, no error is reported, but it will be terminated automatically later. View POM file

       <!-- spring boot Integration mybatis -->
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.0</version>
        </dependency>

        <!-- MySQL -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

The solution: in the pom.xml Remove database related dependencies (MySQL connection)- java.jar,  mybatis.xxx.jar, PageHelper, database connection pool, etc.)

There must be a default configuration file, if any. Such as database connection configuration.

C#: How to Use Itextsharp to Manipulate PDF Files

summary

How to convert HTML file to PDF file?Some recruitment online resume into doc file, can not be used directly, this caused great trouble, then it also has a format, that is HTML format. Export the file to HTML format, and then convert it to PDF file, so that it can be used directly. Usually in the project is also a lot of such requirements, need to convert the content into PDF file.

Now let’s take a look at how to convert HTML to PDF using itextsharp.

code implementation

1. Nuget installs itextsharp.

using iTextSharp.text;
using iTextSharp.text.pdf;

2. Convert HTML document to PDF.

  /// <summary>
        /// Switch Html Document to pdf
        /// </summary>
        /// <param name="htmlText"></param>
        /// <returns></returns>
        public byte[] ConvertHtmlTextToPDF(string htmlText)
        {
            if (string.IsNullOrEmpty(htmlText))
                return null;
            //to avoid when the htmlText without any html tag tag plain text, to PDF will hang, so all with <p> tag
            htmlText = "<p>" + htmlText + "</p>";
            using (var outputStream = new MemoryStream())
            {
                byte[] data = Encoding.UTF8.GetBytes(htmlText);
                var msInput = new MemoryStream(data);
                var doc = new Document();//pdf file,default A4 formate
                var writer = PdfWriter.GetInstance(doc, outputStream);
                doc.Open();
                iTextSharp.tool.xml.XMLWorkerHelper.GetInstance().ParseXHtml(writer, doc, msInput, null, Encoding.UTF8, new UnicodeFontFactory());
                var pdfDest = new PdfDestination(PdfDestination.XYZ, 0, doc.PageSize.Height, 1f);
                var action = PdfAction.GotoLocalPage(1, pdfDest, writer);
                writer.SetOpenAction(action);
                doc.Close();
                msInput.Close();
                outputStream.Close();
                return outputStream.ToArray();
            }
        }

3. Unicode font support.

   /// <summary>
        /// Unicode font support
        /// </summary>
        public class UnicodeFontFactory : FontFactoryImp
        {
            public override Font GetFont(string fontname, string encoding, bool embedded, float size, int style, BaseColor color, bool cached)
            {
                //var chineseFontPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "msyh.ttc,0");
                //BaseFont baseFont = BaseFont.CreateFont(@"c:\Windows\Fonts\simsun.ttc,0", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
                BaseFont baseFont = BaseFont.CreateFont(@"c:\Windows\Fonts\SIMHEI.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
                //var baseFont = BaseFont.CreateFont(chineseFontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
                return new Font(baseFont, size, style, color);
            }
        }

4. Call build.

   string content = temp.Content;
            foreach (var dict in dicts)
            {
                content = content.Replace("{{" + dict.Key + "}}", dict.Value);
            }
            var path = _esignInfo.Value.ContractPath;
            //if (entity.ContractType == ContractType.First)
            //{
            //    path += "/" + appId + "/Agreements";
            //}
            entity.OriginalFileUrl = _pdfHelper.WritePdfFile(content, contractNo, path, "PDF");
            bool isSucc = !String.IsNullOrEmpty(entity.OriginalFileUrl);