title: java.lang.ClassNotFoundException: com.sun.rowset.CachedRowSetImpl in wildfly-9.0.2.Final
body: <p>Enviornment - AS@wildfly-9.0.2.Final,JDK - java version "1.8.0_66" , Building tool - ANT</p>
  
  <p>A java file having following code has been configured as a module (module add --name=jaroneapi --resources=~/Downloads/jaroneapi.jar)
  I think the classes which I need are all in the rt.jar from my JDK.</p>
  
  <pre><code>    package api.jarone.com.pojo;
  import com.sun.rowset.CachedRowSetImpl;
  public class TestJarOneDetails {
  public void getOperatorInfo() throws Exception{
      try{
          System.out.println(" Getting error while accesing CachedRowSetImpl java class in wildfly-9.0.2.Final,This
  java class has been packaged in jaroneapi.jar. Now 1. Go to $WILDFLY_HOME/bin directory and invoke command ./jboss-cli.sh --connect
  2. module add --name=jaroneapi --resources=~/Downloads/jaroneapi.jar");
          CachedRowSetImpl localCachedRowSetImpl = new CachedRowSetImpl();
        }
      catch(Exception e){
          e.printStackTrace();
          throw e;
    }
  }
  }
  </code></pre>
  
  <p>Exception logs</p>
  
  <pre><code>    10:54:00,343 ERROR [org.jboss.as.ejb3.invocation] (default task-1) WFLYEJB0034: EJB Invocation failed on component ClientTestHelperBean for method public abstract java.lang.String client.test.ejb.session.ClientTestHelperLocal.getValueByParamName(int,java.lang.String,java.lang.String) throws java.lang.Exception: javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)
  Caused by: java.lang.NoClassDefFoundError: com/sun/rowset/CachedRowSetImpl
  at api.jarone.com.pojo.TestJarOneDetails.getOperatorInfo(TestJarOneDetails.java:12)
  at client.test.ejb.session.ClientTestHelperBean.getValueByParamName(ClientTestHelperBean.java:46)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  Caused by: java.lang.ClassNotFoundException: com.sun.rowset.CachedRowSetImpl from [Module "jaroneapi:main" from local module loader @707f7052 (finder: local module finder @11028347 (roots: /wildfly-9.0.2.Final/modules,/Downloads/wildfly-9.0.2.Final/modules/system/layers/base))]
  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
  10:54:00,356 ERROR [stderr] (default task-1) javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
  10:54:00,357 ERROR [stderr] (default task-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)
  10:54:00,357 ERROR [stderr] (default task-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
  10:54:00,357 ERROR [stderr] (default task-1)    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)
  10:54:00,424 ERROR [stderr] (default task-1) Caused by: java.lang.NoClassDefFoundError: com/sun/rowset/CachedRowSetImpl
  10:54:00,424 ERROR [stderr] (default task-1)    at api.jarone.com.pojo.TestJarOneDetails.getOperatorInfo(TestJarOneDetails.java:12)
  10:54:00,425 ERROR [stderr] (default task-1)    at client.test.ejb.session.ClientTestHelperBean.getValueByParamName(ClientTestHelperBean.java:46)
  10:54:00,425 ERROR [stderr] (default task-1)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  10:54:00,425 ERROR [stderr] (default task-1)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  10:54:00,440 ERROR [stderr] (default task-1) Caused by: java.lang.ClassNotFoundException: com.sun.rowset.CachedRowSetImpl from [Module "jaroneapi:main" from local module loader @707f7052 (finder: local module finder @11028347 (roots: /wildfly-9.0.2.Final/modules,/wildfly-9.0.2.Final/modules/system/layers/base))]
  10:54:00,441 ERROR [stderr] (default task-1)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
  10:54:00,441 ERROR [stderr] (default task-1)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)
  10:54:00,441 ERROR [stderr] (default task-1)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)
  10:54:00,441 ERROR [stderr] (default task-1)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)
  </code></pre>
  
  <p>After searching I have done following 2 steps</p>
  
  <p>1.Under modules/com/sun/rowset/main created a module.xml containing</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;  
  &lt;module xmlns="urn:jboss:module:1.1" name="com.sun.rowset"&gt;  
      &lt;dependencies&gt;  
          &lt;system export="true"&gt;  
              &lt;paths&gt;  
                  &lt;path name="com/sun/rowset"/&gt;  
              &lt;/paths&gt;  
          &lt;/system&gt;  
      &lt;/dependencies&gt;  
  &lt;/module&gt;  
  </code></pre>
  
  <p>2. Modified the module jaroneapi as following </p>
  
  <p>module add --name=jaroneapi --resources=~/Downloads/jaroneapi.jar --dependencies=com.sun.rowset</p>
  
  <p>But still following error occurred.</p>
  
  <pre><code>    11:10:44,543 ERROR [stderr] (default task-1) javax.sql.rowset.spi.SyncFactoryException: Resource javax/sql/rowset/rowset.properties not found
  11:10:44,549 ERROR [stderr] (default task-1)    at javax.sql.rowset.spi.SyncFactory.lambda$initMapIfNecessary$79(SyncFactory.java:393)
  11:10:44,550 ERROR [stderr] (default task-1)    at java.security.AccessController.doPrivileged(Native Method)
  11:10:44,551 ERROR [stderr] (default task-1)    at javax.sql.rowset.spi.SyncFactory.initMapIfNecessary(SyncFactory.java:388)
  11:10:44,552 ERROR [stderr] (default task-1)    at javax.sql.rowset.spi.SyncFactory.getInstance(SyncFactory.java:557)
  </code></pre>
  
  <p>Why this error has been occurred? 
  Is there something I'm missing or some modules I need to include here?  Any suggestion would be really appreciated.</p>