0 Replies Latest reply on Aug 12, 2016 2:33 AM by saria-sarsoura.2014

    java.io.NotSerializableException: org.springframework.jdbc.datasource.DriverManagerDataSource

    saria-sarsoura.2014

      Hello,

       

      I created a project with Spring 4.0.2. After running with JBoss 7.1.1, the exception bellow id displayed:

       

      07:16:26,367 INFO  [org.springframework.context.support.FileSystemXmlApplicationContext] (http-localhost-127.0.0.1-8080-1) Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@1e20939: startup date [Fri Aug 12 07:16:26 GMT-08:00 2016]; root of context hierarchy
      07:16:26,374 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (http-localhost-127.0.0.1-8080-1) Loading XML bean definitions from file [C:\Users\SARSOURAENA\Desktop\ws2\HiSpring\WebContent\WEB-INF\spring.xml]
      07:16:26,387 INFO  [org.springframework.jdbc.datasource.DriverManagerDataSource] (http-localhost-127.0.0.1-8080-1) Loaded JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
      07:16:26,741 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) ---------------------------------------List size= 4
      
      
      07:16:26,785 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http-localhost-127.0.0.1-8080-1) Error Rendering View[/sarsoura/list.xhtml]: java.io.NotSerializableException: org.springframework.jdbc.datasource.DriverManagerDataSource
        at java.io.ObjectOutputStream.writeObject0(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.writeSerialData(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.writeObject0(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.writeSerialData(Unknown Source) [rt.jar:1.7.0_55]
        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) [rt.jar:1.7.0_55]
      

       

      After googling, I found a thread presenting the same issue and the solution is to insert this at web.xml:


      <listener>
         <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
      </listener>
      

       

      However, that's not solving my problem.

      Knowing that this project is worked fine with both WildFly 8 and 10. Have you any idea about this exception.

      Thanks in advance.