Category Archives: Error

Error processing tar file(exit status 1): archive/tar: invalid tar header

Make an error record,

I save through PowerShell of windows system docker save XXX | gzip & gt; xxx.tgz  

Error processing tar file (exit status 1): Archive/tar: invalid tar header

There is no problem saving through CMD. PowerShell should use it less in the future. There are many problems.

Error LNK2019: unresolved external symbol WinMain (vs2019)

Reproduced from: (22 messages) error LNK2019: unresolved external symbol_ WinMain@16 (VS2013)_ Deep hidden skill and name – CSDN blog

1、 Problem description
msvcrtd.lib (crtexew. Obj): error LNK2019: unresolved external symbol  _ WinMain@16 , the symbol in the function___ Tmaincrtstartup is referenced
debug \ jk.exe: fatal error lnk1120: an external command that cannot be resolved

error LNK2001: unresolved external symbol  _ WinMain@16
debug/main.exe:fatal error LNK 1120:1 unresolved externals
error executing link.exe;

2、 Causes and solutions
the real reason for this problem is that the C language runtime cannot find an appropriate program entry function,

In general, if it is a Windows program, WinMain is the entry function, and the new project in VS2008 is “Win32 project”

If it is a DOS console program, main is the entry function, and the new project in VS2008 is “Win32 console application”

If the entry function is not specified properly, it is obvious that the C language runtime cannot find the matching function, and it will report an error.

Modify the settings to suit your needs

If it is a Windows program:

1. Select project – & gt; Properties, the property pages window pops up

2. Select configuration properties – & gt; C/C++-> Preprocessor, and then delete it in the item corresponding to preprocessor definitions in the right column_ Console, add_ WINDOWS.

3. Select configuration properties – & gt; Linker-> System, and then change the corresponding item of subsystem in the right column to windows (/ subsystem: Windows)

If it is a console program:

1. Select project – & gt; Properties, the property pages window pops up

2. Select configuration properties – & gt; C/C++-> Preprocessor, and then delete it in the item corresponding to preprocessor definitions in the right column_ Windows, add_ CONSOLE.

3. Select configuration properties – & gt; Linker-> System, and then change the item corresponding to subsystem in the right column to console (/ subsystem: console)

nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)

A server’s back end is not a good front end

Today, the operation and maintenance colleagues changed the server password. They said that they changed the password regularly for security. Ah bah ~ this password has not been changed for several years. There are too many services here. After changing, many places have to be changed. It’s a lot of trouble

The O & M said that the machine was restarted, and then the nginx service was shut down and needed to be restarted

Restart command first (two commands)

cd /usr/local/nginx/sbin
./nginx -s reload

Then he reported a mistake

 

 

  It’s no small matter. Look at the configuration file,

vim /usr/local/nginx/conf/nginx.conf

 

Find PID and find it annotated. Remove it and restart it again

Then I was too young. How could I solve a problem with my bug maker, and then remember that I didn’t specify the configuration directory

Then execute the command

sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

Then restart it. Be sure to watch the directory

 

 

 

Project startup error no transports initialized [debuginit. C: 750]

ERROR: transport library not found: dt_socket
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_LOAD(196)
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_LOAD(509)
JDWP exit error AGENT_ERROR_TRANSPORT_LOAD(196): No transports initialized [debugInit.c:750]

The JDK of the project is inconsistent with the default JDK of the computer. See which one is not installed manually in the IDE and replace it

How to Solve graphviz run Error in Pychart

Problem: after installing graphviz, it runs normally on the command line (Python runs normally, PDF can be output normally, pop up jump to view graphics), but documents cannot be output normally on pychart and notbook.

And an error will appear in pychar:

ExecutableNotFound: failed to execute [‘dot’], make sure the Graphviz executables are on your systems’ PATH

Solution:

Add the following two new variables to the system environment variable:

GRAPHVIZ_ DOT

GRAPHVIZ_ INSTALL_ DIR

The values are bot.exe address and graphviz root directory respectively

