Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] Version clash? OslcCoreMissingSetMethodException
  • From: Jan-Patrick Osterloh <osterloh@xxxxxxxx>
  • Date: Tue, 28 May 2019 10:06:10 +0200
  • Autocrypt: addr=osterloh@xxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFaYzvABEAC6kSTwexU5Zme4Zc21MF2Zy+fsv8/nLPVgeTTGCY/3RJEoqpMzd+Ox7JR3 iSMkItkxTHu6Giw8YcMNbTM5ptoSTryDRMjLXvvMTmaWhPBlv66gvy6KJwfLawkQAubJKj32 rh1/7r9eT4s7iDSTLcabyHHx/9Ogvhm7feRwOvRB9u7ukcI7m4fEDZscvVZKwlcGD3wr1OtY BQIOhhEzS6XvumVTgLBN5NgtEk5MlAmFIQaBxYDt47D1QsDu7991Z2iFTuuybqrJL0vo8PAA Sqtjo0cSQu12NqU78D3zCOG8hU+kiXKW2DdmXnmkbyH1K/yztwSpNfbbOpi17CeD1snmAAEY akTtZKkVvtTa3Xg3GQ6yU/GVxFEZ+cLDViRSStL1gi5mnRHbHY7IyoEx1W/+GYPv5ripe2aB Y9c1a9l/1bLxWXAKwbD9haCHZ19lMfvF0eGn4Li3HyB5YHnhCCapoxIJJnOuDGPvaB5H+qv1 p8cxqN7p24Z6v3NZ0b7sEtQNHnq9IvJ2sSUVpHk9hy93ZNdAg3TqrQ09kN7elXxPy3xQ5OLr Q/PZTGi8bRMSShzSm8KPZy1FKzSWbYTLOtiw6HeM2s7tl+lPVD2+UH0mWleXPfZ7iaIwKa7m XlkwUSgh2dc5LvWBVCz0LiXz1NBiqrT70czodA62l1pQYLno2wARAQABtChKYW4tUGF0cmlj ayBPc3RlcmxvaCA8b3N0ZXJsb2hAb2ZmaXMuZGU+iQJCBBMBCAAsAhsjBwsJCAcDAgEGFQgC CQoLBBYCAwECHgECF4ACGQEFAluWVmQFCQbeuvQACgkQlxtC0YJWygwFGRAAgNfQK1yfY5Wf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xxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/lyo-dev>
  • List-help: <mailto:lyo-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/lyo-dev>, <mailto:lyo-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/lyo-dev>, <mailto:lyo-dev-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

I don't know about Postman, but I manipulated the Accept-Header for the HTTP request in Firefox to RDF/XML, and it didn't work either. Then I tried json in the browser and it worked, so I also tried it in my program, and it worked.

A better error messaging would be nice :-)

For your questions, see below.


Am 27.05.2019 um 21:36 schrieb Andrii Berezovskyi:
OslcClient by default requests RDF/XML, there should be no need to fiddle with Postman. Sounds like a bug. Plus, we always wanted to fix those NPEs that should be instead detected as 4xx and 5xx and cause other exceptions to be thrown.

May I clarify: 

Yes, previously I tried CT_RDF, which failed.

  • Are you running Lyo Client stand-alone and NOT inside a JAX-RS server?
Yes, I run it stand-alone.

  • Are you running this client?

    <groupId>org.eclipse.lyo.clients</groupId>
    <artifactId>oslc4j-client</artifactId>
    <version>4.0.0-SNAPSHOT</version>

Yes, and I also included

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>2.28</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
            <version>2.28</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.lyo.clients</groupId>
            <artifactId>oslc4j-client</artifactId>
            <version>${version.lyo}</version>
        </dependency>


Best regards
JPO


--
–Andrew.

2019-05-27  kl. 21:08 skrev Jad El-Khoury <jad@xxxxxx>:

Jean-Patrick
 
If you browse the query in a webbrowser, the server is not serialising the query result as RDF (json, rdf-xml, etc). the server is simply showing a html representation of the java objects.
hence, that’s avoiding hitting the exception in AbstractOslcRdfXmlProvider.
 
