cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3157
Views
0
Helpful
5
Replies

Exceptions thrown when deleting jobs via REST api

david.watkins
Level 1
Level 1

Hi,

I am using the Tidal 6.0.3 REST api and having problems when attempting to delete a job (also happens with calendars)  via the REST api. 

I've tried numerous approaches, de-activating the job first, trying  Job.remove as well as Job.delete but no luck.  The post I'm trying to send is:

<?xml version="1.0" encoding="UTF-8" ?>

<entry xmlns="http://purl.org/atom/ns#">

<id>xxx</id>

<tes:Job.delete xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">

  <tes:job>

   <tes:id>31462</tes:id>

  </tes:job>

</tes:Job.delete>

</entry>

The id is valid and my account can delete jobs via the client web gui interface.

The exception I get is very long, the relevant bits are included below:

  <tes:result xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">

  <tes:ok>
false
</tes:ok>

<tes:objectname>java.lang.reflect.InvocationTargetException</tes:objectname>

<tes:message>

     exception:java.lang.reflect.InvocationTargetExceptionreason:description:=> sun.reflect.GeneratedMethodAccessor62612.invoke [null -1]=> sun.reflect.DelegatingMethodAccessorImpl.invoke [null -1]=> java.lang.reflect.Method.invoke [null -1]=> com.tidalsoft.framework.execute.CallMethod.execute [CallMethod.java 228]=> com.tidalsoft.framework.execute.Batch$ExecuteInstance.execute [Batch.java 109]=> com.tidalsoft.framework.execute.Batch.execute [Batch.java 58]=> com.tidalsoft.framework.execute.Executor.execute [Executor.java 65]=> com.tidalsoft.framework.execute.Executor.executeAsync [Executor.java 52]=> com.tidalsoft.framework.execute.Execution.execute [Execution.java 24]=> com.tidalsoft.webclient.tes.dsp.DataSourceProviderImpl.processRequest [DataSourceProviderImpl.java 673]=> com.tidalsoft.clientmgr.logic.DataSourceManager$DataSourceWrapper$MessageListener.onMessage [DataSourceManager.java 265]=> com.tidalsoft.framework.jms.MessageSink.fireMessage [MessageSink.java 210]=> com.tidalsoft.framework.jms.MessageSink.access$000 [MessageSink.java 16]=> com.tidalsoft.framework.jms.MessageSink$1.onMessage [MessageSink.java 84]=> org.apache.activemq.ActiveMQSession.run [ActiveMQSession.java 833]=> org.apache.activemq.ActiveMQQueueSession.run [ActiveMQQueueSession.java 355]=> com.tidalsoft.framework.jms.ServerSessionPool$ServerSession.run [ServerSessionPool.java 240]=> java.util.concurrent.ThreadPoolExecutor$Worker.runTask [null -1]=> java.util.concurrent.ThreadPoolExecutor$Worker.run [null -1]=> java.lang.Thread.run [null -1]Caused byexception:java.lang.reflect.InvocationTargetExceptionreason:description:=> sun.reflect.GeneratedMethodAccessor62670.invoke [null -1]=> sun.reflect.DelegatingMethodAccessorImpl.invoke [null -1]=> java.lang.reflect.Method.invoke [null -1]=> com.tidalsoft.framework.execute.CallMethod.execute [CallMethod.java 228]=> com.tidalsoft.framework.execute.Executor.execute [Executor.java 65]=> com.tidalsoft.framework.execute.Executor.executeAsync [Executor.java 52]=> com.tidalsoft.clientmgr.api.RequestProcessor.executeRequest [RequestProcessor.java 260]=> com.tidalsoft.clientmgr.api.RequestProcessor.processRequests [RequestProcessor.java 154]=> sun.reflect.GeneratedMethodAccessor62612.invoke [null -1]=> sun.reflect.DelegatingMethodAccessorImpl.invoke [null -1]=> java.lang.reflect.Method.invoke [null -1]=> com.tidalsoft.framework.execute.CallMethod.execute [CallMethod.java 228]=> com.tidalsoft.framework.execute.Batch$ExecuteInstance.execute [Batch.java 109]=> com.tidalsoft.framework.execute.Batch.execute [Batch.java 58]=> com.tidalsoft.framework.execute.Executor.execute [Executor.java 65]=> com.tidalsoft.framework.execute.Executor.executeAsync [Executor.java 52]=> com.tidalsoft.framework.execute.Execution.execute [Execution.java 24]=> com.tidalsoft.webclient.tes.dsp.DataSourceProviderImpl.processRequest [DataSourceProviderImpl.java 673]=> com.tidalsoft.clientmgr.logic.DataSourceManager$DataSourceWrapper$MessageListener.onMessage [DataSourceManager.java 265]=> com.tidalsoft.framework.jms.MessageSink.fireMessage [MessageSink.java 210]=> com.tidalsoft.framework.jms.MessageSink.access$000 [MessageSink.java 16]=> com.tidalsoft.framework.jms.MessageSink$1.onMessage [MessageSink.java 84]=> org.apache.activemq.ActiveMQSession.run [ActiveMQSession.java 833]=> org.apache.activemq.ActiveMQQueueSession.run [ActiveMQQueueSession.java 355]=> com.tidalsoft.framework.jms.ServerSessionPool$ServerSession.run [ServerSessionPool.java 240]=> java.util.concurrent.ThreadPoolExecutor$Worker.runTask [null -1]=> java.util.concurrent.ThreadPoolExecutor$Worker.run [null -1]=> java.lang.Thread.run [null -1]Caused byexception:java.lang.NullPointerExceptionreason:description:=> com.tidalsoft.webclient.tes.dsp.api.ObjectRequestHandler.checkMethodAuthorization [ObjectRequestHandler.java 1014]=> com.tidalsoft.webclient.tes.dsp.api.ObjectRequestHandler.executeCRUD [ObjectRequestHandler.java 538]=> com.tidalsoft.webclient.tes.dsp.api.ObjectRequestHandler.executeCRUD [ObjectRequestHandler.java 528]=> com.tidalsoft.webclient.tes.dsp.api.ObjectRequestHandler.delete [ObjectRequestHandler.java 454]=> sun.reflect.GeneratedMethodAccessor62670.invoke [null -1]=> sun.reflect.DelegatingMethodAccessorImpl.invoke [null -1]=> java.lang.reflect.Method.invoke [null -1]=> com.tidalsoft.framework.execute.CallMethod.execute [CallMethod.java 228]=> com.tidalsoft.framework.execute.Executor.execute [Executor.java 65]=> com.tidalsoft.framework.execute.Executor.executeAsync [Executor.java 52]=> com.tidalsoft.clientmgr.api.RequestProcessor.executeRequest [RequestProcessor.java 260]=> com.tidalsoft.clientmgr.api.RequestProcessor.processRequests [RequestProcessor.java 154]=> sun.reflect.GeneratedMethodAccessor62612.invoke [null -1]=> sun.reflect.DelegatingMethodAccessorImpl.invoke [null -1]=> java.lang.reflect.Method.invoke [null -1]=> com.tidalsoft.framework.execute.CallMethod.execute [CallMethod.java 228]=> com.tidalsoft.framework.execute.Batch$ExecuteInstance.execute [Batch.java 109]=> com.tidalsoft.framework.execute.Batch.execute [Batch.java 58]=> com.tidalsoft.framework.execute.Executor.execute [Executor.java 65]=> com.tidalsoft.framework.execute.Executor.executeAsync [Executor.java 52]=> com.tidalsoft.framework.execute.Execution.execute [Execution.java 24]=> com.tidalsoft.webclient.tes.dsp.DataSourceProviderImpl.processRequest [DataSourceProviderImpl.java 673]=> com.tidalsoft.clientmgr.logic.DataSourceManager$DataSourceWrapper$MessageListener.onMessage [DataSourceManager.java 265]=> com.tidalsoft.framework.jms.MessageSink.fireMessage [MessageSink.java 210]=> com.tidalsoft.framework.jms.MessageSink.access$000 [MessageSink.java 16]=> com.tidalsoft.framework.jms.MessageSink$1.onMessage [MessageSink.java 84]=> org.apache.activemq.ActiveMQSession.run [ActiveMQSession.java 833]=> org.apache.activemq.ActiveMQQueueSession.run [ActiveMQQueueSession.java 355]=> com.tidalsoft.framework.jms.ServerSessionPool$ServerSession.run [ServerSessionPool.java 240]=> java.util.concurrent.ThreadPoolExecutor$Worker.runTask [null -1]=> java.util.concurrent.ThreadPoolExecutor$Worker.run [null -1]=> java.lang.Thread.run [null -1]

