Hi all,
I've a serious problem whit spring 1.2.6 and ibatis 1.2.7.
As spring's examples, i've create a web service (Server + client), and seems to work well.
Seems!
When i call an Ibatis sqlmap, ibatis executes it, but cannot post the data to the web service client!
The problem seems the lazyLoadingEnabled="true" into the sqlMap config file.
If i set the Lazyloading to false, i lost all performance!!!
Any idea????
My configuration:
#########Ibatis sqlMap config#########
<sqlMapConfig>
<settings
enhancementEnabled="true"
lazyLoadingEnabled="true"
useStatementNamespaces="true" />
<sqlMap resource="ibatis/User.xml"/>
</sqlMapConfig>
##########ApplicationContext##########
<beans>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName">
<value>java:comp/env/jdbc/axiosWebServiceServer</value>
</property>
</bean>
<!-- Transaction manager for iBATIS DAOs -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="nestedTransactionAllowed">
<value>true</value>
</property>
</bean>
<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClient FactoryBean" >
<property name="configLocation">
<value>classpath:/ibatis/config/SqlMapConfig.xml</value>
</property>
<property name="dataSource"><ref bean="dataSource"/></property>
<!--property name="useTransactionAwareDataSource">
<value>true</value>
</property-->
</bean>
<bean id="userDAO" class="it.axiosinformatica.axiosWebServiceServer.d atabase.implementations.UserSqlMapDao">
<property name="sqlMapClient"><ref bean="sqlMapClient"/></property>
</bean>
<bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="userManager" parent="baseTransactionProxy">
<property name="target">
<bean class="it.axiosinformatica.axiosWebServiceServer.m anager.impl.UserManagerImpl">
<property name="userDAO"><ref bean="userDAO"/></property>
<!--Other managers not listed-->>>
</bean>
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
</beans>
#################Remoting-Servlet#####
<bean name="/userManager" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
<property name="service" ref="userManager"/>
<property name="serviceInterface" value="it.axiosinformatica.axiosWebServiceServer.m anager.UserManager"/>
</bean>
####################ApplicationContext Client#############
<bean id="userManager" class="org.springframework.remoting.httpinvoker.Ht tpInvokerProxyFactoryBean">
<property name="serviceUrl"><value>http://192.168.1.221:8084/axiosWebServiceServer/remoting/userManager</value>
</property>
<property name="serviceInterface"><value>it.axiosinformatica .webward.manager.UserManager</value>
</property>
</bean>
###################################
So, the log.........
10:51:24,916 INFO LoginAction:55 - Login Request from 127.0.0.1
10:51:24,917 DEBUG SimpleHttpInvokerRequestExecutor:66 - Sending HTTP invoker request for service at [http://192.168.1.221:8084/axiosWebServiceServer/remoting/userManager], with size 361
10:51:24,934 DEBUG DispatcherServlet:633 - DispatcherServlet with name 'remoting' received request for [/axiosWebServiceServer/remoting/userManager]
10:51:24,935 DEBUG DispatcherServlet:844 - Testing handler map [org.springframework.web.servlet.handler.BeanNameUr lHandlerMapping@114d18f] in DispatcherServlet with name 'remoting'
10:51:24,936 DEBUG BeanNameUrlHandlerMapping:134 - Looking up handler for [/userManager]
10:51:24,940 DEBUG DispatcherServlet:883 - Testing handler adapter [org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter@1ca1a68]
10:51:24,945 DEBUG HttpInvokerServiceExporter:73 - Applying RemoteInvocation: methodName='getUserListByLogin', parameterTypes=[class java.lang.String]
10:51:24,946 DEBUG RemoteInvocationTraceInterceptor:64 - Incoming HttpInvokerServiceExporter remote call: it.axiosinformatica.axiosWebServiceServer.manager. UserManager.getUserListByLogin
10:51:24,947 DEBUG TransactionInterceptor:221 - Getting transaction for it.axiosinformatica.axiosWebServiceServer.manager. UserManager.getUserListByLogin
10:51:24,949 DEBUG DataSourceTransactionManager:253 - Using transaction object
<!--open connection-->
10:51:24,974 DEBUG Connection:23 - {conn-100006} Connection
10:51:24,983 DEBUG TransactionSynchronizationManager:137 - Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@257b34] for key [org.apache.tomcat.dbcp.dbcp.BasicDataSource@12e4cd] bound to thread [http-8084-Processor22]
10:51:24,985 DEBUG PreparedStatement:23 - {pstm-100007} PreparedStatement: SELECT * FROM PERSONALE WHERE SPER_LOGIN = ?
10:51:24,989 DEBUG PreparedStatement:23 - {pstm-100007} Parameters: [administrator]
10:51:24,997 DEBUG PreparedStatement:23 - {pstm-100007} Types: [java.lang.String]
10:51:25,003 DEBUG ResultSet:23 - {rset-100008} ResultSet
10:51:25,059 DEBUG ResultSet:23 - {rset-100008} Header: [PER_ID, PER_MATRICOLA, PER_COGNOME, PER_NOME, PER_NUMTESSERA, PER_PASSWORD, IPERFLAGPW, IPROFID, SPER_LOGIN, DPERLASTLOGIN, DPERLASTCHANGEPASSWORD, IPERNUMGIOSCAD, IPERNUMGIODISATT, IPROFID, PER_ID]
10:51:25,067 DEBUG ResultSet:23 - {rset-100008} Result: [2, 99999, ADMIN , ADMIN , 99999, axios123, 1, 1, administrator, 2006-01-26 00:00:00.0, null, 0, 0, 1, 2]
<!--Closing transaction-->
processing of HttpInvokerServiceExporter remote call: it.axiosinformatica.axiosWebServiceServer.manager. UserManager.getUserListByLogin
10:51:25,180 ERROR DispatcherServlet:412 - Could not complete request
java.io.NotSerializableException: com.ibatis.sqlmap.engine.mapping.result.loader.Laz yResultLoader
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1075)
at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1073)
at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1073)
at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:291)
at java.util.ArrayList.writeObject(ArrayList.java:569 )
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:585)
at java.io.ObjectStreamClass.invokeWriteObject(Object StreamClass.java:890)
at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1333)
at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1073)
at java.io.ObjectOutputStream.defaultWriteFields(Obje ctOutputStream.java:1369)
at java.io.ObjectOutputStream.writeSerialData(ObjectO utputStream.java:1341)
at java.io.ObjectOutputStream.writeOrdinaryObject(Obj ectOutputStream.java:1284)
at java.io.ObjectOutputStream.writeObject0(ObjectOutp utStream.java:1073)
at java.io.ObjectOutputStream.writeObject(ObjectOutpu tStream.java:291)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.doWriteRemoteInvocationResult(Ht tpInvokerServiceExporter.java:270)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.writeRemoteInvocationResult(Http InvokerServiceExporter.java:221)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.writeRemoteInvocationResult(Http InvokerServiceExporter.java:197)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.handleRequest(HttpInvokerService Exporter.java:83)
<!--More and more--->
Anyone can help me???????????????????????????
Thanks,
Agharta


Reply With Quote