Could you test the query from Postman, with the same parameters as the client (that is, application/rdf+xml) ?
 
Just to identify whether the problem is on the server or client side.
 
regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and Management, Mechatronics Division
Brinellvägen 83, SE-100 44 Stockholm, Sweden
Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45
 
From: lyo-dev-bounces@xxxxxxxxxxx <lyo-dev-bounces@xxxxxxxxxxx> On Behalf Of Jan-Patrick Osterloh
Sent: Monday, 27 May 2019 17:42
To: lyo-dev@xxxxxxxxxxx
Subject: Re: [lyo-dev] Version clash? OslcCoreMissingSetMethodException
 

Interesting, if I change set the Media Type to OSLCConstants.CR_JSON, then it works. Doesn't work with application/rdf+xml...

Best regards
JPO


Am 27.05.2019 um 17:11 schrieb Jan-Patrick Osterloh:

Hi, 

I migrated my provider (web application) to 4.0.0-SNAPSHOT and also my Lyo Designer to 4.0. This seem to work partially, the website is running fine, but when I make requests from my java client, I get an error when returning an object from a query Method:

[qtp50826412-34] WARN org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider - OSLC015: An error occurred serializing the resource
[WARNING] 
javax.servlet.ServletException: java.lang.IllegalStateException: java.lang.NullPointerException
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: java.lang.NullPointerException
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:166)
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeTo(AbstractOslcRdfXmlProvider.java:127)
    at org.eclipse.lyo.oslc4j.provider.jena.OslcRdfXmlProvider.writeTo(OslcRdfXmlProvider.java:237)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
    at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)
    at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
    at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    ... 29 more
Caused by: java.lang.NullPointerException
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.recursivelyCollectNamespaceMappings(JenaModelHelper.java:2092)
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.handleSingleResource(JenaModelHelper.java:247)
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.createJenaModel(JenaModelHelper.java:195)
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:143)
    ... 52 more
[WARNING] //localhost:8080/trainingsuite/services/serviceProviders/queryTDB/resources/oSLCUsers
javax.servlet.ServletException: javax.servlet.ServletException: java.lang.IllegalStateException: java.lang.NullPointerException
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:139)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:748)
Caused by: javax.servlet.ServletException: java.lang.IllegalStateException: java.lang.NullPointerException
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    ... 13 more
Caused by: java.lang.IllegalStateException: java.lang.NullPointerException
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:166)
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeTo(AbstractOslcRdfXmlProvider.java:127)
    at org.eclipse.lyo.oslc4j.provider.jena.OslcRdfXmlProvider.writeTo(OslcRdfXmlProvider.java:237)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:106)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:86)
    at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
    at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
    at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)
    at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
    at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    ... 29 more
Caused by: java.lang.NullPointerException
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.recursivelyCollectNamespaceMappings(JenaModelHelper.java:2092)
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.handleSingleResource(JenaModelHelper.java:247)
    at org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper.createJenaModel(JenaModelHelper.java:195)
    at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:143)


I'm not sure what the exact problem is. The object I return from my query method in the manager is not null. If I just browse the same query in a browser, everything is displayed as inteded. 

Here the client code: 
                    final OslcClient client = new OslcClient();
                    Map<String, String> params = new HashMap<String, String>();
                    String passenc = EncryptionUtils.encrypt(new String(pass));
                    params.put("loginname", username);
                    params.put("password", passenc);
                    res = client.getResource(resourceURI, params);
                    X[] user= res.readEntity(X[].class);

This calls the "public static List<X> queryXs(HttpServletRequest httpServletRequest, final String serviceProviderId, String where, int page, int limit)" in my Manager class, however, after returning there is the above exception. 

Best regards
Jan-Patrick




Am 23.05.2019 um 23:36 schrieb Andrii Berezovskyi:
Thanks a lot for the work, Jad! 
 
--
–Andrew.


2019-05-23  kl. 22:46 skrev Jad El-Khoury <jad@xxxxxx>:
 
Hi Jan-Patrick & all,
 
