[jboss-user] [JBoss/Spring Integration] - Re: Jboss 5 Beta 4 Spring Problems

ragavgomatam do-not-reply at jboss.com
Sun Feb 24 16:48:02 EST 2008


Tried again...Actually this happens only with one WAR file in Beta 4.
I am using OracleRowSet there . My spring-context.xml is as follows :- 

<?xml version="1.0" encoding="UTF-8"?>
  | <beans xmlns="http://www.springframework.org/schema/beans"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xmlns:jee="http://www.springframework.org/schema/jee"
  | 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  |                         http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
  | 	<jee:jndi-lookup id="jndiDs" jndi-name="jdbc/TestDs" resource-ref="true"/>
  | 	<bean name="/home" class="com.myapp.struts.action.SpringStrutsAction"
  | 		autowire="byName">
  | 		<property name="dao" ref="intf" />
  | 	</bean>
  | 	<bean name="intf" class="com.myapp.db.DAOImpl">
  | 		<property name="rowSet" ref="oracleRowSet" />
  | 		<property name="dataSource" ref="jndiDs" />
  | 	</bean>
  | 	<bean name="oracleRowSet" class="oracle.jdbc.rowset.OracleCachedRowSet">
  | 		<property name="type" value="1004" /><!--ResultSet.TYPE_SCROLL_INSENSITIVE-->
  | 		<property name="concurrency" value="1008" /><!--ResultSet.CONCUR_UPDATABLE-->
  | 	</bean>
  | </beans>
  | 

My bean code is as follows :- 

/*
  |  * DAOImpl.java
  |  *
  |  * To change this template, choose Tools | Template Manager
  |  * and open the template in the editor.
  |  */
  | 
  | package com.myapp.db;
  | 
  | import java.sql.Connection;
  | import java.sql.SQLException;
  | import javax.sql.DataSource;
  | import javax.sql.RowSet;
  | import javax.sql.rowset.CachedRowSet;
  | import org.springframework.jdbc.support.JdbcUtils;
  | import javax.sql.rowset.spi.SyncProviderException;
  | import oracle.jdbc.rowset.OracleCachedRowSet;
  | import org.apache.struts.action.ActionForm;
  | import org.apache.struts.action.DynaActionForm;
  | 
  | public class DAOImpl implements DAOIntf{
  |     
  |     //Spring Injected
  |     private DataSource ds;
  |     private CachedRowSet rowSet;
  |     
  |     public Connection getConnection() throws SQLException {
  |         return this.ds.getConnection();
  |     }
  |     
  |     
  |     public void setDataSource(DataSource datasrc) {
  |         this.ds = datasrc;
  |     }
  |     
  |     public DataSource getDataSource() {
  |         return this.ds;
  |     }
  |     
  |     public CachedRowSet getRowSet() {
  |         return this.rowSet;
  |     }
  |     
  |     public void setRowSet(CachedRowSet r) {
  |         this.rowSet = r;
  |     }
  |     
  |     public RowSet getBooks(int isbn) {
  |         
  |         Connection conn = null;
  |         
  |         try {
  |             conn =  getConnection();
  |             rowSet.setCommand("select ISBN,TITLE,AUTHOR,RATING,PRICE from BOOKROWSET where isbn = " + isbn);
  |             rowSet.execute(conn);
  |         } catch (SQLException ex) {
  |             ex.printStackTrace();
  |         } finally {
  |             JdbcUtils.closeConnection(conn);
  |         }
  |         return rowSet;
  |     }
  |     
  |     
  |     public RowSet getAllBooks() {
  |         
  |         Connection conn = null;
  |         
  |         try {
  |             conn = getConnection();
  |             rowSet.setCommand("select ISBN,TITLE,AUTHOR,RATING,PRICE from BOOKROWSET ");
  |             rowSet.execute(conn);
  |         } catch (SQLException ex) {
  |             ex.printStackTrace();
  |         } finally {
  |             JdbcUtils.closeConnection(conn);
  |         }
  |         return rowSet;
  |     }
  |     
  |     public RowSet addBooks(ActionForm form) {
  |         
  |         rowSet =  getRowSet();
  |         
  |         try {
  |             rowSet.setReadOnly(false);
  |             rowSet.afterLast();
  |             rowSet.moveToInsertRow();
  |             rowSet.updateDouble(1,(Double)(((DynaActionForm)form).get("isbn")));
  |             rowSet.updateString(2,(String)(((DynaActionForm)form).get("title")));
  |             rowSet.updateString(3,(String)(((DynaActionForm)form).get("author")));
  |             rowSet.updateString(4,(String)(((DynaActionForm)form).get("rating")));
  |             rowSet.updateDouble(5,(Double)(((DynaActionForm)form).get("price")));
  |             rowSet.insertRow();
  |             rowSet.setReadOnly(true);
  |             rowSet.beforeFirst();
  |             commit(rowSet);
  |         } catch(SQLException sqe) {
  |             sqe.printStackTrace();
  |         }
  |         
  |         return rowSet;
  |         
  |     }
  |     
  |     public RowSet deleteBook(ActionForm form) {
  |         
  |         rowSet =  getRowSet();
  |         try {
  |             rowSet.setReadOnly(false);
  |             rowSet.absolute(Integer.parseInt((String) (((DynaActionForm)form).get("rowNo"))));
  |             rowSet.deleteRow();
  |             rowSet.setReadOnly(true);
  |             rowSet.beforeFirst();
  |             commit(rowSet);
  |         } catch(SQLException sqe) {
  |             sqe.printStackTrace();
  |         }
  |         return rowSet;
  |         
  |     }
  |     
  |     private void commit(RowSet r) {
  |         
  |         Connection conn = null;
  |         
  |         try {
  |             conn = getConnection();
  |             OracleCachedRowSet rowSet = (OracleCachedRowSet)r;
  |             rowSet.acceptChanges(conn);
  |         } catch (SyncProviderException ex) {
  |             ex.printStackTrace();
  |         } catch(SQLException sqe) {
  |             sqe.printStackTrace();
  |         } finally {
  |             JdbcUtils.closeConnection(conn);
  |         }
  |         
  |     }
  |     
  |     
  | }
  | 

