Author: echatellier Date: 2012-01-04 18:04:52 +0100 (Wed, 04 Jan 2012) New Revision: 146 Url: http://chorem.org/repositories/revision/vradi/146 Log: Fix server connexion with hessian Modified: trunk/pom.xml trunk/vradi-services/pom.xml trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-01-04 16:13:10 UTC (rev 145) +++ trunk/pom.xml 2012-01-04 17:04:52 UTC (rev 146) @@ -495,6 +495,12 @@ <version>${servletApiVersion}</version> <scope>runtime</scope> </dependency> + + <dependency> + <groupId>com.caucho</groupId> + <artifactId>hessian</artifactId> + <version>4.0.6</version> + </dependency> </dependencies> </dependencyManagement> Modified: trunk/vradi-services/pom.xml =================================================================== --- trunk/vradi-services/pom.xml 2012-01-04 16:13:10 UTC (rev 145) +++ trunk/vradi-services/pom.xml 2012-01-04 17:04:52 UTC (rev 146) @@ -161,6 +161,11 @@ <artifactId>lucene-core</artifactId> </dependency> + <dependency> + <groupId>com.caucho</groupId> + <artifactId>hessian</artifactId> + </dependency> + </dependencies> <build> Modified: trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java =================================================================== --- trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java 2012-01-04 16:13:10 UTC (rev 145) +++ trunk/vradi-services/src/main/java/org/chorem/vradi/services/VradiServiceFactory.java 2012-01-04 17:04:52 UTC (rev 146) @@ -23,7 +23,6 @@ */ package org.chorem.vradi.services; -import gnu.cajo.utils.extra.TransparentItemProxy; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.vradi.VradiServiceConfigurationHelper; @@ -31,6 +30,8 @@ import org.nuiton.wikitty.WikittyProxy; import org.nuiton.wikitty.WikittyService; +import com.caucho.hessian.client.HessianProxyFactory; + /** * VradiServiceFactory. * @@ -66,7 +67,7 @@ try { - String cajoEndPoint = serviceEndpoint; + /* String cajoEndPoint = serviceEndpoint; // cajo url is not http or other protocol, url must start with // // example: //localhost:1198/ws // remove protocol @@ -78,20 +79,20 @@ serviceEndpoint = getServiceURL(cajoEndPoint, servicePort, VradiStorageService.VRADI_SERVICE); result = (VradiStorageService) TransparentItemProxy.getItem( - serviceEndpoint, new Class[]{VradiStorageService.class}); + serviceEndpoint, new Class[]{VradiStorageService.class});*/ -// HessianProxyFactory factory = new HessianProxyFactory(); -// // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code -// factory.setHessian2Request(true); -// // pour que les méthodes aux noms dupliquées fonctionnent (arguments different) -// factory.setOverloadEnabled(true); -// -// // vradi service -// result = (VradiStorageService) factory. -// create(VradiStorageService.class, -// getServiceURL(serviceEndpoint, VradiStorageService.VRADI_SERVICE)); + HessianProxyFactory factory = new HessianProxyFactory(); + // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code + factory.setHessian2Request(true); + // pour que les méthodes aux noms dupliquées fonctionnent (arguments different) + factory.setOverloadEnabled(true); + // vradi service + result = (VradiStorageService) factory. + create(VradiStorageService.class, + getServiceURL(serviceEndpoint, 0, VradiStorageService.VRADI_SERVICE)); + } catch (Exception eee) { if (log.isErrorEnabled()) { log.error("Can't init remote proxy", eee);