1 Reply Latest reply on May 23, 2013 10:07 AM by Simone Monotti

    Class availability [ com.sun.rowset.providers.RIOptimisticProvider ]

    Simone Monotti Newbie

      Greetings,

       

      while developing a web application I am in need of obtaining Connection objects from a data source available through jndi.

      I have correctly installed the required driver as a module (Oracle driver, ojdbc6.jar), the data source is available and correctly produces the connections.

      Problems arise when I try to convert the ResultSet object into CachedRowSet objects. This is required by my business logic since I need to close resultsets/statement/connection object a.s.a.p. .

      While digging and debugging I found this exception being thrown:

       

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.sql.SQLException: SyncProvider instance not constructed

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at oracle.jdbc.rowset.OracleCachedRowSet.<init>(OracleCachedRowSet.java:456)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.gmnz.meow.dao.BasicDao.findByQuery(BasicDao.java:28)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.gmnz.meow.dao.JobDao.getAllJobs(JobDao.java:20)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.gmnz.meow.ejb.JobLibraryBean.getAllJobs(JobLibraryBean.java:21)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at java.lang.reflect.Method.invoke(Method.java:601)

      ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

      ...

       

      Its cause seems to be a ClassNotFoundException referring to the class com.sun.rowset.providers.RIOptimisticProvider .

      In other words, the SyncProvider tries to instantiate such a class but the class doesn't seem to be loaded, yet it is present in the java runtime (I checked inside the file rt.zip).

      Is there any additional module to be defined in order to have that class/package available?

        • 1. Re: Class availability [ com.sun.rowset.providers.RIOptimisticProvider ]
          Simone Monotti Newbie

          I found the solution.

          It was a matter of package visibility.

           

          I made the packages com.sun.rowset, com.sun.rowset.internal and com.sun.rowset.providers available by editing the file $JBOSS_HOME\modules\sun\jdk\main\module.xml .

           

          The tag <dependencies> now looks as follows:

           

          <dependencies>

                  <system export="true">

                      <paths>

                          <path name="com/sun/script/javascript"/>

                      ...........

                          <path name="com/sun/security/auth/module"/>

                          <path name="com/sun/rowset"/>

                          <path name="com/sun/rowset/internal"/>

                          <path name="com/sun/rowset/providers"/>

                          <path name="sun/misc"/>

                          <path name="sun/io"/>

                     ...........

          1 of 1 people found this helpful