Analysis of pdfbox’s error in converting PDF file to picture cannot read JPEG2000 image and the introduction of JPEG and JPEG2000

1、 Problem background

1. How to fix “cannot read JPEG2000 Image: Java advanced imaging (Jai) image I/O tools are not installed”

I’m building a java project to get images from PDF using pdfbox. Because I’m using Tika app for other functions, I decided to use the pdfbox in tika-app-1.20.jar.

I have tried to include jai-imageio-core-1.3.1.jar because Tika app is bundled with this jar. I tried using Tika app jar alone.

The code that throws the error:

PDXObject object=resources.getXObject(cosName);

Bad log trace:

org.apache.pdfbox.filter.MissingImageReaderException: Cannot read JPEG2000 image: 
Java Advanced Imaging (JAI) Image I/O Tools are not installed at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:163) at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:115) at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:64) at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:77) at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:175) at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:163) at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:236) at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:140) at org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70) at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:426)

But I’m sure I have the Jai imageio kernel in Tika, which is invisible when I run the code.

Solution:

1. It happens that it requires an additional jar known as jai-imageio-jpeg 2000 to support jp2k images.

2. In fact, I found this error by chance, but it is mentioned in the pdfbox document here. You need to add the following dependencies to pom.xml:

<dependency>
    <groupId>com.github.jai-imageio</groupId>
    <artifactId>jai-imageio-core</artifactId>
    <version>1.4.0</version>
</dependency>

<dependency>
    <groupId>com.github.jai-imageio</groupId>
    <artifactId>jai-imageio-jpeg2000</artifactId>
    <version>1.3.0</version>
</dependency>

<!-- Optional for you ; just to avoid the same error with JBIG2 images -->
<dependency>
    <groupId>org.apache.pdfbox</groupId>
    <artifactId>jbig2-imageio</artifactId>
    <version>3.0.3</version>
</dependency>

To avoid the same error in JBIG2 images, you can add the following dependency.

If you are using gradle, add dependencies like this:

dependencies {
    implementation 'com.github.jai-imageio:jai-imageio-core:1.4.0'
    implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:1.3.0'

    // Optional for you ; just to avoid the same error with JBIG2 images
    implementation 'org.apache.pdfbox:jbig2-imageio:3.0.3'
}

2、 Project instance scenario

1. Problem scenario:

In the project, there is a bug in the document conversion – PDF to picture function (using pdfbox2.0.2). Many picture elements in the original PDF file disappear after being converted into pictures. This is not bad. Check the log and find a large number of errors:

ERROR   o.a.p.contentstream.PDFStreamEngine   eight hundred and ninety  –  Cannot   read   JPEG2000   image:   Java   Advanced   Imaging   (JAI)   Image   I/O   Tools   are   not   installed

This means that there is a lack of I/O tools to read JPEG2000 images. The problem should be here.

2. Cause of the problem: the scanned image that may be included in the PDF file is a picture in JPEG2000 format, so the pdfbox needs the support of Jai in the conversion process.

3. Solution: add related dependencies

Overseas stackoverflow: https://stackoverflow.com/questions/42169154/pdfbox1-8-12-convert-pdf-to-white-page-image , the last humble little reply gave inspiration and added dependence

4. Comparison:

Before adding dependency – picture missing

After adding dependency – picture display

3、 Introduction to JPEG and JPEG2000

1. Background:

The full name of JPEG is joint photographic experts group. It is a committee engaged in the formulation of still image compression standards under the international standards organization (ISO). It has formulated the first set of national standard still image compression standard: ISO 10918-1, which is commonly known as JPEG. Due to the excellent quality of JPEG, it has achieved great success in just a few years. At present, 80% of the images on the website adopt JPEG compression standard.

However, with the rapid development of multimedia applications, the traditional JPEG compression technology can not meet the requirements of people for multimedia image data. Therefore, JPEG 2000, a new generation of still image compression technology with higher compression rate and more new functions, was born. The official name of JPEG 2000 is “ISO 15444”, which is also formulated by JPEG organization.

