Announcement Announcement Module
Collapse
No announcement yet.
SPEL and JDBC - Invalid argument value: java.io.NotSerializableException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SPEL and JDBC - Invalid argument value: java.io.NotSerializableException

    I have a JDBC inbound adapter that polls a table 1 record at a time . I then have a header-enricher -> gateway -> outbound JDBC adapter that is trying to use the message payload returned by the inbound JDBC adapter as a parameter to the outbound SQL statement. The context that looks like this:

    Code:
    	<int-jdbc:inbound-channel-adapter channel="EmptyWharehouse" 
    		query="SELECT idwharehouse from wharehouse where move = 1  and idwharehouse in (SELECT wharehouseid from bin) LIMIT 1" 
    		data-source="dataSource">
     		<int:poller fixed-rate="1000"/>
    	</int-jdbc:inbound-channel-adapter>
    
    	<int:channel id="EmptyWharehouse"/>
    
    	<int:header-enricher input-channel="EmptyWharehouse" output-channel="deadBins">
    	 	<int:header name="bins" expression="@selectEmptyBin.exchange(#root)" />     
    	</int:header-enricher>
    
    	<int:gateway id="selectEmptyBin" default-request-channel="selectBins" error-channel="exceptionTransformationChannel" />                        
    
    	<int:chain input-channel="selectBins">
    		<int-jdbc:outbound-gateway query="select idbin from bin where idwharehouse = :payload[idwharehouse]" data-source="dataSource" />                                                         
    	</int:chain>
    that is failing like this:

    Code:
    	at java.lang.Thread.run(Thread.java:679)
    Caused by: org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [select idbin from bin where idwharehouse = ?]; Invalid argument value: java.io.NotSerializableException; nested exception is java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
    It appears that the spel expression
    Code:
    :payload[idwharehouse]
    is not correct. What would be the correct expression to use? DO I need an intermediary transformer or serializer?
    Last edited by ehrdoctors; Jun 28th, 2013, 05:18 PM.

  • #2
    Can you post a DEBUG log that shows what's in the messages?

    Comment


    • #3
      Originally posted by Gary Russell View Post
      Can you post a DEBUG log that shows what's in the messages?
      i just changed my processing logic slightly and consolidated the above operations into 1 query, which rids me of the error, but I am still not quite sure how to express the results of a JDBC query in down stream SPEL expressions (see my other post today) or in downstream SQL statements. I believe the payload looked something like:

      Payload=[{idswharehouse=220436}]]

      Anyway it should be in the default message format coming from the JDBC inbound adapter which I believe is an ArrayList.
      Last edited by ehrdoctors; Jun 28th, 2013, 05:23 PM.

      Comment

      Working...
      X