Category Archives: Error

[Solved] kettle Error: Unexpected problem reading shared objects from XML file

ETL error:

Unexpected problem reading shared objects from XML file: null

An error occurred while reading the shared file (continue loading the message)

“A fatal error occurred while reading the shared object” when creating a new transformation for the kettle

“Unexpected problem reading shared objects from XML file: null”

When saving KTR and KJB, an error message will pop up: “unable to save shared objects”

”Unexpected problem reading shared objects from XML file:“

Problem:

This is caused by improper operation when developing shared DB connection (database connection).

Solution:

Find it kettle/shared.XML (usually in C:\users\user\.Kettle) file; delete the content between <sharedobjects >… </sharedobjects> to solve this problem;

Mybatis configuration Tag Add settings Error [How to Solve]

Record a small problem today
When learning mybatis, you must check the SQL statement, and the related configuration should be introduced into the check statement, as follows

<settings>
<setting name="logImpl" value="STDOUT_LOGGING"/>
</settings>

However, I have a habit that I always arrange the configuration files in my own order, that is, at the bottom. Who knows, it will report an error. Have a look

1. After checking for a long time, I learned that mybatis config has its own set of node sorting order, which must be observed as follows:

properties,settings,typeAliases,typeHandlers,objectFactory,objectWrapperFactory,reflectorFactory,plugins,environments,databaseIdProvider,mappers

Dear friends, remember

[Solved] cannot kill Docker container – permission denied

Just recently I had the following issue while trying to stop my containers:

Error response from daemon: Cannot kill container: 9e81a44d4c79: Cannot kill container xxxx: unknown error after kill: runc did not terminate sucessfully: container_linux.go:392: signaling init process caused "permission denied"

The container was started regularly with docker-compose up, and after that, it wasn’t reacting to:

docker-compose down

docker-compose stop xxx or docker container stop xxx
It turned out that AppArmor service was messing up with Docker. AppArmor (or “Application Armor”) is a Linux kernel security module that allows the system administrator to restrict programs’ capabilities with per-program profiles. For this problem with containers, it helped me to remove the unknown from AppArmor using the following command:

sudo aa-remove-unknown

After that, I was able to stop and kill my containers. To kill all running Docker containers, you can use the following command:

docker container kill $(docker ps -q)

If this didn’t work for you, you can remove AppArmor, and then install it afterward if it’s needed:

sudo apt-get purge --auto-remove apparmor`
`sudo service docker restart`
`docker system prune --all --volumes

[Solved] Hibernate Error: org.hibernate.InstantiationException: No default constructor for entity

Error performing load command: org.hibernate. InstantiationException: No default constructor for entity: : entity. User

Reason:

The no-argument constructor, which is also a JavaBean convention, is a requirement for all persistent classes. Hibernate needs to create objects for you, using Java Reflection.

All persistent classes must have a construction method without parameters (which is also the specification of JavaBean). Hibernate needs to use java reflection to create objects for you.
— from the official document hibernate getting started guide

Solution:

When the entity class declares other construction methods with parameters, you need to explicitly declare the construction methods without parameters.

.Net Core 5.0 Upload File sizes is limited via Swagger Api: error: request entity too large

1. Add the following code to startup

public void ConfigureServices(IServiceCollection services)
{
    services.Configure<FormOptions>(options =>
    {
        // Set the limit to 256 MB
        options.MultipartBodyLengthLimit = 268435456;
    });
}

2. Add in program

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.ConfigureKestrel((context, options) =>
            {
                // Handle requests up to 50 MB
                options.Limits.MaxRequestBodySize = 52428800;
            })
            .UseStartup<Startup>();
        });

3. Adding a property to an action method

// Handle requests up to 50 MB
[RequestSizeLimit(52428800)]
public ActionResult<ResultDto<bool>> AddFile()
{
    ...
}

I recommend the first one and write the size limit to the configuration file.

SpringBoot Project Package Error: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin (Running Normally)

error message

 [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.1.RELEASE:repackage (default) on project xc-framework-common: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.1.RELEASE:repackage failed:

Solution:

Remove the following plug-ins from POM

<plugin>  
        <groupId>org.springframework.boot</groupId>  
        <artifactId>spring-boot-maven-plugin</artifactId> 
</plugin> 

[Solved] Zookeeper reads data error: Exception in thread “main” org.I0Itec.zkclient.exception.ZkMarshallingError…

1. Problem description

ZK makes an error when reading Kafka’s broker information, as follows:

22:52:47,125 DEBUG ClientCnxn:846 - Reading reply sessionid:0x10b00878c620372, packet:: clientPath:null serverPath:null finished:false header:: 1,4  replyHeader:: 1,2793,0  request:: '/myKafka/brokers/ids/0,F  response:: #7b226c697374656e65725f73656375726974795f70726f746f636f6c5f6d6170223a7b22504c41494e54455854223a22504c41494e54455854227d2c22656e64706f696e7473223a5b22504c41494e544558543a2f2f63756c2d746f757269736d2d303030383a38303835225d2c226a6d785f706f7274223a393538312c22686f7374223a2263756c2d746f757269736d2d30303038222c2274696d657374616d70223a2231363339333131303131363136222c22706f7274223a383038352c2276657273696f6e223a347d,s{2649,2649,1639311011619,1639311011619,0,0,0,75154400957563721,204,0,2649} 
Exception in thread "main" org.I0Itec.zkclient.exception.ZkMarshallingError: java.io.StreamCorruptedException: invalid stream header: 7B226C69
	at org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:37)
	at org.I0Itec.zkclient.ZkClient.derializable(ZkClient.java:740)
	at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:773)
	at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:761)
	at com.lagou.zk.demo.Demo.main(Demo.java:33)
