[jbosstools-dev] Question about JBoss Tools Validation trigger

Alexey Kazakov akazakov at exadel.com
Thu Oct 18 15:58:49 EDT 2012


Hi Xavier,

How do you build JAX-RS model? Is there any builder for that?
Common validator manager is invoked by WST validation builder. So if you 
use some builder for JAX-RS then make sure it's added to .project before 
WST validation builder. BTW our common validation framework can help you 
to validate the order of the builders.
If you don't use some builder for building JAX-RS model then you have to 
build it in your validator.


On 10/18/2012 06:42 AM, Xavier Coulon wrote:
> Hello,
>
> I'm facing an issue here (https://issues.jboss.org/browse/JBIDE-12690) 
> which basically says that the imported project is not correctly 
> validated. It has JAX-RS errors but nothing is reported after the 
> import operation.
>
> In my console logs, I have the following traces:
>
> 14:43:13.714 [Worker-9] Building JAX-RS Metamodel after Java element 
> changed...
> 14:43:13.715 [Worker-9] Some java elements changed:[PostChange]
> 14:43:13.715 [Worker-9] **rejected** JavaElementDelta [PostChange] 
> JavaModel '' [*without* AST] changed:{Children}]
> 14:43:13.715 [Worker-9] **rejected** JavaElementDelta [PostChange] 
> JavaProject 'jboss-richfaces-webapp' [*without* AST] changed:{Content}]
> 14:43:13.715 [Worker-9] Processing 0 change(s)...
> 14:43:13.715 [Worker-9] Done processing Java changes.
> 14:43:14.721 [Worker-1] *** Validating all JAX-RS elements in project 
> jboss-richfaces-webapp ***
> 14:43:14.731 [Worker-1] Validation done.
> ...
> ...
> ...
> !MESSAGE Building JAX-RS metamodel for project jboss-richfaces-webapp
> 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]
> 14:43:24.704 [Worker-0] Building JAX-RS Metamodel after resource 
> changed...
> 14:43:24.713 [Worker-0] JAX-RS Metamodel created for project 
> jboss-richfaces-webapp
> 14:43:24.717 [Worker-0] Processing project 'jboss-richfaces-webapp'...
> 14:43:24.718 [Worker-0] Processing ResourceChangedEvent [Project 
> '/jboss-richfaces-webapp' added]
> 14:43:27.686 [Worker-0] Indexing JavaApplication 'JaxRsActivator': 
> path=/rest
> 14:43:27.797 [Worker-0] Indexing Resource 'MemberResourceRESTService' 
> (root=true)
> 14:43:27.800 [Worker-0] Indexing ResourceMethod 
> 'MemberResourceRESTService.lookupMemberById' (SUBRESOURCE_METHOD)
> 14:43:27.801 [Worker-0] Indexing ResourceMethod 
> 'MemberResourceRESTService.createMember' (RESOURCE_METHOD)
> 14:43:27.801 [Worker-0] Indexing ResourceMethod 
> 'MemberResourceRESTService.listAllMembers' (RESOURCE_METHOD)
> 14:43:27.802 [Worker-0] Resulting event: JaxrsElementChange: 
> [Application Added] JaxRsActivator
> 14:43:27.803 [Worker-0] Resulting event: JaxrsElementChange: [Resource 
> Added] MemberResourceRESTService
> 14:43:27.806 [Worker-0] Processing ResourceChangedEvent [File 
> '/jboss-richfaces-webapp/src/main/webapp/WEB-INF/web.xml' added]
> 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'
> 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'
> 14:43:27.911 [Worker-0] Done processing resource results.
> 14:43:27.911 [Worker-0] Processing 2 JAX-RS element change(s)...
> 14:43:27.911 [Worker-0] Processing JaxrsElementChange: [Application 
> Added] JaxRsActivator
> 14:43:27.911 [Worker-0] Processing JaxrsElementChange: [Resource 
> Added] MemberResourceRESTService
> 14:43:27.915 [Worker-0] --> JaxrsEndpointChange: [Added] GET 
> /rest/members/{id:[0-9][0-9]*} | consumes:[*/*] | 
> produces=[application/json] in method 
> MemberResourceRESTService.lookupMemberById(...)
> 14:43:27.915 [Worker-0] --> JaxrsEndpointChange: [Added] POST 
> /rest/members | consumes:[application/json] | 
> produces=[application/json] in method 
> MemberResourceRESTService.createMember(...)
> 14:43:27.915 [Worker-0] --> JaxrsEndpointChange: [Added] GET 
> /rest/members | consumes:[*/*] | produces=[application/json] in method 
> MemberResourceRESTService.listAllMembers(...)
> 14:43:27.915 [Worker-0] Done processing JAX-RS element change(s).
> 14:43:27.916 [Worker-0] *** Notifying the UI that JAX-RS metamodel was 
> Added (including 3 endpoint changes) ***
> 14:43:27.917 [Worker-0] JAX-RS Metamodel for project 
> 'jboss-richfaces-webapp' now has 6 HttpMethods, 1 Resources and 3 
> Endpoints.
> 14:43:28.136 [Worker-0] Validation done.
>
> 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... ***
> 14:45:11.719 [Worker-1] Validation done.
>
>
> 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.
> [moving a bit forward during the import operation -> some logs were 
> removed]
> 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.
> How could I trigger a 'validateAll' in this case ?
>
> Thanks
> Best regards,
>
> /Xavier
>
>
>
>
>
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20121018/58731b1e/attachment-0001.html 


More information about the jbosstools-dev mailing list