在“更新服务器的部署扫描程序:WildFly 23”期间发生内部错误

Posted

技术标签:

【中文标题】在“更新服务器的部署扫描程序:WildFly 23”期间发生内部错误【英文标题】:An internal error occurred during: "Updating Deployment Scanners for Server: WildFly 23" 【发布时间】:2021-10-31 18:40:17 【问题描述】:

我正在尝试连接到我的 http://localhost:8080/spring-boot-test/ui,但不幸的是我失败了,因为我在 Eclips 上有错误。 WildFly 23 理论上可行,因为我通常会得到他们的本地主机

An internal error occurred during: "Updating Deployment Scanners for Server: WildFly 23".
Could not initialize class org.wildfly.security.auth.client.DefaultAuthenticationContextProvider

An internal error occurred during: "Checking Deployment Scanners for server".
Could not initialize class org.wildfly.security.auth.client.DefaultAuthenticationContextProvider

当我尝试将standalone.xml 中的目录重定向到具有 META-INF 和 WEB-INF 的目标时,我遇到了两个错误

ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0011: The deployment scanner found a directory named META-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or .war. This is likely the result of unzipping an archive directly inside the C:\Users\adame\eclipse-workspace\spring-boot-test\target directory, which is a user error. The META-INF directory will not be scanned for deployments, but it is possible that the scanner may find other files from the unzipped archive and attempt to deploy them, leading to errors.
ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0011: The deployment scanner found a directory named WEB-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or .war. This is likely the result of unzipping an archive directly inside the C:\Users\adame\eclipse-workspace\spring-boot-test\target\ directory, which is a user error. The WEB-INF directory will not be scanned for deployments, but it is possible that the scanner may find other files from the unzipped archive and attempt to deploy them, leading to errors.

Pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.adamkaim.spring</groupId>
      <artifactId>spring-boot-test</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      
      <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
      </parent>
      
      <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
            <version>1.0.0</version>
        </dependency>
      </dependencies>
      
      <properties>
        <java.version>16</java.version>
      </properties>
      
      <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
      </build>
      <packaging>war</packaging>
    </project>

App.java

    package com.adamkaim.spring;
     
     import org.springframework.boot.SpringApplication;
     import org.springframework.boot.autoconfigure.SpringBootApplication;
     
     @SpringBootApplication
     public class App 
         public static void main(String[] args) 
     
             SpringApplication.run(App.class, args);
         
     

地址.java

package com.adamkaim.spring;

import org.springframework.stereotype.Component;

@Component
public class Address 

    private String address="Wall Street 34";

    public String getAddress() 
        return this.address;
    

学生.java

package com.adamkaim.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Student 

    @Autowired
    private Address address;

    public String showInfo()
        return this.address.getAddress();
    

MainView.java

package com.adamkaim.spring;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings("serial")
@SpringUI(path="/ui")
@Title("Titlett")
@Theme("valo")
public class MainView extends UI
    
    @Override
    protected void init(VaadinRequest request) 
        final VerticalLayout verticalLayout = new VerticalLayout();
        
        verticalLayout.addComponent(new Label("Welcome"));
        
        Button button = new Button("Click me");
        
        verticalLayout.addComponent(button);
        
        button.addClickListener(new Button.ClickListener() 
            
            @Override
            public void buttonClick(ClickEvent event) 
                verticalLayout.addComponent(new Label("Button is clicked.."));
            
        );
        
        setContent(verticalLayout);
    


【问题讨论】:

【参考方案1】:

我在尝试从 Eclipse (2021-09) 启动 Wildfly 19.1.0 容器时遇到了同样的错误。容器似乎启动成功了,但是这条消息让我发疯了。

一段时间后,我在 Wildfly Google 网上论坛上看到了这条消息,这解决了我的问题!

将 --add-opens=java.base/java.security=ALL-UNNAMED 添加到 eclipse.ini 解决了我这边的问题

感谢https://groups.google.com/g/wildfly/c/_OuPrpsF2pY/m/xLt6u-IfBgAJ 中的原作者 Rahim Alizada。

选项--add-opens 在运行时打开通知模块(所有类型和成员),允许来自目标模块的深度反射(在这种情况下,其他所有人 - ALL-UNNAMED )。

JEP 261 中有关此选项的更多信息。

我尝试在我的系统中仅使用 Java 8 运行 Eclipse,如果我没记错的话,我可以正常工作,但是这些新 Eclipse 版本上的某些模块需要 Java 11 才能正确加载。

【讨论】:

为我工作,谢谢!我在 eclipse.ini 的 VM 部分之后添加了这一行。

以上是关于在“更新服务器的部署扫描程序:WildFly 23”期间发生内部错误的主要内容,如果未能解决你的问题,请参考以下文章

NOIP 2015 & SDOI 2016 Round1 & CTSC 2016 & SDOI2016 Round2游记

秋的潇洒在啥?在啥在啥?

上传的数据在云端的怎么查看,保存在啥位置?

在 React 应用程序中在哪里转换数据 - 在 Express 中还是在前端使用 React?

存储在 plist 中的数据在模拟器中有效,但在设备中无效

如何在保存在 Mongoose (ExpressJS) 之前在模型中格式化数据