2. Basic concepts

JPEG 2000 is an image compression standard based on wavelet transform, which is created and maintained by the Joint Photographic Experts Group. JPEG 2000 is generally considered as the next generation image compression standard to replace JPEG (based on discrete cosine transform) in the future. The extension name of JPEG 2000 file is usually. JP2, and the MIME type is image/JP2.

JPEG2000 has a higher compression ratio and will not produce the block blur artifacts generated by the original JPEG standard based on discrete cosine transform.

JPEG2000 supports both lossy compression and lossless compression.

In addition, JPEG2000 also supports more complex progressive display and download.

Because JPEG2000 can still have a good compression rate under lossless compression, JPEG2000 has been widely used in the analysis and processing of medical images with high image quality requirements.

3. JPEG2000 principle

The biggest difference between JPEG 2000 and traditional JPEG is that it abandons the block coding method based on discrete cosine transform, and adopts the multi analysis coding method based on wavelet transform.

The main purpose of wavelet transform is to extract the frequency components of the image. Refer to the following figure for a simple schematic diagram.

4. JPEG2000 benefits

(1) As an upgraded version of JPEG, JPEG 2000 aims at high compression (low bit rate), and its compression rate is about 30% higher than JPEG
(2) JPEG2000 supports both lossy and lossless compression, while JPEG can only support lossy compression. Therefore, it is suitable for saving important pictures

(3) JPEG2000 can realize progressive transmission, which is an extremely important feature of JPEG2000. This is our understanding of GIF

The “fade out” characteristic of format image. It first transmits the outline of the image, and then gradually transmits the data to continuously improve the image quality, so that the image can be displayed from hazy to clear, instead of JPEG

Same, displayed slowly from top to bottom
(4) JPEG2000 supports the so-called “region of interest” feature. You can arbitrarily specify the compression quality of the region of interest on the image, and you can also select the specified part to decompress first. In this way, we can easily highlight the key points.

5. JPEG2000 copyright and patent issues

JPEG2000 has copyright and patent risks. This may be one of the reasons why JPEG2000 technology has not been widely used at present.

JPEG2000 standard itself has no licensing fee. However, because a large number of algorithms in the core part of coding are patented, it is generally considered that it is unlikely to avoid these patent fees to develop a commercial encoder free of licensing fee.

How to Solve Seata Nacos connection error: unknown user!

Seata connects to nacos and keeps reporting errors,

<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>
<div id='created'> Fri Jul 23 14:28:47 GMT+08:00 2021</div><div>There was an unexpected error (type=Forbidden, status=403).</div>
<div>unknown user!</div>

The error is very simple, it is unknown user!

Check log, log path

/root/logs/nacos/naming.log
Sure enough, I found the clues, because my password has the @ symbol, and when seata passed it, it was escaped to %40. I tested it, and other examples! It will also be escaped, remove the special characters in the password, modify the nacos password, and the connection is successful.

After Jenkins installation, the plug-in installation failed. Error suncertpathbuilderexception

Jenkins plug-in cannot be downloaded

SSL problem of Java
manually install a skip certificate check plug-in through the address https://updates.jenkins.io/download/plugins/skip-certificate-check/1.0/skip-certificate-check.hpi Download

Then manually install the plug-in through Jenkins and restart. Then you can update it.

[Solved] Android O Error: Error inflating class android.webkit.WebView/For security reasons, WebView is not allowed in privileged processes

Device environment:Android O ,   android:sharedUserId=”android.uid.system”  进程
Error: android.view.InflateException: Binary XML file line #24: Error inflating class android.webkit.WebView…
…For security reasons, WebView is not allowed in privileged processes
Solution(Found Online):
1. Add the below codes at the end of Application In manifest:

<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
                   android:value="true"/>
NOT WORK

two   If the appcompat version in build.gradle under the app file is 1.1.0, WebView will make an error and change it to 1.0.2

NOT WORK

three   (the effect is the same as point 4) the application attribute is added:   android:usesCleartextTraffic=”true”

