Announcement Announcement Module
Collapse
No announcement yet.
error in imagedb example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • error in imagedb example

    oracle 9.2 tomcat 5.028
    errors message
    org.springframework.transaction.TransactionSystemE xception: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Io 异常: Software caused connection abort: socket write error
    org.springframework.jdbc.datasource.DataSourceTran sactionManager.doRollback(DataSourceTransactionMan ager.java:222)
    org.springframework.transaction.support.AbstractPl atformTransactionManager.rollback(AbstractPlatform TransactionManager.java:432)
    org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCloseTransactionAfterThrowing (TransactionAspectSupport.java:259)
    org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:60)
    org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
    org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
    $Proxy0.storeImage(Unknown Source)
    org.springframework.samples.imagedb.web.ImageContr oller.processImageUpload(ImageController.java:43)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:352)
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:305)
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
    org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802):

    applicationContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <!--
      - Middle tier application context definition for the image database.
    	-->
    <beans>
    
    	<!-- Configurer that replaces $&#123;...&#125; placeholders with values from a properties file -->
    	<!-- &#40;in this case, JDBC-related settings for the dataSource definition below&#41; -->
    	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="locations">
    			<list>
    				<value>WEB-INF/jdbc.properties</value>
    				<value>WEB-INF/mail.properties</value>
    			</list>
    		</property>
    	</bean>
    
    	<!-- Local DataSource that works in any environment -->
    	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    		<property name="driverClassName"><value>$&#123;jdbc.driverClassName&#125;</value></property>
    		<property name="url"><value>$&#123;jdbc.url&#125;</value></property>
    		<property name="username"><value>$&#123;jdbc.username&#125;</value></property>
    		<property name="password"><value>$&#123;jdbc.password&#125;</value></property>
    		<property name="defaultAutoCommit"> 
      <value>false</value> 
    </property>
    	</bean>
    
    	<!-- Transaction manager for a single JDBC DataSource -->
    	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    		<property name="dataSource"><ref local="dataSource"/></property>
    	</bean>
    
    	<!-- NativeJdbcExtractor for the Commons DBCP connection pool above -->
    	<!-- &#40;just needed for oracleLobHandler&#41; -->
    	<bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
    			lazy-init="true"/>
    
    	<!-- LobHandler for Oracle JDBC drivers -->
    	<!-- &#40;refers to the NativeJdbcExtractor above to get access to native OracleConnections&#41; -->
    	<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"
    			lazy-init="true">
    		<property name="nativeJdbcExtractor"><ref local="nativeJdbcExtractor"/></property>
    	</bean>
    
    	<!-- LobHandler for well-behaved JDBC drivers -->
    	<!-- &#40;simply delegating to corresponding PreparedStatement and ResultSet methods&#41; -->
    	<bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"
    			lazy-init="true"/>
    
    	<!-- Default implementation of the ImageDatabase business interface -->
    	<!-- &#40;refers to a LobHandler for handling BLOBs and CLOBs -->
    	<bean id="imageDatabaseTarget" class="org.springframework.samples.imagedb.DefaultImageDatabase">
    		<property name="dataSource"><ref local="dataSource"/></property>
    		<property name="lobHandler"><ref bean="$&#123;imageDatabase.lobHandler&#125;"/></property>
    	</bean>
    
    	<!-- Transactional proxy for the business object above -->
    	<bean id="imageDatabase" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager"><ref local="transactionManager"/></property>
    		<property name="target"><ref local="imageDatabaseTarget"/></property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="getImages">PROPAGATION_REQUIRED,readOnly</prop>
    				<prop key="streamImage">PROPAGATION_REQUIRED,readOnly</prop>
    				<prop key="storeImage">PROPAGATION_REQUIRED</prop>
    				<prop key="clearDatabase">PROPAGATION_REQUIRED</prop>
    			</props>
    		</property>
    	</bean>
    	<!-- MailSender implementation for JavaMail -->
    	<!-- Used by ListImagesQuartzJob and ListImagesTimerTask; see "scheduling-*.xml" -->
    	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    		<property name="host"><value>$&#123;mail.host&#125;</value></property>
    	</bean>
    
    </beans>
    jdbc.properties
    # Properties file with JDBC-related settings.
    # Applied by PropertyPlaceholderConfigurer from "applicationContext.xml".
    # Targeted at system administrators, to avoid touching the context XML files.

    #jdbc.driverClassName=com.mysql.jdbc.Driver
    #jdbc.url=jdbc:mysql://localhost:3306/imagedb
    #jdbc.username=admin
    #jdbc.password=
    #imageDatabase.lobHandler=defaultLobHandler

    jdbc.driverClassName=oracle.jdbc.OracleDriver
    jdbc.url=jdbc:oracle:thin:@192.168.13.3:1521:newiu db
    jdbc.username=jacklin
    jdbc.password=jacklin
    imageDatabase.lobHandler=oracleLobHandler

    DefaultImageDatabase.java
    Code:
    package org.springframework.samples.imagedb;
    
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.List;
    
    import org.springframework.dao.DataAccessException;
    import org.springframework.dao.IncorrectResultSizeDataAccessException;
    import org.springframework.jdbc.LobRetrievalFailureException;
    import org.springframework.jdbc.core.RowMapper;
    import org.springframework.jdbc.core.support.AbstractLobCreatingPreparedStatementCallback;
    import org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtractor;
    import org.springframework.jdbc.core.support.JdbcDaoSupport;
    import org.springframework.jdbc.support.lob.LobCreator;
    import org.springframework.jdbc.support.lob.LobHandler;
    import org.springframework.util.FileCopyUtils;
    
    /**
     * Default implementation of the central image database business interface.
     *
     * <p>Uses JDBC with a LobHandler to retrieve and store image data.
     * Illustrates direct use of the jdbc.core package, i.e. JdbcTemplate,
     * rather than operation objects from the jdbc.object package.
     *
     * @author Juergen Hoeller
     * @since 07.01.2004
     * @see org.springframework.jdbc.core.JdbcTemplate
     * @see org.springframework.jdbc.support.lob.LobHandler
     */
    public class DefaultImageDatabase extends JdbcDaoSupport implements ImageDatabase &#123;
    
    	private LobHandler lobHandler;
    
    	/**
    	 * Set the LobHandler to use for BLOB/CLOB access.
    	 * Could use a DefaultLobHandler instance as default,
    	 * but relies on a specified LobHandler here.
    	 * @see org.springframework.jdbc.support.lob.DefaultLobHandler
    	 */
    	public void setLobHandler&#40;LobHandler lobHandler&#41; &#123;
    		this.lobHandler = lobHandler;
    	&#125;
    
    	public List getImages&#40;&#41; throws DataAccessException &#123;
    		return getJdbcTemplate&#40;&#41;.query&#40;
    		    "SELECT image_name, description FROM imagedb",
    		    new RowMapper&#40;&#41; &#123;
    			    public Object mapRow&#40;ResultSet rs, int rowNum&#41; throws SQLException &#123;
    				    String name = rs.getString&#40;1&#41;;
    				    String description = lobHandler.getClobAsString&#40;rs, 2&#41;;
    				    return new ImageDescriptor&#40;name, description&#41;;
    			    &#125;
    		    &#125;&#41;;
    	&#125;
    
    	public void streamImage&#40;final String name, final OutputStream contentStream&#41; throws DataAccessException &#123;
    		getJdbcTemplate&#40;&#41;.query&#40;
    				"SELECT content FROM imagedb WHERE image_name=?", new Object&#91;&#93; &#123;name&#125;,
    				new AbstractLobStreamingResultSetExtractor&#40;&#41; &#123;
    					protected void handleNoRowFound&#40;&#41; throws LobRetrievalFailureException &#123;
    						throw new IncorrectResultSizeDataAccessException&#40;
    						    "Image with name '" + name + "' not found in database", 1, 0&#41;;
    					&#125;
    					public void streamData&#40;ResultSet rs&#41; throws SQLException, IOException &#123;
    						FileCopyUtils.copy&#40;lobHandler.getBlobAsBinaryStream&#40;rs, 1&#41;, contentStream&#41;;
    					&#125;
    				&#125;
    		&#41;;
    	&#125;
    
    	public void storeImage&#40;
    	    final String name, final InputStream contentStream, final int contentLength, final String description&#41;
    	    throws DataAccessException &#123;
    		getJdbcTemplate&#40;&#41;.execute&#40;
    				"INSERT INTO imagedb &#40;image_name, content, description&#41; VALUES &#40;?, ?, ?&#41;",
    				new AbstractLobCreatingPreparedStatementCallback&#40;this.lobHandler&#41; &#123;
    					protected void setValues&#40;PreparedStatement ps, LobCreator lobCreator&#41; throws SQLException &#123;
    						ps.setString&#40;1, name&#41;;
    						lobCreator.setBlobAsBinaryStream&#40;ps, 2, contentStream, contentLength&#41;;
    						lobCreator.setClobAsString&#40;ps, 3, description&#41;;
    					&#125;
    				&#125;
    		&#41;;
    	&#125;
    
    	public void checkImages&#40;&#41; &#123;
    		// could implement consistency check here
    		logger.info&#40;"Checking images&#58; not implemented but invoked by scheduling"&#41;;
    	&#125;
    
    	public void clearDatabase&#40;&#41; throws DataAccessException &#123;
    		getJdbcTemplate&#40;&#41;.update&#40;"DELETE FROM imagedb"&#41;;
    	&#125;
    
    &#125;

  • #2
    Strange... looks like the connection with the database has been lost. Do you get that for each operation, or just for image uploads? Also, what's the original exception thrown by the data access code? (The one you showed was from a rollback after a data access exception.) Please double-check the log to narrow down what's going on!

    Juergen

    Comment


    • #3
      If I don't input description,no errors,why

      Comment


      • #4
        This might be a problem on CLOB access, only happening when a description is entered. Do you see any previous exception in your log, before the one that indicates a rollback failure?

        Juergen

        Comment


        • #5
          log message
          2004-11-11 09:56:14,499 INFO [org.springframework.jdbc.support.SQLErrorCodesFact ory] - SQLErrorCodes loaded: [HSQL Database Engine, Oracle, Sybase SQL Server, Microsoft SQL Server, Informix Dynamic Server, PostgreSQL, DB2*, MySQL]
          2004-11-11 09:56:14,509 INFO [org.springframework.jdbc.support.SQLErrorCodesFact ory] - Looking up default SQLErrorCodes for DataSource
          2004-11-11 09:56:15,210 INFO [org.springframework.jdbc.support.SQLErrorCodesFact ory] - Database Product Name is Oracle
          2004-11-11 09:56:15,210 INFO [org.springframework.jdbc.support.SQLErrorCodesFact ory] - Driver Version is 9.2.0.1.0
          2004-11-11 09:56:17,513 INFO [org.springframework.jdbc.datasource.DataSourceTran sactionObject] - JDBC 3.0 Savepoint class is available
          2004-11-11 09:56:33,236 ERROR [org.springframework.jdbc.support.lob.OracleLobHand ler] - Could not free Oracle LOB
          java.sql.SQLException: 无法从套接字读取更多的数据
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
          at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:1160)
          at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine. java:963)
          at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine. java:893)
          at oracle.jdbc.ttc7.v8TTILob.receiveReply(v8TTILob.ja va:955)
          at oracle.jdbc.ttc7.v8TTILob.freeTemporaryLob(v8TTILo b.java:451)
          at oracle.jdbc.ttc7.TTC7Protocol.freeTemporaryLob(TTC 7Protocol.java:3245)
          at oracle.sql.LobDBAccessImpl.freeTemporary(LobDBAcce ssImpl.java:377)
          at oracle.sql.BLOB.freeTemporary(BLOB.java:842)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.jdbc.support.lob.OracleLobHand ler$OracleLobCreator.close(OracleLobHandler.java:3 99)
          at org.springframework.jdbc.core.support.AbstractLobC reatingPreparedStatementCallback.doInPreparedState ment(AbstractLobCreatingPreparedStatementCallback. java:75)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:334)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:353)
          at org.springframework.samples.imagedb.DefaultImageDa tabase.storeImage(DefaultImageDatabase.java:78)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.aop.framework.AopProxyUtils.in vokeJoinpointUsingReflection(AopProxyUtils.java:61 )
          at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:149)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :116)
          at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:56)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
          at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
          at $Proxy0.storeImage(Unknown Source)
          at org.springframework.samples.imagedb.web.ImageContr oller.processImageUpload(ImageController.java:43)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:352)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:305)
          at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
          at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
          at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
          at org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
          at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
          at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
          at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
          at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
          at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
          at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
          at java.lang.Thread.run(Thread.java:534)
          2004-11-11 09:56:33,246 WARN [org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator] - Unable to translate SQLException with errorCode '17410', will now try the fallback translator
          2004-11-11 09:56:33,246 INFO [org.springframework.jdbc.support.SQLStateSQLExcept ionTranslator] - Translating SQLException with SQLState 'null' and errorCode '17410' and message [无法从套接字读取更多的数据]; SQL was [INSERT INTO imagedb (image_name, content, description) VALUES (?, ?, ?)] for task [executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimpleP reparedStatementCreator@14c4d61]]
          2004-11-11 09:56:33,246 WARN [org.springframework.jdbc.support.JdbcUtils] - Could not close JDBC Statement
          java.sql.SQLException: Io 异常: Software caused connection abort: socket write error
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:333)
          at oracle.jdbc.driver.OracleStatement.close(OracleSta tement.java:648)
          at oracle.jdbc.driver.OraclePreparedStatement.private Close(OraclePreparedStatement.java:485)
          at oracle.jdbc.driver.OraclePreparedStatement.close(O raclePreparedStatement.java:393)
          at org.apache.commons.dbcp.DelegatingStatement.close( DelegatingStatement.java:165)
          at org.springframework.jdbc.support.JdbcUtils.closeSt atement(JdbcUtils.java:52)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:347)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:353)
          at org.springframework.samples.imagedb.DefaultImageDa tabase.storeImage(DefaultImageDatabase.java:78)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.aop.framework.AopProxyUtils.in vokeJoinpointUsingReflection(AopProxyUtils.java:61 )
          at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:149)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :116)
          at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:56)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
          at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
          at $Proxy0.storeImage(Unknown Source)
          at org.springframework.samples.imagedb.web.ImageContr oller.processImageUpload(ImageController.java:43)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:352)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:305)
          at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
          at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
          at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
          at org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
          at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
          at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
          at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
          at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
          at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
          at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
          at java.lang.Thread.run(Thread.java:534)
          2004-11-11 09:56:33,256 ERROR [org.springframework.transaction.interceptor.Transa ctionInterceptor] - Application exception overridden by rollback exception
          org.springframework.jdbc.UncategorizedSQLException : (executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimpleP reparedStatementCreator@14c4d61]): encountered SQLException [无法从套接字读取更多的数据]; nested exception is java.sql.SQLException: 无法从套接字读取更多的数据
          java.sql.SQLException: 无法从套接字读取更多的数据
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
          at oracle.jdbc.dbaccess.DBError.check_error(DBError.j ava:1160)
          at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine. java:963)
          at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine. java:893)
          at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:369)
          at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol .java:1891)
          at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TT C7Protocol.java:1093)
          at oracle.jdbc.driver.OracleStatement.executeNonQuery (OracleStatement.java:2047)
          at oracle.jdbc.driver.OracleStatement.doExecuteOther( OracleStatement.java:1940)
          at oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout(OracleStatement.java:2709)
          at oracle.jdbc.driver.OraclePreparedStatement.execute Update(OraclePreparedStatement.java:589)
          at org.apache.commons.dbcp.DelegatingPreparedStatemen t.executeUpdate(DelegatingPreparedStatement.java:1 01)
          at org.springframework.jdbc.core.support.AbstractLobC reatingPreparedStatementCallback.doInPreparedState ment(AbstractLobCreatingPreparedStatementCallback. java:72)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:334)
          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:353)
          at org.springframework.samples.imagedb.DefaultImageDa tabase.storeImage(DefaultImageDatabase.java:78)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.aop.framework.AopProxyUtils.in vokeJoinpointUsingReflection(AopProxyUtils.java:61 )
          at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:149)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :116)
          at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:56)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
          at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
          at $Proxy0.storeImage(Unknown Source)
          at org.springframework.samples.imagedb.web.ImageContr oller.processImageUpload(ImageController.java:43)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:352)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:305)
          at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
          at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
          at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
          at org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
          at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
          at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
          at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
          at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
          at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
          at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
          at java.lang.Thread.run(Thread.java:534)
          2004-11-11 09:56:33,266 ERROR [org.springframework.web.servlet.DispatcherServlet] - Could not complete request
          org.springframework.transaction.TransactionSystemE xception: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Io 异常: Software caused connection abort: socket write error
          java.sql.SQLException: Io 异常: Software caused connection abort: socket write error
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
          at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:333)
          at oracle.jdbc.driver.OracleConnection.rollback(Oracl eConnection.java:1380)
          at org.apache.commons.dbcp.DelegatingConnection.rollb ack(DelegatingConnection.java:265)
          at org.apache.commons.dbcp.PoolingDataSource$PoolGuar dConnectionWrapper.rollback(PoolingDataSource.java :288)
          at org.springframework.jdbc.datasource.DataSourceTran sactionManager.doRollback(DataSourceTransactionMan ager.java:219)
          at org.springframework.transaction.support.AbstractPl atformTransactionManager.rollback(AbstractPlatform TransactionManager.java:432)
          at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCloseTransactionAfterThrowing (TransactionAspectSupport.java:259)
          at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:60)
          at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
          at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
          at $Proxy0.storeImage(Unknown Source)
          at org.springframework.samples.imagedb.web.ImageContr oller.processImageUpload(ImageController.java:43)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:352)
          at org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:305)
          at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
          at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
          at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:495)
          at org.springframework.web.servlet.FrameworkServlet.s ervice(FrameworkServlet.java:321)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
          at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
          at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
          at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
          at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
          at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
          at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
          at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
          at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
          at java.lang.Thread.run(Thread.java:534)

          Comment


          • #6
            Strange, it seems to fail when freeing the temporary LOB... classic Oracle exception, isn't it? An error message of "无法从套接字读取更多的数据" is certainly very helpful...

            Juergen

            Comment


            • #7
              This is JDBC Error Messages,Oracle error code :ORA-17410. No more data to read from socket


              thank you very much, Juergen

              Comment


              • #8
                Could someone please help me out ?

                Thanks a lot in advance

                Comment


                • #9
                  Please offer any suggestions or comments. I look forward to your help.

                  Comment


                  • #10
                    Unfortunately, I can't help you any further, as that Oracle error seems strange to me too. Any Oracle experts that can share an insight here?

                    Juergen

                    Comment


                    • #11
                      thank you very much, Juergen :lol:

                      Comment


                      • #12
                        What Oracle version / JDBC version / JDK / Network Protocol are you using?

                        Comment


                        • #13
                          ojdbc oracle 9.2 thin driver

                          Comment


                          • #14
                            Try ojdbc14.jar instead of OraThin and then it should work...

                            See also:
                            http://forum.springframework.org/showthread.php?t=12674
                            (as Oracle doesnt support LOB input throught streams using Thin drivers)
                            Yves.
                            Last edited by robyn; May 19th, 2006, 05:56 AM.

                            Comment

                            Working...
                            X