Arquillian Container Payara Managed无法启动域-ClassNotFoundException:DomainResource

问题描述 投票:0回答:1

我无法在本地payara服务器上正常运行arquillian测试。在没有测试的情况下启动我的应用程序,并在同一台payara服务器上运行完全正常。我收到以下错误:

[Sep 21,2019 9:35:06 AMfish.payara.ar​​quillian.container.payara.clientutils.PayaraClientUtilgetResponseMap SCHWERWIEGEND:退出代码:失败,消息:错误处理请求时发生。请查看有关的服务器日志细节。 [状态:SERVER_ERROR原因:服务不可用] 9月21日,2019 9:35:06 AMfish.payara.ar​​quillian.container.payara.CommonPayaraManager启动SCHWERWIEGEND:无法连接至http://127.0.0.1:4848

上的DAS

我在pom文件中使用它:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>1.4.1.Final</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian.junit</groupId>
                <artifactId>arquillian-junit-container</artifactId>
                <version>1.4.1.Final</version>
                <scope>test</scope>
            </dependency>
        </dependencies>

<profiles>
    <profile>
        <id>payara-managed</id>

        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>

        <dependencies>
            <dependency>
                <groupId>fish.payara.arquillian</groupId>
                <artifactId>arquillian-payara-server-managed</artifactId>
                <version>1.1</version>
                <scope>test</scope>
            </dependency>
        </dependencies>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

这是我的档案文件:

<?xml version="1.0" encoding="UTF-8"?>

<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian"
            xsi:schemaLocation="http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <defaultProtocol type="Servlet 3.0"/>

    <container qualifier="payara">
        <configuration>
            <property name="glassFishHome">D:\Development\Tools\payara5</property>
            <property name="domain">domain1</property>
        </configuration>
    </container>

</arquillian>

我的payara网络文件:

<!DOCTYPE payara-web-app PUBLIC "-//Payara.fish//DTD Payara Server 4 Servlet 3.0//EN" "https://raw.githubusercontent.com/payara/Payara-Server-Documentation/master/schemas/payara-web-app_4.dtd">
<payara-web-app>
    <context-root>/</context-root>
</payara-web-app>

我的测试文件:

package com.denfri91.maka.persistence;

import com.denfri91.maka.common.entity.Saison;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.inject.Inject;

import static org.junit.Assert.assertFalse;

@RunWith(Arquillian.class)
public class SaisonRepositoryTest {
    @Inject
    SaisonRepository saisonRepository;

    @Deployment
    public static JavaArchive createDeployment() {
        return ShrinkWrap.create(JavaArchive.class)
                .addClasses(Saison.class, SaisonRepository.class)
                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                .addAsManifestResource(EmptyAsset.INSTANCE, "payara-web.xml")
                .addAsResource("META-INF/persistence.xml");
    }

    @Test
    public void test_saisons_exist() {
        assertFalse(saisonRepository.queryAll().isEmpty());
    }
}

我的持久性文件:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">

    <persistence-unit name="MaKaPU" transaction-type="JTA">
        <jta-data-source>jdbc/tvs_maka</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="eclipselink.ddl-generation" value="create-or-extend-tables"/>
            <property name="eclipselink.ddl-generation.output-mode" value="database"/>
            <property name="eclipselink.cache.shared.default" value="false"/>
        </properties>
    </persistence-unit>
</persistence>

server.log中的某些堆栈跟踪:

[2019-09-21T10:06:17.177+0200] [Payara 5.193] [INFORMATION] [] [fish.payara.nucleus.notification.NotificationService] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1569053177177] [levelValue: 800] [[
  Payara Notification Service bootstrapped with configuration: NotificationExecutionOptions{enabled=true, notifierConfigurationExecutionOptionsList={LOG=LogNotifierConfigurationExecutionOptions{useSeparateLogFile=false} NotifierConfigurationExecutionOptions{notifierType=LOG, enabled=true, noisy=true}}}]]

[2019-09-21T10:06:17.220+0200] [Payara 5.193] [INFORMATION] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=27 _ThreadName=RunLevelControllerThread-1569053163173] [timeMillis: 1569053177220] [levelValue: 800] [[
  Network Listener JMS_PROXY_default_JMS_host started in: 5ms - bound to [/0.0.0.0:7676]]]

[2019-09-21T10:06:17.365+0200] [Payara 5.193] [INFORMATION] [NCLS-JMX-00005] [javax.enterprise.system.jmx] [tid: _ThreadID=149 _ThreadName=Thread-16] [timeMillis: 1569053177365] [levelValue: 800] [[
  JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://0.0.0.0:8686/jndi/rmi://0.0.0.0:8686/jmxrmi]]

[2019-09-21T10:06:17.707+0200] [Payara 5.193] [SCHWERWIEGEND] [] [javax.enterprise.admin.rest] [tid: _ThreadID=158 _ThreadName=admin-thread-pool::admin-listener(2)] [timeMillis: 1569053177707] [levelValue: 1000] [[

java.lang.ClassNotFoundException: org.glassfish.admin.rest.resources.generatedASM.DomainResource not found by org.glassfish.main.admin.rest-service [343]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597)
    at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.glassfish.admin.rest.adapter.RestManagementResourceProvider.getResourceClasses(RestManagementResourceProvider.java:110)
    at org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:313)
    at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:175)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
    at java.lang.Thread.run(Thread.java:748)
]]

[2019-09-21T10:06:17.735+0200] [Payara 5.193] [INFORMATION] [NCLS-REST-00003] [javax.enterprise.admin.rest] [tid: _ThreadID=158 _ThreadName=admin-thread-pool::admin-listener(2)] [timeMillis: 1569053177735] [levelValue: 800] [[
  An error occurred while processing the request. Please see the server logs for details.
java.lang.IllegalArgumentException: Registered component class cannot be null.
    at org.glassfish.jersey.model.internal.CommonConfig.checkComponentClassNotNull(CommonConfig.java:562)
    at org.glassfish.jersey.model.internal.CommonConfig.register(CommonConfig.java:400)
    at org.glassfish.jersey.server.ResourceConfig.register(ResourceConfig.java:398)
    at org.glassfish.jersey.server.ResourceConfig.registerClasses(ResourceConfig.java:474)
    at org.glassfish.jersey.server.ResourceConfig.<init>(ResourceConfig.java:340)
    at org.glassfish.admin.rest.adapter.AbstractRestResourceProvider.getResourceConfig(AbstractRestResourceProvider.java:106)
    at org.glassfish.admin.rest.adapter.RestManagementResourceProvider.getResourceConfig(RestManagementResourceProvider.java:96)
    at org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:323)
    at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:175)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
    at java.lang.Thread.run(Thread.java:748)
]]

您有什么想法我做错了吗? jdbc连接已正确配置,因为就像我提到的那样没有Arquillian,一切正常。

maven java-ee jboss-arquillian payara
1个回答
1
投票

应使用Payara 5.193.1。修复。请参阅发行说明:https://docs.payara.fish/release-notes/release-notes-193.1.html

[PAYARA-4131]-java.lang.ClassNotFoundException:org.glassfish.admin.rest.resources.genicASM.DomainResource不是由org.glassfish.main.admin.rest-service找到

这里是PR对其进行修复:https://github.com/payara/Payara/pull/4224

© www.soinside.com 2019 - 2024. All rights reserved.