AnsweredAssumed Answered

Custom WS exception

Question asked by felipe on Jul 7, 2006
Hello,
I'm using the alfresco 1.3 version.
I've developed an object layer, at the top of the alfresco's repository API. This layer is accessible via an unique AccessPoint class witch initialize the application (spring components…).


public class AccessPoint implements AccessPointBusiness {
   
   protected ApplicationContext _spring_context = null;
   
//    get registry of services
   protected ServiceRegistry _service_registry = null;
   protected PermissionService _permission_service = null;
   protected NodeService _node_service = null;
   protected AuthenticationService _authentication_service = null;
   
   public Repository _repository = null; // spring injection
   protected Session _session = null;
   protected Node _root = null;
   protected Node _application_root = null;
   protected Logger _logger = null;
   
   /* use it for spring injection */
   public PointAcces() {
      super();
   }

       public PointAcces(…) {
      super();
      init_services();
                …
   }   

   private void init_services() {
                _spring_context = new ClassPathXmlApplicationContext("package/bean-context.xml");
      _repository = (Repository)_spring_context.getBean("JCR.Repository");
      _service_registry = (ServiceRegistry) _spring_context.getBean(ServiceRegistry.SERVICE_REGISTRY);
      _permission_service = _service_registry.getPermissionService();
      _node_service = _service_registry.getNodeService();
      _authentication_service = _service_registry.getAuthenticationService();
   }
   
   
}



Another layer, deployed as WS and is accessible from remote clients, instanciates AccessPoint objects in order to call methods on.
This WS is packaged in the alfresco.war

public interface IApplication extends Remote {   
   public int doMethod(String arg) throws RemoteException;
}

public class Application implements IApplication {

   public int doMethod(String login, String mdp) {
      try {
         AccessPointBusiness ap = new AccessPoint();
         ap.doXXX();
         return 1;
      }
      catch(Exception e) {
         return -1;
      }
   }
}

All seems to be good, but once on two I've an exception thrown.
Example: Call of the service doMethod()
First call : failed (return -1)
Second call : OK(return 1)
Third call : failed (return -1)
4 call : OK(return 1)



The exception caught :
2006-07-07 09:43:37,275 ERROR [org.jboss.webservice.server.InvokerProviderJSE] Error from service endpoint, processing fault handler chain
org.alfresco.turbomeca.portail_fournisseur.systeme.exception.ApplicationTurbomecaException: [Application Turbomeca Error]
   at org.alfresco.turbomeca.portail_fournisseur.systeme.ApplicationTurbomeca.connecter(ApplicationTurbomeca.java:32)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.webservice.server.InvokerProviderJSE.invokeServiceEndpoint(InvokerProviderJSE.java:154)
   at org.jboss.webservice.server.InvokerProvider.invokeMethod(InvokerProvider.java:305)
   at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.java:176)
   at org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerProviderJSE.java:93)
   at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
   at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
   at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
   at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
   at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
   at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
   at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
   at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
   at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
   at java.lang.Thread.run(Thread.java:595)
2006-07-07 09:43:37,275 ERROR [org.jboss.webservice.server.ServerEngine] Server error: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: [Application Turbomeca Error]
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTrace: org.alfresco.turbomeca.portail_fournisseur.systeme.exception.ApplicationTurbomecaException: [Application Turbomeca Error]
   at org.alfresco.turbomeca.portail_fournisseur.systeme.ApplicationTurbomeca.connecter(ApplicationTurbomeca.java:32)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.webservice.server.InvokerProviderJSE.invokeServiceEndpoint(InvokerProviderJSE.java:154)
   at org.jboss.webservice.server.InvokerProvider.invokeMethod(InvokerProvider.java:305)
   at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.java:176)
   at org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerProviderJSE.java:93)
   at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
   at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
   at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
   at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
   at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
   at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
   at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
   at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
   at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
   at java.lang.Thread.run(Thread.java:595)


2006-07-07 09:43:37,275 INFO  [org.jboss.axis.transport.http.AxisServlet] org.alfresco.turbomeca.portail_fournisseur.systeme.exception.ApplicationTurbomecaException: [Application Turbomeca Error]


Anybody can help me please?
Thanks.

Outcomes