0 Replies Latest reply on Jul 3, 2014 9:04 AM by anonym321

    weld throws ResourceLoadingException

    Newbie

      I'm trying to get a project running with deltaspike CDI-extension (Testcontrol).

      I get a ResourceLoadingException. Does anyone have an idea for a workaround?

      This is my stacktrace and below I added my dependencies  ...

      I'd appreciate any help

       

      org.jboss.weld.resources.spi.ResourceLoadingException: java.lang.NoClassDefFoundError: Lorg/slf4j/cal10n/LocLogger;

          at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

          at java.lang.Class.getDeclaredFields0(Native Method)

          at java.lang.Class.privateGetDeclaredFields(Class.java:2397)

          at java.lang.Class.getDeclaredFields(Class.java:1806)

          at org.jboss.weld.environment.se.discovery.url.WeldSEResourceLoader.classForName(WeldSEResourceLoader.java:53)

          at org.jboss.weld.environment.se.Weld.initialize(Weld.java:120)

          at org.apache.deltaspike.cdise.weld.WeldContainerControl.boot(WeldContainerControl.java:65)

          at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareTestContext.applyBeforeClassConfig(CdiTestRunner.java:442)

          at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:347)

          at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:374)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

          at org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:129)

          at org.junit.runners.Suite.runChild(Suite.java:127)

          at org.junit.runners.Suite.runChild(Suite.java:26)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:160)

          at org.junit.runner.JUnitCore.run(JUnitCore.java:138)

          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createReqestAndRun(JUnitCoreWrapper.java:139)

          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:111)

          at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:84)

          at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:141)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)

          at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)

          at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)

          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

       

        <dependencies>
        <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <version>6.0</version>
      <scope>provided</scope>
      </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpg-jdk15on</artifactId>
        </dependency>
        <dependency>
      <groupId>net.sf.dozer</groupId>
      <artifactId>dozer</artifactId>
      </dependency>
        <dependency>
      <groupId>de.jollyday</groupId>
      <artifactId>jollyday</artifactId>
      </dependency>
        <dependency>
            <groupId>org.glassfish.main.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
            <scope>provided</scope>
      <exclusions>
      <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-simple</artifactId>
      </exclusion>
      </exclusions>
        </dependency>
         <!-- Configuration of DeltaSpike Core -->
            <dependency>
      <groupId>org.apache.deltaspike.core</groupId>
      <artifactId>deltaspike-core-api</artifactId>
      <version>${deltaspike.version}</version>
      <scope>compile</scope>
      </dependency>
      <dependency>
      <groupId>org.apache.deltaspike.core</groupId>
      <artifactId>deltaspike-core-impl</artifactId>
      <version>${deltaspike.version}</version>
      <scope>runtime</scope>
        </dependency>
        <!-- JBoss Weld (RI) -->
      <dependency>
      <groupId>org.apache.deltaspike.cdictrl</groupId>
      <artifactId>deltaspike-cdictrl-weld</artifactId>
      <version>${deltaspike.version}</version>
      <scope>runtime</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se</artifactId>
      <version>2.2.1.Final</version>
      <exclusions>
      <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      <!-- JUnit -->
      <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
      <exclusions>
      <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      <!--  Test Control Module -->
      <dependency>
      <groupId>org.apache.deltaspike.modules</groupId>
      <artifactId>deltaspike-test-control-module-api</artifactId>
      <version>${deltaspike.version}</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.apache.deltaspike.modules</groupId>
      <artifactId>deltaspike-test-control-module-impl</artifactId>
      <version>${deltaspike.version}</version>
      <scope>test</scope>
      </dependency>
      </dependencies>
      <build>
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
      </resource>
      </resources>
        <plugins>
      <plugin>
      <!-- Maven problem while testRun, therefore exclude javaee from testing -->
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.14</version>
      <configuration>
         <classpathDependencyExcludes>
             <!-- exclude code absent api -->
             <classpathDependencyExclude>javax:javaee-api</classpathDependencyExclude>
             <classpathDependencyExclude>javax:javaee-web-api</classpathDependencyExclude>
             <classpathDependencyExclude>org.slf4j:cal10n</classpathDependencyExclude>
             <classpathDependencyExclude>ch.qos.cal10n:cal10n-api</classpathDependencyExclude>
         </classpathDependencyExcludes>
      </configuration>
      </plugin>
        </plugins>
      </build>