Error from jboss 5 beta 4 is :- If I remove this WAR file, everything appears fine....Surprising this was that this was working with spring 2.0...Moment I upgraded to spring 2.5 I started to get this error....Checked out the spring forums & they say it is becos spring is returning a proxy instead of OracleCachedRowSet...Question is why should spring 2.5 do this ? OracleCachedRowSet implements javax.sql.rowset.CachedRowset & jdk proxy should be ok ...Else jboss 5 beta 4 seems to be ok....Guess this is something with spring 2.5....To be sure I deployed this WAR in tc 6  and had the same error



16:35:55,625 INFO  [TransactionAttributeClassProcessor] org.jboss.metadata.ejb.spec.ContainerTransactionMetaData at 1f
  | 16:35:58,078 WARN  [ClassLoaderManager] Unexpected error during load of:org.springframework.aop.framework.ProxyCreatorSupport
  | java.lang.VerifyError: org/springframework/aop/framework/ProxyCreatorSupport: attempting to override final method org/springfram
  |         at java.lang.ClassLoader.defineClass1(Native Method)
  |         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:58)
  |         at org.jboss.classloader.spi.base.BaseClassLoader$1.run(BaseClassLoader.java:362)
  |         at org.jboss.classloader.spi.base.BaseClassLoader$1.run(BaseClassLoader.java:321)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:320)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:293)
  |         at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:75)
  |         at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:91)
  |         at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:449)
  |         at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251)
  |         at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:145)
  |         at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:193)
  |         at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1006)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:584)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:234)
  |         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  |         at org.jboss.deployment.AnnotatedClassFilter.accepts(AnnotatedClassFilter.java:112)
  |         at org.jboss.deployment.AnnotatedClassFilter.visit(AnnotatedClassFilter.java:93)
  |         at org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(WrappingVirtualFileHandlerVisitor.java:
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:196)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:141)
  |         at org.jboss.virtual.VFS.visit(VFS.java:336)
  |         at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:363)
  |         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:157)
  |         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:90)
  |         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
  | 16:35:58,125 WARN  [ClassLoaderManager] Unexpected error during load of:org.springframework.aop.support.MethodMatchers$ClassFilt
  | java.lang.IllegalAccessError: org/springframework/aop/support/MethodMatchers$ClassFilterAwareUnionMethodMatcher : org/springfram
  |         at java.lang.ClassLoader.defineClass1(Native Method)
  |         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:58)
  |         at org.jboss.classloader.spi.base.BaseClassLoader$1.run(BaseClassLoader.java:362)
  |         at org.jboss.classloader.spi.base.BaseClassLoader$1.run(BaseClassLoader.java:321)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:320)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:293)
  |         at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:75)
  |         at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:91)
  |         at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:449)
  |         at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251)
  |         at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:145)
  |         at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:193)
  |         at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1006)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:584)
  |         at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:234)
  |         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  |         at org.jboss.deployment.AnnotatedClassFilter.accepts(AnnotatedClassFilter.java:112)
  |         at org.jboss.deployment.AnnotatedClassFilter.visit(AnnotatedClassFilter.java:93)
  |         at org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(WrappingVirtualFileHandlerVisitor.java:
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:196)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:208)
  |         at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:141)
  |         at org.jboss.virtual.VFS.visit(VFS.java:336)
  |         at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:363)
  |         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:157)
  |         at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:90)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131709#4131709

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131709



More information about the jboss-user mailing list