繁体   English   中英

发生内部错误:“更新服务器部署扫描器:WildFly 23”

[英]An internal error occurred during: "Updating Deployment Scanners for Server: WildFly 23"

我正在尝试连接到我的 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.

密码.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>

申请.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();
    }
}

主视图.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);
    }

}

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

过了一会儿,我在 Wildfly Google Groups 上看到了这条消息,这解决了我的问题!

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

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

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

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

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

我在 eclipse 中部署 wildfly 23 服务器时遇到了这个错误

期间发生内部错误:“更新服务器的部署扫描程序:WildFly 23”。 无法初始化 class org.wildfly.security.auth.client.DefaultAuthenticationContextProvider

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM