Tomcat启动WARN,Failed to scan from classloader

我是用maven多模块项目,有以下几个子项目
admin(后台,springmvc)
service(服务层,只有源码)
data(数据访问层,只有源码)
config(只有配置文件,mysql.yml)
admin依赖service,service依赖data,data依赖config,在admin目录下面打包,做法是将config.jar用unpack,将里面的mysql.yml复制到admin的resource下面,
admin的源码,resource,依赖的lib全都各自独立出来,在copy-dependencies到lib目录时,将config排除(因为已经复制了里面的配置文件)。现在把这些东西放到服务器上运行,启动tomcat时候会出现一个WARN,但是不影响启动,网站也能正常访问
WARN截图

下面是admin的打包方式

 <profiles>
        <profile>
            <id>development</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>install</id>
            <build>
                <finalName>${project.name}</finalName>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <excludes>
                            <exclude>**/*</exclude>
                        </excludes>
                    </resource>
                    <resource>
                        <directory>src/main/webapp</directory>
                        <excludes>
                            <exclude>**/*</exclude>
                        </excludes>
                    </resource>
                </resources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <classpathPrefix>lib/</classpathPrefix>
                                    <mainClass>xxx.Application</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-dependencies</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/lib</outputDirectory>
                                    <overWriteReleases>false</overWriteReleases>
                                    <overWriteSnapshots>false</overWriteSnapshots>
                                    <overWriteIfNewer>true</overWriteIfNewer>
                                    <excludeArtifactIds>xxx-config</excludeArtifactIds>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unpack</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>xxx</groupId>
                                            <artifactId>xxx-config</artifactId>
                                            <version>0.0.1-SNAPSHOT</version>
                                            <type>jar</type>
                                            <overWrite>true</overWrite>
                                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                                            <includes>mysql.yml,kafka.yml</includes>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/resources</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources</directory>
                                            <filtering>true</filtering>
                                            <exclude>server.sh</exclude>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-webapp</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/resources/META-INF/resources</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/webapp</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-server-sh</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/main/resources</directory>
                                            <include>server.sh</include>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

服务器上的目录

启动脚本

虽然是个WARN,不影响程序运行,但是我一直想找出来哪里出问题了,tomcat怎么就会去扫描一个不存在lib目录下的jar呢。
ps:tomcat是spring boot内置的容器

2个回答

没有filter,只有一个interceptor,而且和这个搭不上边,配置文件就一个logback.xml

检查一下1filter文件过滤有没有问题,还有配置文件

c920644981
载心问情 没有filter,只有一个interceptor,而且和这个搭不上边,配置文件就一个logback.xml
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