I have now updated the instructions to create OSLC4j projects for both 2.4.0 (Wink) & 4.0.0-SNAPSHOT (JAX-RS2.0).
 
While at it, I also migrated the old Bugzilla workshop to https://oslc.github.io/developing-oslc-applications/tutorials.html
It points to two versions of the tutorial: (1) code walkthrough (2) Step-by-step programming instructions
 
Please note that I tested and made sure the Bugzilla adaptor code builds and runs. But I did not test its functionality, since I do not have Bugzilla installed.
If anyone has tips on how we can improve the tutorial, it would be great.
 
Now that the content is under the stable OSLC Developer Guide, we hope we can maintain it better over time.
 
regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and Management, Mechatronics Division
Brinellvägen 83, SE-100 44 Stockholm, Sweden
Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45
 
From: Jad El-Khoury <jad@xxxxxx> 
Sent: 20 May 2019 07:46
To: Lyo project developer discussions <lyo-dev@xxxxxxxxxxx>
Subject: Re: [lyo-dev] Version clash? OslcCoreMissingSetMethodException
 
Good morning 
 
And, the latest Lyo Designer 4.0.0-SNAPSHOT will need to be downloaded from the Edge update site http://download.eclipse.org/lyo/p2/edge/
 
I also realise that the instructions on how to setup an oslc4j project are no longer up to date for 4.0.0-snapshot. 
 
