1 Reply Latest reply on Apr 22, 2013 7:47 AM by bmajsak

    java.lang.NoClassDefFoundError: org/jboss/shrinkwrap/descriptor/spi/NodeProviderImplBase

    gaoyonglu

      my testcase:

       

        @Deployment

          @OverProtocol("Servlet 3.0")

          public static WebArchive createDeployment() {

              return ShrinkWrap

                      .create(WebArchive.class, "basic.war")

                      .addClasses(PageController.class, PageModel.class, DataPage.class, PersistenceVO.class,

                              BaseServiceBean.class, TblOcsBin.class, TblOcsInsBasPoc.class, Producer.class,

                              WebResources.class, MyManagedBean.class)

                      .addAsWebResource("basic/index.xhtml", "/insmanage/index.xhtml")

                      .addAsWebInfResource("common/faces-config.xml", "faces-config.xml")

                      .addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")

                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

                      .setWebXML("common/web.xml");         

          }

       

       

      pom:

      <!-- Dependency on the EJB module so we can use it's services if needed -->

                          <dependency>

                                    <groupId>com.unionpay.jee6</groupId>

                                    <artifactId>poc-ejb</artifactId>

                                    <type>ejb</type>

                                    <scope>provided</scope>

                          </dependency>

       

       

                          <!-- Import the JAX-RS API, we use provided scope as the API is included

                                    in JBoss AS 7 -->

                          <dependency>

                                    <groupId>org.jboss.spec.javax.ws.rs</groupId>

                                    <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

                          <!-- Import the CDI API, we use provided scope as the API is included in

                                    JBoss AS 7 -->

                          <dependency>

                                    <groupId>javax.enterprise</groupId>

                                    <artifactId>cdi-api</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

       

                          <!-- Import the JSF API, we use provided scope as the API is included in

                                    JBoss AS 7 -->

                          <dependency>

                                    <groupId>org.jboss.spec.javax.faces</groupId>

                                    <artifactId>jboss-jsf-api_2.1_spec</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

       

                          <!-- Import the JPA API, we use provided scope as the API is included in

                                    JBoss AS 7 -->

                          <dependency>

                                    <groupId>org.hibernate.javax.persistence</groupId>

                                    <artifactId>hibernate-jpa-2.0-api</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

                          <!-- Import the Servlet API, we use provided scope as the API is included

                                    in JBoss AS 7 -->

                          <dependency>

                                    <groupId>org.jboss.spec.javax.servlet</groupId>

                                    <artifactId>jboss-servlet-api_3.0_spec</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.spec.javax.ejb</groupId>

                                    <artifactId>jboss-ejb-api_3.1_spec</artifactId>

                                    <scope>provided</scope>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.jboss.resteasy</groupId>

                                    <artifactId>resteasy-jaxrs</artifactId>

                                    <scope>test</scope>

                          </dependency>

                          <dependency>

                                    <groupId>junit</groupId>

                                    <artifactId>junit</artifactId>

                                    <scope>test</scope>

                          </dependency>

                          <dependency>

                                    <groupId>org.jboss.arquillian.junit</groupId>

                                    <artifactId>arquillian-junit-container</artifactId>

                                    <scope>test</scope>

                          </dependency>

                          <dependency>

                                    <groupId>org.jboss.as</groupId>

                                    <artifactId>jboss-as-arquillian-container-managed</artifactId>

                                    <scope>test</scope>

                          </dependency>

                          <dependency>

                                    <groupId>org.jboss.arquillian.protocol</groupId>

                                    <artifactId>arquillian-protocol-servlet</artifactId>

                                    <scope>test</scope>

                          </dependency>

       

                          <dependency>

                                    <groupId>commons-beanutils</groupId>

                                    <artifactId>commons-beanutils</artifactId>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.jsfunit</groupId>

                                    <artifactId>jsfunit-arquillian</artifactId>

                                    <version>${version.jsfunit}</version>

                                    <scope>test</scope>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.jsfunit</groupId>

                                    <artifactId>jboss-jsfunit-core</artifactId>

                                    <version>${version.jsfunit}</version>

                                    <scope>test</scope>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.shrinkwrap.descriptors</groupId>

                                    <artifactId>shrinkwrap-descriptors-spi</artifactId>

                          </dependency>

       

       

      faces-config:

      <?xml version="1.0"?>

      <faces-config xmlns="http://java.sun.com/xml/ns/javaee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"

          version="2.0">

         

          <factory>

              <faces-context-factory>org.jboss.jsfunit.context.JSFUnitFacesContextFactory</faces-context-factory>

          </factory>

         

          <application>

              <variable-resolver>org.jboss.jsfunit.seam.ConversationScopeVariableResolver</variable-resolver>

          </application>

       

                <navigation-rule>

              <from-view-id>/insmanage/index.xhtml</from-view-id>

              <navigation-case>

                  <from-action>#{insmanage.query}</from-action>

                  <from-outcome>success</from-outcome>

                  <to-view-id>/insmanage/queryList.xhtml</to-view-id>

              </navigation-case>

              <navigation-case>

                  <from-outcome>fail</from-outcome>

                  <to-view-id>/insmanage/error.xhtml</to-view-id>

              </navigation-case>

              <navigation-case>

                  <from-action>#{insmanage.query2Modify}</from-action>

                  <from-outcome>success</from-outcome>

                  <to-view-id>/insmanage/modifyList.xhtml</to-view-id>

              </navigation-case>

              <navigation-case>

                  <from-outcome>insert_success</from-outcome>

                  <to-view-id>/insmanage/queryList.xhtml</to-view-id>

              </navigation-case>

          </navigation-rule>

      </faces-config>

       

      web.xml:

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

      <web-app id="WebApp_ID" version="3.0"

                xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

       

      <context-param>

              <param-name>javax.faces.PROJECT_STAGE</param-name>

              <param-value>Development</param-value>

      </context-param>

       

      </web-app>

       

      now exception:

      java.lang.NoClassDefFoundError: org/jboss/shrinkwrap/descriptor/spi/NodeProviderImplBase

                at java.lang.ClassLoader.defineClass1(Native Method)

                at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

                at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

                at java.net.URLClassLoader.access$000(URLClassLoader.java:56)