<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Tuto jaxrs [SOLVED] in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326012#M13013</link>
    <description>&lt;P&gt;it's weird: on a nuxeo project compliant (made by CLI), webengine is ok.
But in the project i m working on, nothing happened with webengine. The problem is probably the deployment of the application and module (a pack war)&lt;/P&gt;
&lt;P&gt;EDIT&amp;gt; Yeah, it was a deployment problem. A jar was not include in the final package. A build instruction in the bundle POM was forgotten because of the use of the CLI.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2018 12:07:19 GMT</pubDate>
    <dc:creator>kyle_totoro</dc:creator>
    <dc:date>2018-07-10T12:07:19Z</dc:date>
    <item>
      <title>Tuto jaxrs [SOLVED]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326010#M13011</link>
      <description>&lt;HR /&gt;
&lt;P&gt;Problem solved: check answer&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;i am following the tutorial for jaxrs in order to make a webengine application.
But, for the moment, i experiment a crash after having following the nuxeo tutorial for jaxrs:
&lt;A href="https://doc.nuxeo.com/810/nxdoc/webengine-jax-rs/" target="test_blank"&gt;https://doc.nuxeo.com/810/nxdoc/webengine-jax-rs/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;i get an error 500 after trying the test url:
&lt;CODE&gt;{"entity-type":"exception","code":"com.sun.jersey.api.NotFoundException","status":500,"message":"null for uri: &lt;A href="http://localhost:8080/nuxeo/site/mysite&amp;quot;}" target="test_blank"&gt;http://localhost:8080/nuxeo/site/mysite"}&lt;/A&gt;&lt;/CODE&gt; EDIT&amp;gt; This error was because the bundle with jaxrs was not déclared in another bundle used for compiling. But, now, there is another error, see next answer to this post.&lt;/P&gt;
&lt;P&gt;The tomcat Log show that:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;WARNING: A HTTP GET method, public java.lang.String org.nuxeo.elasticsearch.http.readonly.Main.searchWithPayload(java.lang.String,javax.ws.rs.core.UriInfo,javax.ws.rs.core.MultivaluedMap) throws java.io.IOException,org.json.JSONException, should not consume any entity.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I show you my files:
&lt;EM&gt;MyWebApp.java&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-java"&gt;import javax.ws.rs.core.Application;
import java.util.HashSet;
import java.util.Set;

public class MyWebApp extends Application { 
   @Override    
   public Set&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt; getClasses() {
        HashSet&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt; result = new HashSet&amp;lt;Class&amp;lt;?&amp;gt;&amp;gt;(); 
       result.add(MyWebAppRoot.class);        
	return result;    }}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;MyWebAppRoot.java&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-java"&gt;import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("mysite")
public class MyWebAppRoot {
    @GET    
    public Object doGet() {       
	 return "Hello World!";   
 }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;MANIFEST.MF&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Manifest-Version: 1.0
Bundle-ManifestVersion: 8.10
Bundle-Name: xxx.webengine
Bundle-SymbolicName: xxx.webengine;singleton:=true
Nuxeo-WebModule: xxx.webengine.MyWebApp
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;pom.xm&lt;/STRONG&gt;l of the bundle&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 &lt;A href="http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;" target="test_blank"&gt;http://maven.apache.org/xsd/maven-4.0.0.xsd"&amp;gt;&lt;/A&gt;;    
&amp;lt;parent&amp;gt; 
 &amp;lt;artifactId&amp;gt;xxx&amp;lt;/artifactId&amp;gt;
  &amp;lt;groupId&amp;gt;fr.xxxxxx.xxxc&amp;lt;/groupId&amp;gt;       
  &amp;lt;version&amp;gt;2.0.0-SNAPSHOT&amp;lt;/version&amp;gt;
  &amp;lt;relativePath&amp;gt;../pom.xml&amp;lt;/relativePath&amp;gt;
&amp;lt;/parent&amp;gt;   
&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;    
&amp;lt;artifactId&amp;gt;fr.xxxxx.xxxx.webengine&amp;lt;/artifactId&amp;gt;
&amp;lt;name&amp;gt;webengine test&amp;lt;/name&amp;gt;
&amp;lt;dependencies&amp;gt; 
	&amp;lt;!-- &lt;A href="https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api" target="test_blank"&gt;https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api&lt;/A&gt; 
	EDIT&amp;gt;&amp;gt;&amp;gt; The use of this dependency was a bad idea... check answer...--&amp;gt;
	&amp;lt;dependency&amp;gt;  
	  &amp;lt;groupId&amp;gt;javax.ws.rs&amp;lt;/groupId&amp;gt;  
	  &amp;lt;artifactId&amp;gt;javax.ws.rs-api&amp;lt;/artifactId&amp;gt;  
	  &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt; 
	&amp;lt;/dependency&amp;gt;      
	&amp;lt;!-- &lt;A href="https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util" target="test_blank"&gt;https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util&lt;/A&gt; --&amp;gt;  
	&amp;lt;dependency&amp;gt;  
	  &amp;lt;groupId&amp;gt;org.eclipse.jetty&amp;lt;/groupId&amp;gt; 
	  &amp;lt;artifactId&amp;gt;jetty-util&amp;lt;/artifactId&amp;gt;  
	  &amp;lt;version&amp;gt;9.4.11.v20180605&amp;lt;/version&amp;gt; 
	&amp;lt;/dependency&amp;gt; 
	&amp;lt;dependency&amp;gt;          
	  &amp;lt;groupId&amp;gt;org.nuxeo.ecm.webengine&amp;lt;/groupId&amp;gt; 
	  &amp;lt;artifactId&amp;gt;nuxeo-webengine-core&amp;lt;/artifactId&amp;gt; 
	&amp;lt;/dependency&amp;gt;        
	&amp;lt;dependency&amp;gt;  
	  &amp;lt;groupId&amp;gt;org.jboss.seam&amp;lt;/groupId&amp;gt; 
	  &amp;lt;artifactId&amp;gt;jboss-seam&amp;lt;/artifactId&amp;gt; 
	&amp;lt;/dependency&amp;gt;  
&amp;lt;/dependencies&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One mistake could be on the maven declaration of the bundle i have created. As i am beginner with maven, i have to improve my level. In the meanwhile,&lt;/P&gt;
&lt;H3&gt;if you have a project with a webengine /jaxrs, it could helps me.&lt;/H3&gt;
&lt;H3&gt;thanks&lt;/H3&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:57:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326010#M13011</guid>
      <dc:creator>kyle_totoro</dc:creator>
      <dc:date>2018-06-21T14:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Tuto jaxrs [SOLVED]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326011#M13012</link>
      <description>&lt;P&gt;i try to touch on maven pom to declare my bundle in another bundle used for compiling project bundle and the error is now:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;On browser page** localhost:8080/nuxeo/site/mysite**: # Etat HTTP 500 - org.apache.jasper.JasperException: An exception occurred processing JSP page /nuxeo_error.jsp at line 120&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Server.log&lt;/STRONG&gt;:  ERROR [http-apr-8080-exec-1] [org.nuxeo.ecm.platform.web.common.exceptionhandling.DefaultNuxeoExceptionHandler] javax.servlet.ServletException: On requestURL: &lt;A href="http://localhost:8080/nuxeo/site/mysite" target="test_blank"&gt;http://localhost:8080/nuxeo/site/mysite&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE&gt;
 On requestURL: &lt;A href="http://localhost:8080/nuxeo/site/mysite" target="test_blank"&gt;http://localhost:8080/nuxeo/site/mysite&lt;/A&gt;
 	at org.nuxeo.ecm.platform.ui.web.rest.FancyURLFilter.doFilter(FancyURLFilter.java:140)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter.doFilter(NuxeoRequestControllerFilter.java:146)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;2018-07-09 11:34:03,865 ERROR [http-apr-8080-exec-1] [nuxeo-error-log] 
Request Attributes:

	NuxeoExceptionHandlerMarker : true
	org.nuxeo.ecm.login.context : javax.security.auth.login.LoginContext@6a77657
	messageBundle : java.util.PropertyResourceBundle@8a88c34
	nuxeo.disable.redirect.wrapper : true
	user_message : An unexpected error occurred. Click on the following links to get more information or go back to the application.
	com.sun.faces.context.ExternalContextFactoryImpl_KEY : com.sun.faces.context.ExternalContextImpl@14535fdd
	exception_message : javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
	securityError : false


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for now, i think i am in a dead-end (cul-de-sac) for the project i m working on.&lt;/P&gt;
&lt;P&gt;I could try the same addon jaxrs on a training project more nuxeo compliant with its architecture. Don't know where is the problem. Maybe the manifest.MF.&lt;/P&gt;
&lt;P&gt;I investigate a new led: i quite sure the pom of the bundle need some dependency to make ok this jaxrs hello world.
i ve added:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;javax.ws.rs&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;javax.ws.rs-api&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it doesn't work and i have verified that &lt;STRONG&gt;without this dependency, the webengine on this url nuxeo/site is ok but the url nuxeo/site/mysite made a 404&lt;/STRONG&gt;.
As soon as i add this dependency, all webengine page go down with error i have showed before.&lt;/P&gt;
&lt;P&gt;EDIT&amp;gt; NEVER import the javax.ws.rs for the Webengine. Use instead com.sun.jersey.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 10:19:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326011#M13012</guid>
      <dc:creator>kyle_totoro</dc:creator>
      <dc:date>2018-07-03T10:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Tuto jaxrs [SOLVED]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326012#M13013</link>
      <description>&lt;P&gt;it's weird: on a nuxeo project compliant (made by CLI), webengine is ok.
But in the project i m working on, nothing happened with webengine. The problem is probably the deployment of the application and module (a pack war)&lt;/P&gt;
&lt;P&gt;EDIT&amp;gt; Yeah, it was a deployment problem. A jar was not include in the final package. A build instruction in the bundle POM was forgotten because of the use of the CLI.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:07:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/tuto-jaxrs-solved/m-p/326012#M13013</guid>
      <dc:creator>kyle_totoro</dc:creator>
      <dc:date>2018-07-10T12:07:19Z</dc:date>
    </item>
  </channel>
</rss>