I will update this page early this week. In the meantime, you can look at the sample projects in this repo (https://github.com/OSLC/lyo-adaptor-sample-modelling/tree/4.0.0-snapshot) for tips, in particular the pom.xml file.
 
 
 Regards
Jad 
 
 
 
 


On 17 May 2019, at 18:06, Andrii Berezovskyi <andriib@xxxxxx> wrote:

Lyo 4.0.0-SNAPSHOT is available from maven. I have updated the core README: https://github.com/eclipse/lyo.core/blob/master/README.md#getting-started
 
 
--
–Andrew.



2019-05-17  kl. 17:45 skrev Jan-Patrick Osterloh <osterloh@xxxxxxxx>:
 
Dear Jad, 


Ok, I digged a little bit into this, and the problem is that the generated code for my DomainModel looks like this: 

...
public HashSet<Link> getStars();
public void setStars(final Set<Link> stars );

... 

Because the JenaModelHelper looks in the "createPropertyDefinitionToSetMethods" method for the set Method of this Feature like this:

final Method setMethod = beanClass.getMethod(setMethodName, getMethodReturnType);  


Since "getMethodReturnType" is "HashSet<Link>", but the method is "Set<Link>" it fails. After I manually changed the HashSet<Link> from the get Methods to Set<Link>, everything works again. Of course this is only a temporary hack...

I really would like to use Maven for dependency management, and I was so happy to lyo there! Will this be supported in feature?


Best regards
JPO





Am 17.05.2019 um 14:44 schrieb Jad El-Khoury:
Hi Jan-Patrick,
 
before I dig into this problem, any chance you want to work with Lyo 4.0.0-SNAPSHOT instead? Both for LyoDesigner, and the Lyo SDK. 
 
The biggest difference to consider first though is the fact that Lyo 4.0.0-SNAPSHOT uses JAX-RS2.0 (hence you need to adopt an implementation such as Jersey), while 2.4.0 still uses JAX-RS1.0 (and specifically WINK).
 
regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and Management, Mechatronics Division
Brinellvägen 83, SE-100 44 Stockholm, Sweden
Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45
jad@xxxxxx, https://www.kth.se/profile/jad 
 
-----Original Message-----
From: lyo-dev-bounces@xxxxxxxxxxx <lyo-dev-bounces@xxxxxxxxxxx> On Behalf Of Jan-Patrick Osterloh
Sent: Friday, 17 May 2019 13:50
To: lyo-dev@xxxxxxxxxxx
Subject: [lyo-dev] Version clash? OslcCoreMissingSetMethodException
 
Dear all,
 
I recently switched to LYO designer 2.4.0. When I access the generated webapp with my client, I get some OslcCoreMissingSetMethodExceptions
(which are somehow hidden and not printed in stacktrace....). I guess that my client does not "understand" the new get Methods. I already found https://github.com/eclipse/lyo.designer/issues/61
 
To what "client" version do I need to switch? My current maven setup is:
        <dependency>
            <groupId>org.eclipse.lyo.oslc4j.core</groupId>
            <artifactId>oslc4j-jena-provider</artifactId>
            <version>${lyo.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.eclipse.lyo.oslc4j.core</groupId>
            <artifactId>oslc4j-json4j-provider</artifactId>
            <version>${lyo.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.lyo.oslc4j.core</groupId>
            <artifactId>oslc4j-wink</artifactId>
            <version>${lyo.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
 
(with lyo.version set to 2.4.0, and I also tested 2.2.0).
Both are from the Eclipse Releases repository (https://repo.eclipse.org/content/groups/releases/).
 
 
Best regards
Jan-Patrick
 
--
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
 
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
             FuE Bereich Verkehr     | R&D Division Transportation
             Escherweg 2, 26121 Oldenburg - Germany
Room:        D107
Phone/Fax:   +49 441 97 22-524 / -502
E-Mail:      osterloh@xxxxxxxx
URL:         http://www.offis.de 
 
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
          Prof. Dr. techn. Susanne Boll-Westermann,
          Prof. Dr.-Ing. Axel Hahn,
          Prof. Dr.-Ing. Andreas Hein,
          Prof. Dr. Sebastian Lehnhoff 
 
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/lyo-dev
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev



-- 
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
 
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
             FuE Bereich Verkehr     | R&D Division Transportation
             Escherweg 2, 26121 Oldenburg - Germany
Room:        D107
Phone/Fax:   +49 441 97 22-524 / -502
E-Mail:      osterloh@xxxxxxxx
URL:         http://www.offis.de 
 
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
          Prof. Dr. techn. Susanne Boll-Westermann,
          Prof. Dr.-Ing. Axel Hahn,
          Prof. Dr.-Ing. Andreas Hein,
          Prof. Dr. Sebastian Lehnhoff 
 
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev
 
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev
 


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev


-- 
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
 
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
             FuE Bereich Verkehr     | R&D Division Transportation
             Escherweg 2, 26121 Oldenburg - Germany
Room:        D107
Phone/Fax:   +49 441 97 22-524 / -502
E-Mail:      osterloh@xxxxxxxx
URL:         http://www.offis.de 
 
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
          Prof. Dr. techn. Susanne Boll-Westermann,
          Prof. Dr.-Ing. Axel Hahn,
          Prof. Dr.-Ing. Andreas Hein,
          Prof. Dr. Sebastian Lehnhoff 
 


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev


-- 
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group
 
OFFIS e.V. - Institut für Informatik | Institute for Information Technology
             FuE Bereich Verkehr     | R&D Division Transportation
             Escherweg 2, 26121 Oldenburg - Germany
Room:        D107
Phone/Fax:   +49 441 97 22-524 / -502
E-Mail:      osterloh@xxxxxxxx
URL:         http://www.offis.de 
 
Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
          Prof. Dr. techn. Susanne Boll-Westermann,
          Prof. Dr.-Ing. Axel Hahn,
          Prof. Dr.-Ing. Andreas Hein,
          Prof. Dr. Sebastian Lehnhoff 
 
_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lyo-dev

-- 
Dipl. Inform. Jan-Patrick Osterloh
Senior Research Engineer
Human Centered Design Group

OFFIS e.V. - Institut für Informatik | Institute for Information Technology
             FuE Bereich Verkehr     | R&D Division Transportation
             Escherweg 2, 26121 Oldenburg - Germany
Room:        D107
Phone/Fax:   +49 441 97 22-524 / -502
E-Mail:      osterloh@xxxxxxxx
URL:         http://www.offis.de 

Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender),
          Prof. Dr. techn. Susanne Boll-Westermann,
          Prof. Dr.-Ing. Axel Hahn,
          Prof. Dr.-Ing. Andreas Hein,
          Prof. Dr. Sebastian Lehnhoff 


Back to the top