cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services and Spring problems (SOLVED)

aldebaranl2
Champ in-the-making
Champ in-the-making
Hi,

I'm currently experiencing a problem with Alfresco WS and Spring.

I need to expose the JBPMEngine (or the Workflow management classes) to Web services, in order to be able to access them from a distant location (a Liferay in another server for instance). So, I created my Web Services (WSDL, WSDD, etc.), and generated the client. This part works, but when I want to use a spring bean in my service, I get a NullPointerException.

This is my configuration :

server-config.WSDD (part of the existing one I modified) :

<service name="WorkflowWebService" provider="java:RPC"        style="wrapped" use="literal">
     <documentation>Accesses Workflows via WS</documentation>
     <wsdlFile>/wsdl/workflow-service.wsdl</wsdlFile>
     <parameter name="springBean" value="workflowService" />
     <parameter name="wsdlTargetNamespace"  value="http://www.alfresco.org/ws/service/workflow/1.0" />
     <parameter name="wsdlServiceElement"  value="WorkflowWebServiceService" />
     <parameter name="schemaQualified" value="http://www.alfresco.org/ws/service/workflow/1.0" />
     <parameter name="wsdlServicePort" value="WorkflowWebService" />
     <parameter name="className" value="com.akwa.ws.repo.webservice.workflow.WorkflowWebService" />
     <parameter name="wsdlPortType" value="WorkflowWebService" />
     <parameter name="typeMappingVersion" value="1.2" />
     <operation name="getWorkflows" qname="ns1:getWorkflows"  soapAction=""  xmlns:ns1="http://www.alfresco.org/ws/service/workflow/1.0" />
     <parameter name="allowedMethods" value="getWorkflows" />
</service>


web-services-application-context.xml :

<bean id="workflowService" class="com.akwa.ws.repo.webservice.workflow.WorkflowWebService" >
     <property name="workflowServiceImpl">
          <ref bean="workflowServiceImpl"/>
     </property>
</bean>
Giving “workflowServiceImpl” is an alfresco bean

Class WorkflowWebService :

    /** Alfresco JBPM Engine */
    private WorkflowServiceImpl workflowServiceImpl = null;
   
   
    public WorkflowWebService() { }
   

   public void setWorkflowServiceImpl(WorkflowServiceImpl workflowServiceImpl) {
      this.workflowServiceImpl = workflowServiceImpl;
      System.out.println("WorkflowService : "+this.workflowServiceImpl);
   }

   public void getWorkflows() {
      if (workflowServiceImpl == null) System.out.println("JBPM Engine null");
       for (WorkflowDefinition def : workflowServiceImpl.getAllDefinitions()) {
          System.out.println(def.getName()+" : "+def.getDescription());
       }
    }

In facts, it looks like the setter is never called, so the bean "workflowServiceImpl" is never initialized.

Thanks for your reply.
3 REPLIES 3

aldebaranl2
Champ in-the-making
Champ in-the-making
I have an update to my problem :

After firther investigations, I found that the bean was actually injected in my Web Service (The setter method is called when the server initializes the context). Nevertheless, when I call my test Class (see the code below), I see that the instance of my WS (the one instanciated 20sececondes ago) is not used, and that a new instance of the WS is created instead. This causes the bean not to be instanciated, and the application throws the NullPointerException (setter not called for this instance).
So my first question is : How can it be possible that my first instance is not used and antother is created instead ?

Here's the test code :

      WebServiceFactoryExtended.setEndpointAddress("http://localhost:8080/alfresco/api");
      
      try {
         AuthenticationUtils.startSession("admin", "admin");
         WorkflowServiceSoapBindingStub workflowsService = WebServiceFactoryExtended.getWorkflowService();
         workflowsService.getWorkflows();
         
         ActionServiceSoapBindingStub actionService = WebServiceFactory.getActionService();
         System.out.println(actionService.getUsername());
      } catch (AuthenticationFault e) {
         e.printStackTrace();
      } catch (RemoteException e) {
         e.printStackTrace();
      }
   }