NOT WORK  (NOT android:sharedUserId="android.uid.system" process)

4. (The effect is the same as point 3.) The application attribute increases.android:networkSecurityConfig=”@xml/network_security_config”
The contents of network_security_config.xml placed under res/xml/.
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true" /> </network-security-config>

NOT WORK  (NOT android:sharedUserId="android.uid.system"  process)

5. Working Method: Call this method first when the Application starts (also add point 3 or 4)

public static void hookWebView(){

    int sdkInt = Build.VERSION.SDK_INT;
    try {
      Class<?> factoryClass = Class.forName("android.webkit.WebViewFactory");
      Field field = factoryClass.getDeclaredField("sProviderInstance");
      field.setAccessible(true);
      Object sProviderInstance = field.get(null);
      if (sProviderInstance != null) {
        Log.i(TAG,"sProviderInstance isn't null");
        return;
      }
 
      Method getProviderClassMethod;
      if (sdkInt > 22) {
        getProviderClassMethod = factoryClass.getDeclaredMethod("getProviderClass");
      } else if (sdkInt == 22) {
        getProviderClassMethod = factoryClass.getDeclaredMethod("getFactoryClass");
      } else {
        Log.i(TAG,"Don't need to Hook WebView");
        return;
      }
      getProviderClassMethod.setAccessible(true);
      Class<?> factoryProviderClass = (Class<?>) getProviderClassMethod.invoke(factoryClass);
      Class<?> delegateClass = Class.forName("android.webkit.WebViewDelegate");
      Constructor<?> delegateConstructor = delegateClass.getDeclaredConstructor();
      delegateConstructor.setAccessible(true);
      if(sdkInt < 26){//低于Android O版本
        Constructor<?> providerConstructor = factoryProviderClass.getConstructor(delegateClass);
        if (providerConstructor != null) {
          providerConstructor.setAccessible(true);
          sProviderInstance = providerConstructor.newInstance(delegateConstructor.newInstance());
        }
      } else {
        Field chromiumMethodName = factoryClass.getDeclaredField("CHROMIUM_WEBVIEW_FACTORY_METHOD");
        chromiumMethodName.setAccessible(true);
        String chromiumMethodNameStr = (String)chromiumMethodName.get(null);
        if (chromiumMethodNameStr == null) {
          chromiumMethodNameStr = "create";
        }
        Method staticFactory = factoryProviderClass.getMethod(chromiumMethodNameStr, delegateClass);
        if (staticFactory!=null){
          sProviderInstance = staticFactory.invoke(null, delegateConstructor.newInstance());
        }
      }
 
      if (sProviderInstance != null){
        field.set("sProviderInstance", sProviderInstance);
        Log.i(TAG,"Hook success!");
      } else {
        Log.i(TAG,"Hook failed!");
      }
    } catch (Throwable e) {
      Log.w(TAG,e);
    }
  }

[Solved] Shared libraries Loading Error: libhwloc.so.5: cannot open shared object file: No such file or directory

This problem occurs when installing a service:

error while loading shared libraries: libhwloc.so.5: cannot open shared object file: No such file or directory

Twice, once on Ubuntu 18 and once on Ubuntu 20.

The solution is as follows:


# Important
sudo apt-get install -y libhwloc-dev

# Method 1:
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6 /usr/lib/x86_64-linux-gnu/libhwloc.so.15

# Method 2:
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so /usr/lib/x86_64-linux-gnu/libhwloc.so.5

When this problem is encountered for the first time, it is normal after executing the command of processing method 1.

However, if you change the system for the second time and use the command of processing method 1, an error will still be reported. So I went to/usr/lib/x86_ Find the file in the 64 Linux GNU directory and find that there is no libhwloc. So. 5. I think it’s outrageous. The installation package was installed normally, but the command was not installed. I’m convinced. I checked the Internet several times, but there was no answer, so I tried to forcibly add a libhwloc. So. 5 file, that is, create a soft connection. I didn’t think it was really OK, ™ Great efforts work miracles.