--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/feb4210a-d8a7-49d8-908f-352a8a2c5aa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/577f9128-2ec6-43ee-9c3a-9980a7b03b6e%40googlegroups.com.
Hi Nicolas,Here are some details about the three rules I listed. Other checks I have are really specific to our context or can only be done on produced deliverables (war / ear).- src/main/resources/META-INF/ejb-jar.xml must exist if project is an ejb project -> Rationale : EJB3 default interceptors must be declared in this file (https://docs.jboss.org/ejb3/app-server/tutorial/interceptor/interceptor.html) So if you plan to use them you must have an ejb-jar.xml file (if you have no custom default interceptor you need no ejb-jar.xml)
- Default interceptor XYZ must be declared in ejb-jar.xml (EJB name pattern, default interceptor class) -> Rationale : allows to check all default interceptors that must be activated for the ejb project. This check has a cardinality = Cardinality.MULTIPLE
- interceptor exclusions must be declared as Java annotations -> Rationale : exclusions for the default interceptor can be declared as annotations or directly in ejb-jar.xml file. In order to simplify code review, avoid issues due to refactoring, and make sure that code behavior is not modified through configuration, we forbid XML-based exclusions
- Non serializable type in remote service method check -> Rationale : @Remote services interfaces must be callable from a remote VM, therefore parameters and return types of methods declared in a @Remote interface must implement java.io.Serializable or be primitive types.
I'd like to write up your rules as preparation for implementation but I have some questions (below):
We don't have a lot of (any!) experience with EJB apps. What marks an app as EJB other than the existence of ejb-jar.xml?
And is this rule meant primarily to catch mis-named ejb-jar.xml files or ones that are missing?
A couple questions here:* what makes an interceptor default?
* I guess you're looking for interceptors defined in other xml files? Defined via annotations & not included in the xml file?
interceptor-bindingsection of the ejb-jar.xml file. For instance in the web page above we may want to make sure that
<interceptor-class>org.jboss.tutorial.interceptor.bean.DefaultInterceptor</interceptor-class>is declared for
<ejb-name>*</ejb-name>(i.e. DefaultInterceptor class wil be executed for all (*) JEE beans.
This seems pretty straightforward. Would you mind supplying a noncompliant (xml) sample and a compliant (annotations) sample?
- Non serializable type in remote service method check -> Rationale : @Remote services interfaces must be callable from a remote VM, therefore parameters and return types of methods declared in a @Remote interface must implement java.io.Serializable or be primitive types.Here's the rule specification for this one: http://jira.sonarsource.com/browse/RSPEC-3276. Let me know if anything's off.
Ann
We don't have a lot of (any!) experience with EJB apps. What marks an app as EJB other than the existence of ejb-jar.xml?"ejb" packaging of pom.xml (we use Maven)
--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/cYQdBhf00eo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/26028a77-0001-4474-a0a2-85bb4dbf59c7%40googlegroups.com.