You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

部署Spring Boot WAR到远程Wildfly遇vfs未安装错误(Jobrunr相关)

问题描述

技术栈

  • Java 8
  • Wildfly 10(远程托管服务)
  • 10.3.38-MariaDB
  • Spring Boot 2.7.8
  • jobrunr 3.1.2
  • Maven(打包方式为war)

问题现象

本地Eclipse中通过Spring Boot运行Web应用完全正常,但上传到远程Wildfly服务时,出现Provider "vfs" not installed错误,问题根源指向jobrunr的sqlStorageProvider Bean。

堆栈跟踪信息

Cannot upload deployment: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host."/myapp-0.0.1-SNAPSHOT"" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/myapp-0.0.1-SNAPSHOT": 

java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobScheduler'
defined in class path resource [org/jobrunr/autoconfigure/JobRunrAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'jobScheduler' parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageProvider' defined in class path resource [org/jobrunr/autoconfigure/storage/JobRunrSqlStorageAutoConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jobrunr.storage.StorageProvider]: Factory method 'sqlStorageProvider' threw exception;
nested exception is org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobScheduler' defined in class path resource [org/jobrunr/autoconfigure/JobRunrAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'jobScheduler' parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageProvider' defined in class path resource [org/jobrunr/autoconfigure/storage/JobRunrSqlStorageAutoConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jobrunr.storage.StorageProvider]: Factory method 'sqlStorageProvider' threw exception;
nested exception is org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobScheduler' defined in class path resource [org/jobrunr/autoconfigure/JobRunrAutoConfiguration.class]: Unsatisfied dependency expressed through method 'jobScheduler' parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageProvider' defined in class path resource [org/jobrunr/autoconfigure/storage/JobRunrSqlStorageAutoConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jobrunr.storage.StorageProvider]: Factory method 'sqlStorageProvider' threw exception;
nested exception is org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageProvider' defined in class path resource [org/jobrunr/autoconfigure/storage/JobRunrSqlStorageAutoConfiguration.class]: Bean instantiation via factory method failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jobrunr.storage.StorageProvider]: Factory method 'sqlStorageProvider' threw exception;
nested exception is org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jobrunr.storage.StorageProvider]: Factory method 'sqlStorageProvider' threw exception;
nested exception is org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: org.jobrunr.JobRunrException: JobRunr encountered a problematic exception. Please create a bug report (if possible, provide the code to reproduce this and the stacktrace)
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.nio.file.FileSystemNotFoundException: Provider "vfs" not installed"}}

解决方案

方案1:排除JobRunr中冲突的依赖

JobRunr默认依赖的jackson-databind可能与Wildfly自带版本冲突,导致VFS相关问题。在Maven的pom.xml中排除该依赖:

<dependency>
    <groupId>org.jobrunr</groupId>
    <artifactId>jobrunr-spring-boot-starter</artifactId>
    <version>3.1.2</version>
    <exclusions>
        <exclusion>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </exclusion>
    </exclusions>
</dependency>

方案2:手动注册VFS文件系统提供者

Wildfly的VFS提供者在部署时可能未被正确加载,创建配置类手动注册:

import org.jboss.vfs.VFS;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.nio.file.spi.FileSystemProvider;

@Configuration
public class VFSConfig {

    @Bean
    public FileSystemProvider vfsFileSystemProvider() {
        return VFS.getChildFileSystems().iterator().next().provider();
    }
}

方案3:明确JobRunr的存储配置

在application.properties或application.yml中指定存储类型,避免JobRunr尝试访问VFS路径:

jobrunr.storage.database-type=mariadb
jobrunr.storage.skip-create=false

方案4:使用Wildfly部署描述符排除冲突模块

在WEB-INF目录下创建jboss-deployment-structure.xml文件,排除Wildfly中与JobRunr冲突的模块:

<jboss-deployment-structure>
    <deployment>
        <exclusions>
            <module name="com.fasterxml.jackson.core.jackson-databind"/>
        </exclusions>
    </deployment>
</jboss-deployment-structure>

内容的提问来源于stack exchange,提问作者Gary Kephart

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 04:37:48