AnsweredAssumed Answered

Remote API e chiamate esterne

Question asked by alnitakzeta on Oct 16, 2012
Latest reply on Nov 5, 2012 by alnitakzeta
Ciao a tutti,

devo creare uno script che mi permetta di fare delle chiamate ad un servizio esterno. Cosa ho fatto:

1) nello share-config-custom.xml ho inserito un nuovo endpoit per il servizio esterno

       <endpoint>
            <id>ext-service</id>
            <name>External Service</name>
            <description>Servizio esterno</description>
            <connector-id>http</connector-id>
            <endpoint-url>http://server-ext:8080</endpoint-url>
         </endpoint>

2) ho creato uno script "test.js" che dovrebbe chiamare un servizio esterno ed ho utilizzato il seguente codice:

var userName = "test";
var message = "Test";
try {
   
   


   
   var parameterNotify = "message=" + message  +"  "&username=" + userName;
   
   connector = remote.connect("exty-service");
   connector.get("/service&" + parameterNotify );

   
}catch(ex){

   error = String(ex);
   


3) Ho associato questo scritp ad una regola di contenuto.


Quando viene eseguito lo scritp  mi ritorna un eccezzione:

11:15:47,766 User:admin ERROR [repo.transaction.AlfrescoTransactionSupport] After completion (committed) listener exception:
   listener: org.alfresco.repo.action.ActionTransactionListener@36831481
java.lang.NullPointerException
        at org.alfresco.repo.action.CreateThumbnailActionFilter.compare(CreateThumbnailActionFilter.java:38)
        at org.alfresco.repo.action.CreateThumbnailActionFilter.compare(CreateThumbnailActionFilter.java:30)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl.executeAction(AsynchronousActionExecutionQueueImpl.java:275)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl.executeAction(AsynchronousActionExecutionQueueImpl.java:214)
        at org.alfresco.repo.action.ActionServiceImpl.queueAction(ActionServiceImpl.java:569)
        at org.alfresco.repo.action.ActionServiceImpl.postCommit(ActionServiceImpl.java:556)
        at org.alfresco.repo.action.ActionTransactionListener.afterCommit(ActionTransactionListener.java:77)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.afterCompletion(AlfrescoTransactionSupport.java:802)
        at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:799)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:394)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:472)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:403)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        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:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        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:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)


Qualcuno sa indicarmi dove sbaglio?

Outcomes