Hello,

as recommended here https://deltaspike.apache.org/community.html#JIRA I would 
like to ask for help with a possible bug via the mailing list first.

I am trying to use the deltaspike test module (CdiTestRunner) in a Jakarta 
environment. Therefore some of the dependencies have the jakarta classifier. 
Unfortunately this is not working anymore. For demonstration purose I reduced 
the project to the necessary:


I get this stack trace during test execution:


java.util.ServiceConfigurationError: 
org.apache.deltaspike.core.spi.config.ConfigSourceProvider: Provider 
org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider could not be 
instantiated
 at java.util.ServiceLoader.fail(ServiceLoader.java:232)
 at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
 at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
 at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
 at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
 at 
org.apache.deltaspike.core.util.ServiceUtils.loadServiceImplementations(ServiceUtils.java:81)
 at org.apache.deltaspike.core.impl.config.ConfigImpl.init(ConfigImpl.java:80)
 at 
org.apache.deltaspike.core.impl.config.ConfigProviderImpl.getConfig(ConfigProviderImpl.java:53)
 at 
org.apache.deltaspike.core.impl.config.ConfigProviderImpl.getConfig(ConfigProviderImpl.java:43)
 at 
org.apache.deltaspike.core.api.config.ConfigResolver.resolve(ConfigResolver.java:655)
 at 
org.apache.deltaspike.testcontrol.api.junit.TestBaseConfig$ContainerIntegration.(TestBaseConfig.java:29)
 at 
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.(CdiTestRunner.java:89)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
Caused by: java.lang.NoClassDefFoundError: jakarta/naming/NamingException
 at 
org.apache.deltaspike.core.impl.config.LocalJndiConfigSource.getPropertyValue(LocalJndiConfigSource.java:53)
 at 
org.apache.deltaspike.core.impl.config.BaseConfigSource.initOrdinal(BaseConfigSource.java:54)
 at 
org.apache.deltaspike.core.impl.config.LocalJndiConfigSource.(LocalJndiConfigSource.java:39)
 at 
org.apache.deltaspike.core.impl.config.DefaultConfigSourceProvider.(DefaultConfigSourceProvider.java:59)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 at java.lang.Class.newInstance(Class.java:442)
 at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
 ... 26 more
Caused by: java.lang.ClassNotFoundException: jakarta.naming.NamingException
 at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
 ... 36 more


Here the pom.xml:


<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";
    xmlns="http://maven.apache.org/POM/4.0.0";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.example.cdi.test</groupId>
    <artifactId>cdi-test</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <deltaspike.version>1.9.6</deltaspike.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.deltaspike.modules</groupId>
            <artifactId>deltaspike-test-control-module-api</artifactId>
            <version>${deltaspike.version}</version>
            <classifier>jakarta</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.deltaspike.modules</groupId>
            <artifactId>deltaspike-test-control-module-impl</artifactId>
            <version>${deltaspike.version}</version>
            <classifier>jakarta</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.deltaspike.cdictrl</groupId>
            <artifactId>deltaspike-cdictrl-weld</artifactId>
            <version>${deltaspike.version}</version>
            <classifier>jakarta</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.se</groupId>
            <artifactId>weld-se-core</artifactId>
            <version>4.0.0.Alpha3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


And the actual test I would like to execute:


import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(CdiTestRunner.class)
public class CdiTest {

    @Test
    public void test() {
    }
}

I hope you can help me with this.

Best Regrads,
Michael


The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other than the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.

Reply via email to