Then, I tryed to execute something in the setter itself (in the WorkflowWebService Class) :

    /** Alfresco JBPM Engine */
    private WorkflowServiceImpl workflowServiceImpl = null;
   
   
    public WorkflowWebService() { }
   

   public void setWorkflowServiceImpl(WorkflowServiceImpl workflowServiceImpl) {
      this.workflowServiceImpl = workflowServiceImpl;
      System.out.println("WorkflowService : "+this.workflowServiceImpl);
      if (this.workflowServiceImpl == null)
         System.out.println("WorkflowService is null");
      else
         System.out.println("WorkflowService is NOT null");
      System.out.println("Workflow 1 : "+this.workflowServiceImpl.getWorkflowById("jbpm$1"));
   }
Result :
WorkflowService : org.alfresco.repo.workflow.WorkflowServiceImpl@ae166c
WorkflowService is NOT null
12:58:22,328  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowWebService' defined in class path resource [web-services-application-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:390)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:375)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:168)
   at org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate.getContext(JBPMTransactionTemplate.java:115)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:73)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getWorkflowById(JBPMEngine.java:759)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.getWorkflowById(WorkflowServiceImpl.java:319)
   at com.akwa.ws.repo.webservice.workflow.WorkflowWebService.setWorkflowServiceImpl(WorkflowWebService.java:29)
   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.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:786)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:606)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
   at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:840)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1026)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
12:58:22,332  ERROR [[Catalina].[localhost].[/alfresco]] Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowWebService' defined in class path resource [web-services-application-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:390)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:375)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:168)
   at org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate.getContext(JBPMTransactionTemplate.java:115)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:73)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getWorkflowById(JBPMEngine.java:759)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.getWorkflowById(WorkflowServiceImpl.java:319)
   at com.akwa.ws.repo.webservice.workflow.WorkflowWebService.setWorkflowServiceImpl(WorkflowWebService.java:29)
   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.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:786)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:606)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
   at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:840)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1026)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
12:58:22,345  ERROR [[Catalina].[localhost].[/alfresco]] Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowWebService' defined in class path resource [web-services-application-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'workflowServiceImpl' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
Caused by: org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:390)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:375)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:168)
   at org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate.getContext(JBPMTransactionTemplate.java:115)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:73)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getWorkflowById(JBPMEngine.java:759)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.getWorkflowById(WorkflowServiceImpl.java:319)
   at com.akwa.ws.repo.webservice.workflow.WorkflowWebService.setWorkflowServiceImpl(WorkflowWebService.java:29)
   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.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:786)
   at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:606)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
   at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
   at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:840)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1026)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:809)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

So my second question is : How to make the workflowServiceImpl bean synchronised with the hibernate session ? Or, if exists, which bean should I use instead ?

Thanks a lot for your replies.

PS : I try to inject the authenticationService, and it works… I think it means there is a way to configure some beans to be in the hibernate session… but how ?

aldebaranl2
Champ in-the-making
Champ in-the-making
The solution (solved some days ago) was to use the proxy bean instead of the bean itself.

harishns
Champ in-the-making
Champ in-the-making
I am also facing similar problem, I am using repository code like as follows which is throwing error
Code
BPMEngineRegistry registry = (BPMEngineRegistry)wc.getBean("bpm_engineRegistry");
TaskComponent taskcomponent = registry.getTaskComponent("jbpm");

Error

org.alfresco.error.AlfrescoRuntimeException: 01120004 Transaction must be active and synchronization is required: Thread[http-8080-2,5,main]
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:436)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:420)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:213)
   at org.alfresco.repo.workflow.jbpm.JBPMTransactionTemplate.getContext(JBPMTransactionTemplate.java:115)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:73)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getAssignedTasks(JBPMEngine.java:1167)
   at org.apache.jsp.Welcome_jsp._jspService(Welcome_jsp.java:127)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Unknown Source)
Feb 12, 2010 3:42:45 PM org.apache.catalina.core.ApplicationDispatcher invoke

Plz guide me if it wrong

Thanks