[
https://issues.apache.org/jira/browse/ACE-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079903#comment-13079903
]
Marcel Offermans commented on ACE-164:
--------------------------------------
Analysis: In this scenario you actually have a target that starts up and polls
the server. It shows up on the server because it polled, but that does not yet
make it a "registered" target. That also means that the stateful target (still
called StatefulGatewayObject for historic reasons, we still need to do a code
refactoring here) exists without an associated target (GatewayObject). The
stack trace occurs because the code does not yet check for every stateful
target if it is indeed registered before attempting to access the target itself.
Again, summarizing how targets can be added:
1) You can "pre-register" it beforehand, adding the target with its
identification to the system before it ever polled. You can then even already
schedule distributions for it, and as soon as it polls, it will get them.
2) You can wait until a target "shows up" and once you see it in the list, you
can register it. As soon as it's registered, you can add distributions to it.
As a side note, the web UI currently automatically "registers" a target as soon
as you drag a distribution onto it.
> Retrieving targets throws StatefulGatewayObject is not backed by a
> GatewayObject.
> ---------------------------------------------------------------------------------
>
> Key: ACE-164
> URL: https://issues.apache.org/jira/browse/ACE-164
> Project: Ace
> Issue Type: Bug
> Affects Versions: 1.0.0
> Reporter: Bram de Kruijff
> Assignee: Marcel Offermans
>
> Can not retrieve targets throu REST api when an agent has registered itself.
> 1) Start clean devserver target (including client REST)
> 2) Create a workspace through the rest api
> 3) GET ${WORK}/target
> > GET /client/work/rest-3/target HTTP/1.1
> < HTTP/1.1 200 OK
> []
> 4) Start a launcher that registers as a target
> 5) Create a workspace through the rest api
> 6) GET ${WORK}/target
> > GET /client/work/rest-5/target HTTP/1.1
> > User-Agent: curl/7.21.7 (i686-pc-linux-gnu) libcurl/7.21.7 OpenSSL/0.9.8k
> > zlib/1.2.1.2 libidn/0.5.6
> > Host: l0115.gx.local:8080
> > Accept: */*
> >
> < HTTP/1.1 500 This StatefulGatewayObject is not backed by a GatewayObject.
> < Content-Type: text/html; charset=iso-8859-1
> < Cache-Control: must-revalidate,no-cache,no-store
> < Content-Length: 3507
> < Server: Jetty(6.1.x)
> <
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 500 This StatefulGatewayObject is not backed by a
> GatewayObject.</title>
> </head>
> <body><h2>HTTP ERROR 500</h2>
> <p>Problem accessing /client/work/rest-5/target. Reason:
> <pre> This StatefulGatewayObject is not backed by a
> GatewayObject.</pre></p><h3>Caused
> by:</h3><pre>java.lang.IllegalStateException: This StatefulGatewayObject is
> not backed by a GatewayObject.
> at
> org.apache.ace.client.repository.stateful.impl.StatefulGatewayObjectImpl.ensureGatewayPresent(StatefulGatewayObjectImpl.java:409)
> at
> org.apache.ace.client.repository.stateful.impl.StatefulGatewayObjectImpl.getGatewayObject(StatefulGatewayObjectImpl.java:114)
> at
> org.apache.ace.client.rest.Workspace.getRepositoryObjectIdentity(Workspace.java:163)
> at
> org.apache.ace.client.rest.RESTClientServlet.doGet(RESTClientServlet.java:121)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira