I created an EMF based editor that uses TexoResources. Loading the resources via a texo servlet works, saving the resources after they were edited works, too, except for a map. If I try to persist this map the server throws an IllegalArgumentException and says, this is not a known entity type. Here the complete exception:

java.lang.IllegalArgumentException: Object: SubjectProperty{key: warumvalue: dreck} is not a known entity type.
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4158)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:440)
at org.eclipse.emf.texo.server.store.BaseDao.insert(BaseDao.java:204)
at org.eclipse.emf.texo.server.store.EntityManagerObjectStore.insert(EntityManagerObjectStore.java:146)
at org.eclipse.emf.texo.server.service.UpdateInsertModelOperation.internalExecute(UpdateInsertModelOperation.java:85)
at org.eclipse.emf.texo.server.service.ModelOperation.execute(ModelOperation.java:59)
at org.eclipse.emf.texo.server.web.WebServiceHandler.doPost(WebServiceHandler.java:111)
at org.eclipse.emf.texo.server.web.WebServiceServlet.doPost(WebServiceServlet.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Loading this map and showing it in the editor is no problem, persisting it with the Eclipselink entity manager isn't as well. That is why I assume it is not a problem with the orm.xml or the annotations.
The following xml includes the class "SubjectProperty" represented in the ecore model.

Hi Bastian,
Afaics there should not be a generated entity for an emap entry eclass. So I think the conversion/jsonresource to the
json message has a bug in that emap entries should not be send back as individual entries but as part of the containing
entity.
But I am surprised that the system does not give an exception earlier. Is the emap entry (UserProperty) present as a
generated java entity (if so can you post it)? Can you post the generated User class also?

This is shown in the json you posted (the entry is both present in the 'inserted' part as well as in the 'properties' of
the updated user).

If you want to take a look at the ecore model, it is contained in my mail to you from the day before yesterday.
Also, I get another error message, which does not seem to be connected with this entity exception. But I think it could be helpful, to give you as much information as possible The following error occurs sometimes during the data retrieval at the editors startup, sometimes when I click an an item in the editor. I haven't debugged it so far, since I neither see any effect nor do I see the context. But I think, it is nice to mention it

java.lang.IllegalArgumentException: Service path null not supported, uri http://localhost:8080/texo/jsonws
at org.eclipse.emf.texo.server.service.RetrieveModelOperation.internalExecute(RetrieveModelOperation.java:115)
at org.eclipse.emf.texo.server.service.ModelOperation.execute(ModelOperation.java:59)
at org.eclipse.emf.texo.server.web.WebServiceHandler.doGet(WebServiceHandler.java:89)
at org.eclipse.emf.texo.server.web.WebServiceServlet.doGet(WebServiceServlet.java:57)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:244)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Hi Bastian,
Okay, there is a missing feature/bug in that the json (de-) serialization should ignore those EMap eclasses. Can you
enter a bugzilla for it? Will solve it during the weekend.

For the exception below, it seems that the url for the request is incomplete: http://localhost:8080/texo/jsonws
Texo expects an eclass name/id as the last segments of the uri, but the request uri does not have these.

Hi Bastian,
Okay and the request you send to the server, how does the URI look like?
You are using the JSON resource, right? If so, then this could be an issue in the JSON resource, but can you provide
some details, maybe I can replay it in a junit testcase.

gr. Martin

On 01/28/2013 09:17 AM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I just wanted to tell you what evoked the mentioned "service path null exception". It was thrown, when the editor
> selection was empty.
>
> Best regards
> Bastian

I'm using a JSONResource, right. So when I select an item in the editor (like a User) a SelectionChangedEvent is thrown with the current selection. Somtimes, I don't know for which reasons, a selection is empty (ISelection.isEmpty() == true). Then the doGet method is invoked and the request URI is: "/texo/jsonws", nothing more, and the exception is thrown. If the selection is not empty (e.g. a User) the request URI is: "/texo/jsonws/users|User/1".
So I now filter any empty selection.

On 01/28/2013 12:02 PM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I'm using a JSONResource, right. So when I select an item in the editor (like a User) a SelectionChangedEvent is thrown
> with the current selection. Somtimes, I don't know for which reasons, a selection is empty (ISelection.isEmpty() ==
> true). Then the doGet method is invoked and the request URI is: "/texo/jsonws", nothing more, and the exception is
> thrown. If the selection is not empty (e.g. a User) the request URI is: "/texo/jsonws/users|User/1".
> So I now filter any empty selection.
>
> Where these information detailled enough?
>
> Best regards Bastian
>

Well.... I figured out what made the exception show up: The editor has some filters. So when a filter is activated the selection changes, but is empty (not null). I assume Texo tries to load the contained resources of a selected item, which does not exist.

I think the doGet method is called, when Texo loads the children of a selected resource.

Not yet... can you post the stacktrace of the doGet call? So then I can see what the entry point for this error is.
I mean how can it load the contained resources of a selected item which is null..

gr. Martin

On 01/28/2013 01:02 PM, Bastian Wagenfeld wrote:
> Well.... I figured out what made the exception show up: The editor has some filters. So when a filter is activated the
> selection changes, but is empty (not null). I assume Texo tries to load the contained resources of a selected item,
> which does not exist.
>
> I think the doGet method is called, when Texo loads the children of a selected resource.
>
> I hope it is getting a little clearer :)
>
> Bastian

java.lang.IllegalArgumentException: Service path null not supported, uri http://localhost:8080/texo/jsonws
at org.eclipse.emf.texo.server.service.RetrieveModelOperation.internalExecute(RetrieveModelOperation.java:115)
at org.eclipse.emf.texo.server.service.ModelOperation.execute(ModelOperation.java:59)
at org.eclipse.emf.texo.server.web.WebServiceHandler.doGet(WebServiceHandler.java:89)
at org.eclipse.emf.texo.server.web.WebServiceServlet.doGet(WebServiceServlet.java:57)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:244)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

I don't know how Texo reacts to a change of selection, but the error was thrown each time the selection changed, because the filters changed the displayed elements.
A little example:
The ResourceSet includes apples and bananas. Only apples are shown. I can click on a apple and Texo loads its children. Now, I activate a filter and all apples disappear and the bananas show up instead. That is when the selection changes, but actually no item is really selected. So the SelectionChangedEvent includes only an empty selection.
All I do with Texo in the editor: Load bananas and apples to the ResourceSet of the EMFEditor's EditingDomain. That's all. Texo does all the rest.

Hi Bastian,
I mean, can you post the stack trace on the client side? So put a breakpoint where the http request is done to the
server and then get the stacktrace. The error is probably in the JSONresource not on the server side.

gr. Martin

On 01/28/2013 01:57 PM, Bastian Wagenfeld wrote:
> That is the strange thing :)
> It is the stacktrace I posted above: java.lang.IllegalArgumentException: Service path null not supported, uri
> http://localhost:8080/texo/jsonws
> at org.eclipse.emf.texo.server.service.RetrieveModelOperation.internalExecute(RetrieveModelOperation.java:115)
> at org.eclipse.emf.texo.server.service.ModelOperation.execute(ModelOperation.java:59)
> at org.eclipse.emf.texo.server.web.WebServiceHandler.doGet(WebServiceHandler.java:89)
> at org.eclipse.emf.texo.server.web.WebServiceServlet.doGet(WebServiceServlet.java:57)
> at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:244)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
>
> I don't know how Texo reacts to a change of selection, but the error was thrown each time the selection changed, because
> the filters changed the displayed elements.
> A little example: The ResourceSet includes apples and bananas. Only apples are shown. I can click on a apple and Texo
> loads its children. Now, I activate a filter and all apples disappear and the bananas show up instead. That is when the
> selection changes, but actually no item is really selected. So the SelectionChangedEvent includes only an empty
> selection. All I do with Texo in the editor: Load bananas and apples to the ResourceSet of the EMFEditor's
> EditingDomain. That's all. Texo does all the rest.
>
> Bastian

I thought that you could be interessted in such an error message, but there is none, I'm sorry. Only the server throws an error.
Maybe you can tell me which methods in which classes are invoked, when an object gets selected in an editor. So far I can't see where exactly the exception is thrown. Sometimes the server throws the exception, when the variable urlStr in the doHTTPRequest-method is null. The client itself doesn't throw an exception.
For example the doHTTPRequest with the following parameters in the JSONObjectStore led to an exception:

Hi Bastian,
The client won't show/have an exception, but it does a http request with an invalid uri. So my main thing is to
understand how this client side thing happens. Can you put a breakpoint here:
JSONEObjectStore.doHTTPRequest
and then post the stacktrace of the invalid request (from the client)?

gr. Martin

On 01/29/2013 09:22 AM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> I thought that you could be interessted in such an error message, but there is none, I'm sorry. Only the server throws
> an error.
> Maybe you can tell me which methods in which classes are invoked, when an object gets selected in an editor. So far I
> can't see where exactly the exception is thrown. Sometimes the server throws the exception, when the variable urlStr in
> the doHTTPRequest-method is null. The client itself doesn't throw an exception.
> For example the doHTTPRequest with the following parameters in the JSONObjectStore led to an exception:
>
> urlStr = null;
> content = { "_eclass" : "request|QueryType",
> "_title" : "",
> "countOperation" : "false",
> "doCount" : "false",
> "firstResult" : "-1",
> "maxResults" : "-1",
> "parameters" : [ ],
> "query" : "select a from as_Aircraft a"
> }
> localUrlStr = http://localhost:8080/texo/jsonws
> url:
> - file = /texo/jsonws
> - path = /texo/jsonws
> - query = null
>
> I'm sorry, but that is all I can tell you. I hope that is enough?!
>
> Best regards
> Bastian

we tried a lot today, but couldn't find out at which particular point the exception occurs. Therefore I don't have a stack trace to offer
But I can tell you the exception isn't throm in the EObjectStore's doHTTPRequest. And it isn't evoked in any other class of the texo packages that does a server request. I don't have a clue where the server is called, instead. So I'm very sorry, but I can't tell you where this error is produced.

Hi Bastian,
Thanks for all your tries! But the exception is not thrown in the client. I mean can you for which httprequest-uri the
exception gets thrown on the server.
So the exception is not thrown in doHttpRequest, but the doHttpRequest will cause a server side exception. I am
interested in the client-side stack trace which causes the server side exception.

But it already took a lot of your time, so only if you have some time left.. :-).

gr. Martin

On 01/30/2013 05:25 PM, Bastian Wagenfeld wrote:
> Hi Martin,
>
> we tried a lot today, but couldn't find out at which particular point the exception occurs. Therefore I don't have a
> stack trace to offer :)
> But I can tell you the exception isn't throm in the EObjectStore's doHTTPRequest. And it isn't evoked in any other class
> of the texo packages that does a server request. I don't have a clue where the server is called, instead. So I'm very
> sorry, but I can't tell you where this error is produced.
>
> Best regards
> Bastian

I would really like to help you and I understand that the exception is thrown on the server side, but the problem is I don't understand at which point the client makes a call that leads to the server error. Amongst others I did the following:

1. I put a breakpoint in the doHTTPRequest method in the JSONEObjectStore.
2. I start the editor -> the editor fills the model and creates the Resource for the editor.
3. The editor includes models of Aircrafts and models of users. Since it is in the Aircraft-perspective, only the Aircrafts are shown. (During this initialization the doHTTPRequest method is called a couple of times, but nothing bad happens.)
4. I switch to the User-perspective. The Aircrafts get filtered and the Users show up.
5. I switch back to the Aircraft-perspective.
6. I select an Aircraft.
7. The server throws the IllegalArgumentException and AFTER THIS the debugging stops in the doHTTPRequest method.

So that is why I don't have a reasonable stacktrace for you. I can offer you the following stack trace. But be aware this is the client's stack trace immediatley AFTER the exception is thrown on the server. The EntityManager did not read or write something between the exception and this point in the stack trace.

Maybe it would be easier, if you'd try to reproduce this error on your own?! This souldn't be much work to do. In my case the basic things to do are: Create an standard EMF editor, replace the createModel method and add a JSONTexoResource and add a filter to the editor. I think that are the main things.

I hope this is at least a little helpful to you to understand the error. I did not

Another thing: Did you have time to look at the Map-issue? This is a big problem to me.