Invocation of close method failed on bean with name 'dataSource': java.lang.LinkageError: loader constraint violation: loader 'app' wants to load class com.alibaba.druid.pool.DruidConnectionHolder
Assistant
This error typically occurs when there is a conflict between different versions of a library or when a library is being loaded by different class loaders. In this case, it seems that the application is trying to load "com.alibaba.druid.pool.DruidConnectionHolder" from two different sources.
To resolve this error, you should ensure that there is only one version of the library in the classpath and that all dependencies are using the same version. You can also try adjusting the class loading configuration to avoid conflicts between different class loaders.
User
flink1.17 maven-shade-plugin
Assistant
The Maven Shade plugin allows you to create a single executable jar file that includes all of the dependencies of your application. This can be very useful for deploying Flink applications, as you can easily distribute a single jar file that contains all of your code and the necessary Flink libraries.
User
Flink springboot maven-shade-plugin打包
Assistant
To package a Flink Spring Boot application using the Maven Shade plugin, you can add the following configuration to your pom.xml file.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
This configuration sets up the Maven Shade plugin to run during the package phase of the build and creates a shaded jar file that includes all of the dependencies of your application.
The createDependencyReducedPom property is set to false to prevent the plugin from generating a new pom.xml file that only includes the shaded dependencies.
The filters configuration excludes certain files from being included in the shaded jar file. In this case, the META-INF/.SF, META-INF/.DSA, and META-INF/*.RSA files are excluded.
Finally, the transformers configuration tells the Maven Shade plugin to add a Main-Class entry to the manifest file of the shaded jar file. You should replace "com.yourcompany.yourapp.MainClass" with the name of your application's main class.
Once you've added this configuration to your pom.xml file, you can create a shaded jar file by running the following command:
mvn package
This will create a shaded jar file in the target directory of your project. You can then use this jar file to run your Flink application.
This configuration includes the Maven Shade plugin in the build process, sets it to execute during the package phase, and uses it to create a shaded jar file that contains all the dependencies of your application.
In the filters element, you can add exclusions of files that should not be included in the shaded jar. The configuration in this example excludes the signature files.
In the transformers element, you can add transformer elements to specify how to transform certain resources. In this example, there are transformers to specify the main class of the application and to merge the application.properties and application.yaml files.
When you run the mvn package command, the Maven Shade plugin will create the shaded jar file that contains all the necessary dependencies of your Flink Spring Boot application, ready to be deployed.