</tes:message>

<tes:objectid>0</tes:objectid>

<tes:id>0</tes:id>

  </tes:result>

Anyone got any ideas of what I may be doing wrong ?

Thanks,

Dave W.

1 Accepted Solution

Accepted Solutions

chakuo
Level 1
Level 1

It appears that the problem is there is no owner-id for the job being deleted. The API assumes there is one, so it throws an error when there isn't one. Did you assign an owner-id when creating this job? If not, could you assign one and then try deleting again. As for the followup: the web-client does utilize the same API backend, but it goes through GWT RPC instead of HTTP REST like you're doing. Because of this, you may not be able to sniff out the calls directly. The iPhone client however does make direct HTTP REST calls, so that may be more useful to you.

View solution in original post

5 Replies 5

david.watkins
Level 1
Level 1

On a slightly related note, the first webinar indicated that the web-client uses the REST api internally.  I've been looking at the network traffic from my browser and that doesn't seem to be the case.  Was this a mistake in the presentation or is there a setting somewhere that could enable this.  It would be very handy as I'd be able to work out the call syntax from the client interactions.

Thanks,

Dave W.

chakuo
Level 1
Level 1

It appears that the problem is there is no owner-id for the job being deleted. The API assumes there is one, so it throws an error when there isn't one. Did you assign an owner-id when creating this job? If not, could you assign one and then try deleting again. As for the followup: the web-client does utilize the same API backend, but it goes through GWT RPC instead of HTTP REST like you're doing. Because of this, you may not be able to sniff out the calls directly. The iPhone client however does make direct HTTP REST calls, so that may be more useful to you.

Hi Charles,

Thanks that worked well.  Is there anymore documentation on the API ? in particular working out what the numeric types signify involves quite a lot of trial and error.  We're basically trying to integrate deployment of tidal jobs etc. into our build scripts so that we can tear down and rebuild environments based on version controlled job definitions.

Thanks again,

Dave

We do have an official API doc, but it doesn't have a whole lot of detail. Not sure if this is the one you're looking at. I'm looking at producing a more complete doc directly from the API. Will keep you posted.

Hi Charles,

Yes, I think thats the one I've got:  "Tidal Enterprise Scheduler, REST API Reference Guide", it was great for getting started but I am now really looking forward to the more compete docs !

Thanks for getting back to me so quickly,

Dave W.