<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I'm facing an issue here (<a href="https://issues.jboss.org/browse/JBIDE-12690">https://issues.jboss.org/browse/JBIDE-12690</a>) which basically says that the imported project is not correctly validated. It has JAX-RS errors but nothing is reported after the import operation.</div><div><br></div><div>In my console logs, I have the following traces:</div><div><br></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.714 [Worker-9] Building JAX-RS Metamodel after Java element changed...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.715 [Worker-9] Some java elements changed:[PostChange]&nbsp;</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.715 [Worker-9] **rejected** JavaElementDelta [PostChange] JavaModel '' [*without* AST] changed:{Children}]</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.715 [Worker-9] **rejected** JavaElementDelta [PostChange] JavaProject 'jboss-richfaces-webapp' [*without* AST] changed:{Content}]</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.715 [Worker-9] Processing 0 change(s)...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:13.715 [Worker-9] Done processing Java changes.</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;" color="#b40f00">14:43:14.721 [Worker-1] *** Validating all JAX-RS elements in project jboss-richfaces-webapp ***</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:14.731 [Worker-1] Validation done.</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">!MESSAGE Building JAX-RS metamodel for project jboss-richfaces-webapp</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:24.703 [Worker-11] Initiating a JAX-RS Metamodel build on project 'jboss-richfaces-webapp' after resource changed event org.eclipse.core.internal.events.ResourceChangeEvent[source=P/jboss-richfaces-webapp]</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:24.704 [Worker-0] Building JAX-RS Metamodel after resource changed...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:24.713 [Worker-0] JAX-RS Metamodel created for project jboss-richfaces-webapp</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:24.717 [Worker-0] Processing project 'jboss-richfaces-webapp'...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:24.718 [Worker-0] <font class="Apple-style-span" color="#4d7b2e">Processing ResourceChangedEvent [Project '/jboss-richfaces-webapp' added]</font></font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.686 [Worker-0] Indexing JavaApplication 'JaxRsActivator': path=/rest</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.797 [Worker-0] Indexing Resource 'MemberResourceRESTService' (root=true)&nbsp;</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.800 [Worker-0] Indexing ResourceMethod 'MemberResourceRESTService.lookupMemberById' (SUBRESOURCE_METHOD)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.801 [Worker-0] Indexing ResourceMethod 'MemberResourceRESTService.createMember' (RESOURCE_METHOD)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.801 [Worker-0] Indexing ResourceMethod 'MemberResourceRESTService.listAllMembers' (RESOURCE_METHOD)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.802 [Worker-0] Resulting event: JaxrsElementChange: [Application Added] JaxRsActivator</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.803 [Worker-0] Resulting event: JaxrsElementChange: [Resource Added] MemberResourceRESTService</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.806 [Worker-0] Processing ResourceChangedEvent [File '/jboss-richfaces-webapp/src/main/webapp/WEB-INF/web.xml' added]</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.902 [Worker-0] No servlet mapping found for class 'org.jboss.tools.example.richfaces.rest.JaxRsActivator' in file 'src/main/webapp/WEB-INF/web.xml'</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.911 [Worker-0] No servlet mapping found for class 'javax.ws.rs.core.Application' in file 'src/main/webapp/WEB-INF/web.xml'</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.911 [Worker-0] Done processing resource results.</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.911 [Worker-0] Processing 2 JAX-RS element change(s)...</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.911 [Worker-0] Processing JaxrsElementChange: [Application Added] JaxRsActivator</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.911 [Worker-0] Processing JaxrsElementChange: [Resource Added] MemberResourceRESTService</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.915 [Worker-0] --&gt; JaxrsEndpointChange: [Added] GET /rest/members/{id:[0-9][0-9]*} | consumes:[*/*] | produces=[application/json] in method MemberResourceRESTService.lookupMemberById(...)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.915 [Worker-0] --&gt; JaxrsEndpointChange: [Added] POST /rest/members | consumes:[application/json] | produces=[application/json] in method MemberResourceRESTService.createMember(...)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.915 [Worker-0] --&gt; JaxrsEndpointChange: [Added] GET /rest/members | consumes:[*/*] | produces=[application/json] in method MemberResourceRESTService.listAllMembers(...)</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.915 [Worker-0] Done processing JAX-RS element change(s).</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.916 [Worker-0] *** Notifying the UI that JAX-RS metamodel was Added (including 3 endpoint changes) ***</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:27.917 [Worker-0] JAX-RS Metamodel for project 'jboss-richfaces-webapp' now has 6 HttpMethods, 1 Resources and 3 Endpoints.</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:43:28.136 [Worker-0] Validation done.</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;"><br></font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;" color="#ff3816">14:44:59.105 [Worker-1] *** Validating some JAX-RS elements bound to files [L/jboss-richfaces-webapp/target/test-classes/arquillian.xml, L/jboss-richfaces-webapp/target/test-classes/META-INF/test-persistence.xml, L/jboss-richfaces-webapp/target/test-classes/test-ds.xml] that just changed in project jboss-richfaces-webapp... ***</font></div><div><font class="Apple-style-span" face="'Courier New'" style="font-size: 11px;">14:45:11.719 [Worker-1] Validation done.</font></div><div><br></div><div><br></div><div>The problem I've spotted is that the JAX-RS validator is called twice: the first time to validate *all* the JAX-RS elements, but this call occurs *before* the JAX-RS metamodel was built, because none of the events that were caught by the listener in the plugin were 'eligible' to build the JAX-RS metamodel.&nbsp;</div><div>[moving a bit forward during the import operation -&gt; some logs were removed]</div><div>Then, once the listener caught a "ResourceChangedEvent" about the ADDED project, the JAX-RS metamodel is built, but the validator is called for only a couple of .xml files that changed, not the whole project that was imported.</div><div>How could I trigger a 'validateAll' in this case ?</div><div><br></div><div>Thanks</div><div>Best regards,</div><div><br><div apple-content-edited="true">
/Xavier<br><br><br>
</div>
<br></div></body></html>