Caused by: java.io.StreamCorruptedException: invalid stream header: 7B226C69
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:936)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:394)
	at org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:31)
	... 4 more

2. Solutions

According to the error message, an error occurs during deserialization. Here, we use the custom serialization type

public class ZkStringSerializer implements ZkSerializer {

    @Override
    public byte[] serialize(Object data) throws ZkMarshallingError {
        return String.valueOf(data).getBytes();
    }

    @Override
    public Object deserialize(byte[] bytes) throws ZkMarshallingError {
        return new String(bytes);
    }

}

Set after zkclient is created

ZkClient zkClient = new ZkClient("10.7.2.55:883");
// Set custom serialization type
zkClient.setZkSerializer(new ZkStringSerializer());

Done!

[Solved] Mobx error: Support for the experimental syntax ‘decorators-legacy’ isn’t currently enab

error message

Support for the experimental syntax ‘decorators-legacy’ isn’t currently enab

Install mobx and report an error when using the decorator

Cause: the current decorator is not recognized

Solution: install the related package to make the code identify the decorator

Method: modify JSON and install related plug-ins

Create react app creates a new project package JSON will not be displayed and needs to be run

Display the configuration file. This operation is irreversible

npm run eject

If the report is wrong

Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] eject script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The main problem is that scaffolding is added Gitgnore file, but there is no local warehouse. If it is a git managed package, the following steps are not required

We need to add our project to the local warehouse, open the project folder with git, and then run the following command:

git init
git add .
git commit -m 'comment out'

Found package json

"babel": {
    "plugins": [
      [
        "@babel/plugin-proposal-decorators",
        {
          "legacy": true
        }
      ]
    ],
    "presets": [
      "react-app"
    ]
  },

Rerun project

Done!

[Solved] An attempt was made to call a method that does not exist. The attempt was made from the following location:

When integrating redis with springboot, an error is reported when introducing the jar package:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-12-13 15:56:24.872 ERROR 24864 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory.getPoolConfig(LettuceConnectionConfiguration.java:188)

The following method did not exist:

    org.apache.commons.pool2.impl.GenericObjectPoolConfig.setMaxWait(Ljava/time/Duration;)V

The calling method's class, org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory, was loaded from the following location:

    jar:file:/D:/develop_toops/maven/maven_repository/org/springframework/boot/spring-boot-autoconfigure/2.6.1/spring-boot-autoconfigure-2.6.1.jar!/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration$PoolBuilderFactory.class

The called method's class, org.apache.commons.pool2.impl.GenericObjectPoolConfig, is available from the following locations:

    jar:file:/D:/develop_toops/maven/maven_repository/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar!/org/apache/commons/pool2/impl/GenericObjectPoolConfig.class

The called method's class hierarchy was loaded from the following locations:

    org.apache.commons.pool2.impl.GenericObjectPoolConfig: file:/D:/develop_toops/maven/maven_repository/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar
    org.apache.commons.pool2.impl.BaseObjectPoolConfig: file:/D:/develop_toops/maven/maven_repository/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar
    org.apache.commons.pool2.BaseObject: file:/D:/develop_toops/maven/maven_repository/org/apache/commons/commons-pool2/2.6.0/commons-pool2-2.6.0.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration$PoolBuilderFactory and org.apache.commons.pool2.impl.GenericObjectPoolConfig

Solution:

Delete the version number in the dependency, and springboot will automatically match the appropriate version

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-pool2</artifactId>
</dependency>

[Solved] okhttp3 Error: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

Okhttp3 upload, error report, prompt:

java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

Okhttp version: okhttp-3.0 0.jar, okio-2.0.0.jar

The local test is normal. This error is reported after the relevant files are updated to the server.

Found ideas online: https://github.com/square/okhttp/issues/5299

The local machine is normal because the complete dependency of okhttp is obtained through Maven. When it is placed on the server, only okhttp and okio packages are placed, and kotlin stdlib is missing.

So from this machine The jar package of kotlin is found in the M2 Directory: kotlin-stdlib-1.2 60.jar,

Put the jar package on the server, restart and solve the problem