Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4j.co(A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4j.core.model.ServiceProviderCatalog type)
A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4j.co [message #1768843] Mon, 24 July 2017 10:08 Go to next message
Rajkumar K is currently offline Rajkumar KFriend
Messages: 26
Registered: May 2015
Junior Member
Hello,

I have followed the wiki page {https://wiki.eclipse.org/Lyo/BuildClient} and setup the

Eclipse Lyo project in my workspace. I have run the Maven clean install.

I have modified the RRCFormSample.java for my requirement and able to run in the

Eclipse environment successfully with you any problem.

Now I want to make the sources to run in command line. I have created the

runnable Jar (org.eclipse.lyo.client.java.sample) by adding the following

in pom.xml of org.eclipse.lyo.client.java.sample.

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>org.eclipse.lyo.client.oslc.samples.RRCFormSample</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}\lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.eclipse.lyo.client.oslc.samples.RRCFormSample</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

The required libraries are copied and unpacked as class files. Please have a look on

the attachment (lib.zip, oslc-java-samples-2.1.2-jar-with-dependencies.jar).

Later when I run in command line mode (Batch script) get the

following Exception

A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4j.core.model.ServiceProviderCatalog type
and text/html; charset=UTF-8 media type. Verify that all entity providers are correctly registered. Add a custom javax.ws.rs.ext.MessageBodyRea
der provider to handle the type and media type if a JAX-RS entity provider does not currently exist.
java.lang.RuntimeException: A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4j.core.model.ServiceP
roviderCatalog type and text/html; charset=UTF-8 media type. Verify that all entity providers are correctly registered. Add a custom javax.ws.r
s.ext.MessageBodyReader provider to handle the type and media type if a JAX-RS entity provider does not currently exist.
at org.apache.wink.client.internal.handlers.ClientResponseImpl.readEntity(ClientResponseImpl.java:122)
at org.apache.wink.client.internal.handlers.ClientResponseImpl.getEntity(ClientResponseImpl.java:65)
at org.apache.wink.client.internal.handlers.ClientResponseImpl.getEntity(ClientResponseImpl.java:52)
at org.eclipse.lyo.client.oslc.OslcClient.lookupServiceProviderUrl(OslcClient.java:470)
at org.eclipse.lyo.client.oslc.samples.RRCFormSample.main(RRCFormSample.java:124)

#1 Is this Bug in Ecliplse Lyo 2.1.2 ?

#2) Do we have somewhere list of jars required for particular Eclipse Lyo version to run in command line ?

For example where I can download list of Jars for

Eclipse Lyo 2.1.0 release or Eclipse Lyo 2.2.0 release ?

#3 Did I miss some libraries to include to run org.eclipse.lyo.client.oslc.samples.RRCFormSample.java ?

Best Regards,

Rajkumar

[Updated on: Mon, 24 July 2017 11:05]

Report message to a moderator

Re: A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4 [message #1768854 is a reply to message #1768843] Mon, 24 July 2017 11:06 Go to previous messageGo to next message
Rajkumar K is currently offline Rajkumar KFriend
Messages: 26
Registered: May 2015
Junior Member
Attached lib.zip
Re: A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4 [message #1768859 is a reply to message #1768854] Mon, 24 July 2017 12:30 Go to previous messageGo to next message
Andrii BerezovskyiFriend
Messages: 17
Registered: May 2016
Junior Member
Hi Rajkumar,

I think the problem is that your response for the ServiceProviderCatalog resource is not in RDF (application/rdf+xml) but in HTML (text/html, as indicated in your response). So the error is that there is no such class registered that can parse html AND create an instance of the ServiceProviderCatalog class for you. Please note this is NOT a ClassNotFoundException.

If it works in the IDE, though, that might be because you have environment/system variables set in your launch config etc.?

/Andrew

P.S. I think you are messing too much with the libraries folder etc. Try following https://www.mkyong.com/maven/create-a-fat-jar-file-maven-assembly-plugin/


Best regards,
Andrew
Eclipse Lyo project lead & OSLC Core TC voting member
Re: A javax.ws.rs.ext.MessageBodyReader implementation was not found for class org.eclipse.lyo.oslc4 [message #1768928 is a reply to message #1768859] Tue, 25 July 2017 05:07 Go to previous message
Rajkumar K is currently offline Rajkumar KFriend
Messages: 26
Registered: May 2015
Junior Member
Hi Andrew,

Many thanks for your hint and your hint solved my problem :)

Yes you are right the response in the command line client doesn't returns RDF

(application/rdf+xml) content type . After debugging command line client the server

responses text/html response due to authentication was failed since I have not

provided the valid password in the command line client.

Thank you for you support. Have a nice day!

Best Regards,

Rajkumar
Previous Topic:Issue with Lyo Code Generator & Toolchain installation
Next Topic:[Polarion] Connection between OSLC-Server and Consumer
Goto Forum:
  


Current Time: Sat Nov 17 00:36:42 GMT 2018

Powered by FUDForum. Page generated in 0.07039 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top