Hello,
I'm a newbie with Spring Framework, and I have a pb where I need help. I check a lot but I don't find any solution. I use hibernate3, Spring2, and tomcat5
I create a Service application on an Apache server and I want call this service with httpinvoker. The service is call by a jsp application on the same Apache server.
The Client send the request to the service server but it dont' have any reply. The server have no pb to start (mapping and Factory) and address seem correct, it's perhaps my transactionProxy.
Thanks you for your help.
Except that, spring is very powerfull.
trace:
Configuration filesCode:Caused by: org.springframework.remoting.RemoteAccessException: Cannot access HTTP invoker remote service at http://localhost:8080/wishit-service/searchProductService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [/wishit-service/searchProductService] at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:196) at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:157) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy13.searchInOneClass(Unknown Source) at wishIT.commands.SearchCommand.execute(SearchCommand.java:51) at wishIT.commands.CommandManager.executeCommand(CommandManager.java:50) at wishIT.jsf.request.JSFRequestManager.executeRequest(JSFRequestManager.java:65) at wishIT.jsf.request.JSFRequestManager.sendRequest(JSFRequestManager.java:54) at wishIT.jsf.beans.BaseBean.setRequest(BaseBean.java:42) ... 32 more Caused by: java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [/wishit-service/searchProductService] at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.validateResponse(SimpleHttpInvokerRequestExecutor.java:139) at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.doExecuteRequest(SimpleHttpInvokerRequestExecutor.java:62) at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:134) at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:177) at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:154) ... 40 more
Service side:
Service declaration : http-wishIT-service.xml
Application context: service.xmlCode:<beans> <bean name="/searchProductService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter" lazy-init="false"> <property name="service" ref="searchProductService"/> <property name="serviceInterface" value="wishIT.service.SearchProductService"/> </bean> </beans>
web.xml:Code:<bean id="wishITtransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="wishITsessionFactory"/> </bean> <bean id="wishITtransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true"> <property name="transactionManager" ref="wishITtransactionManager"/> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> </props> </property> </bean> <bean id="searchProductService" parent="wishITtransactionProxy"> <property name="proxyInterfaces" value="wishIT.service.SearchProductService"/> <property name="target"> <bean class="wishIT.service.impl.SearchProductServiceImpl"> <property name="classesDAO" ref="wishITclassesDAO" /> <property name="productsDAO" ref="wishITproductsDAO" /> <property name="propertiesDAO" ref="wishITpropertiesDAO" /> <property name="linkProductPropertyDAO" ref="wishITlinkProductPropertyDAO" /> </bean> </property> </bean>
Client side:Code:<context-param> <param-name>contextConfigLocation</param-name> <param-value> WEB-INF/application-context/hibernate.xml, WEB-INF/application-context/service.xml, WEB-INF/application-context/dao.xml </param-value> </context-param> <!-- Listener Spring --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- Service --> <servlet> <servlet-name>wishit-service</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/http-wishIT-service.xml</param-value> </init-param> <load-on-startup>4</load-on-startup> </servlet> <servlet-mapping> <servlet-name>wishit-service</servlet-name> <url-pattern>/wishit-service/*</url-pattern> </servlet-mapping>
SearchProductService searchProductService = (SearchProductService)sessionWhisIT.getBeanFactory ().getBean("searchProductService");
Code:<bean id="searchProductService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean"> <property name="serviceUrl" value="http://localhost:8080/wishit-service/searchProductService"/> <property name="serviceInterface" value="wishIT.service.SearchProductService"/> </bean>


Reply With Quote