<div dir="ltr">
<p class="">What exception should I throw to prevent the deployment? I'm using the DeploymentUnitProcessingException that seems to allow the deployment to continue.</p><p class=""><br></p><p class="">08:56:08,487 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "WFLY-4169.jar" (runtime-name: "WFLY-4169.jar")</p>
<p class="">08:56:08,622 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."WFLY-4169.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."WFLY-4169.jar".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "WFLY-4169.jar"</p>
<p class=""><span class="">        </span>at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)</p>
<p class=""><span class="">        </span>at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)</p>
<p class=""><span class="">        </span>at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)</p>
<p class=""><span class="">        </span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</p>
<p class=""><span class="">        </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</p>
<p class=""><span class="">        </span>at java.lang.Thread.run(Thread.java:745)</p>
<p class="">Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEJB0468: Illegal Enterprise JavaBean annotation: javax.transaction.Transactional</p>
<p class=""><span class="">        </span>at org.jboss.as.ejb3.deployment.processors.ProhibitedEJBAnnotationsDeploymentUnitProcessor.deploy(ProhibitedEJBAnnotationsDeploymentUnitProcessor.java:52)</p>
<p class=""><span class="">        </span>at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)</p>
<p class=""><span class="">        </span>... 5 more</p>
<p class=""><br></p>
<p class="">08:56:08,654 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "WFLY-4169.jar")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"WFLY-4169.jar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"WFLY-4169.jar\".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment \"WFLY-4169.jar\"</p>
<p class=""> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEJB0468: Illegal Enterprise JavaBean annotation: javax.transaction.Transactional"}}</p>
<p class="">08:56:08,763 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed "WFLY-4169.jar" (runtime-name : "WFLY-4169.jar")</p>
<p class="">08:56:08,764 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report</p>
<p class="">WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."WFLY-4169.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."WFLY-4169.jar".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "WFLY-4169.jar"</p><p class=""><br></p></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-30 8:01 GMT-03:00 Eduardo Sant´Ana da Silva <span dir="ltr"><<a href="mailto:eduardo.santanadasilva@gmail.com" target="_blank">eduardo.santanadasilva@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok.</div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-29 19:16 GMT-03:00 Stuart Douglas <span dir="ltr"><<a href="mailto:stuart.w.douglas@gmail.com" target="_blank">stuart.w.douglas@gmail.com</a>></span>:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span>On Sun, 29 Mar 2015 at 21:34 Eduardo Sant´Ana da Silva <<a href="mailto:eduardo.santanadasilva@gmail.com" target="_blank">eduardo.santanadasilva@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<p>Ok,</p>
<p>My approach will be create the following classes:<br><br></p>
<p>* ProhibitedEJBAnnotationsAnnotationMarker - Mark the deployment if it has EJB annotations that are not allowed (Similar to CDI Annotation marker no Weld)</p></div></blockquote><div><br></div></span><div>I don't really see why you would need to mark the deployment if it has invalid annotations, you should be able to just fail immediately. </div><div><br></div><div>I think all you need is a single DUP that looks at every EJB component description for this annotation, and if it is present throw an exception. </div><span><font color="#888888"><div><br></div><div>Stuart</div></font></span><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<p>* ProhibitedEJBAnnotationsDeploymentUnitProcessor - Do the deployment rollback in case of the marker is present.</p>
<p><br>Add the proper cleanup of the attachments no EjbCleanUpProcessor<br></p>
<p>Some auxilar classes to be created:<br></p>
<p><span>public</span><span> </span><span>enum</span><span> </span>ProhibitedEJBAnnotations<span> {</span><br></p>
<p> <span>/**<br></span> * javax.transaction.Transactional annotation.</p><p> */</p><p><span> </span>TRANSACTIONAL<span>(Constants.J</span>AVAX_TRANSACTION<span>, </span><span>"Transactional"</span><span>),</span></p>
<p>...<br></p>
<p> <span>private</span> <span>static</span> <span>class</span> Constants {<br></p>
<p> <span>/**<br></span> * package javax.transaction<br> */</p>
<p> <span>public</span> <span>static</span> <span>final</span> DotName <span>JAVAX_TRANSACTION</span> = DotName.createSimple(<span>"javax.transaction"</span>);</p>
<p>...</p>
<p>//////////////////////////////////////<br>/**<br> * Marker for deployments that have prohibited EJB annotations present<br> */</p>
<p><span>public</span> <span>final</span> <span>class</span> <span>ProhibitedEJBAnnotations</span>AnnotationMarker { (Similar to CdiAnnotationMarker on Weld)</p>
<p>...<br></p>
<p><span>public</span> <span>class</span> ProhibitedEJBAnnotationsDeploymentUnitProcessor <span>implements</span><br></p><p>DeploymentUnitProcessor {</p>
<p><br>If you guys came up with better names it will be good.<br></p><p>I was wondering as well if the CDIAnnotationMarker can be used directly from the Weld subsystem or it will be better isolate the subsystems?</p><p>Thx</p></div><div dir="ltr"><div style="font-size:12.8000001907349px"><span style="font-family:Arial;font-size:small">________________</span><span style="font-family:Arial;font-size:small">__________</span><br></div><div style="font-size:12.8000001907349px"><div align="left" style="font-family:Arial;font-size:small">Eduardo Sant'Ana da Silva </div></div></div><div dir="ltr"></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-28 15:05 GMT-03:00 Jason T. Greene <span dir="ltr"><<a href="mailto:jason.greene@redhat.com" target="_blank">jason.greene@redhat.com</a>></span>:</div></div><div class="gmail_extra"><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Good question. The easiest solution is probably to change one of the EJB dups that looks at annotations to also check for @Transactional and fail accordingly.</div><div><br>Sent from my iPhone</div><div><div><div><br>On Mar 28, 2015, at 11:56 AM, Eduardo Sant´Ana da Silva <<a href="mailto:eduardo.santanadasilva@gmail.com" target="_blank">eduardo.santanadasilva@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">
<p>I'm looking at this issue:<br><a href="https://issues.jboss.org/browse/WFLY-4169" target="_blank">https://issues.jboss.org/browse/WFLY-4169</a></p>
<p>In the ejb-3_2 specification :<br>It is illegal to associate JTA transactional interceptors (see [8]) with Enterprise JavaBeans. The EJB Container should fail deployment of such applications.[39]</p>
<p>@Transaction annotation was introduced in JTA 1.2, <br></p>
<p>As Narayana 5.0.0.M3 is now JTA 1.2 compliant, and it was introduced on Wildfly since version WildFly 8.0.0.Beta1, what should be done?<br></p>
<p>Because this restriction could be removed in the future versions:<br></p>
<p>[39] This restriction may be removed in a future release of this specification<br></p>
<p>If this is needed, how to proceed? Should be done on Weld subsystem, something similar with the annotations markers, just to log the problem or it will be more tricky, since the deployment should be rolled back (by the specification)?</p>-- <br><div><div dir="ltr"><div><span style="font-family:Arial;font-size:small">________________</span><span style="font-family:Arial;font-size:small">__________</span><br></div><div><div align="left" style="font-family:Arial;font-size:small">Eduardo Sant'Ana da Silva</div><div style="font-family:Arial;font-size:small"><br></div></div></div></div>
</div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>wildfly-dev mailing list</span><br><span><a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></span></div></blockquote></div></blockquote></div></div><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-family:Arial;font-size:small">________________</span><span style="font-family:Arial;font-size:small">__________</span><br></div><div><div align="left" style="font-family:Arial;font-size:small">Eduardo Sant'Ana da Silva - Dr.</div><div style="font-family:Arial;font-size:small"><font face="Arial">Pesquisador / Consultor de TI<br></font></div><div style="font-family:Arial;font-size:small"><br></div></div></div></div>
</div>
______________________________<u></u>_________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/wildfly-dev</a></blockquote></div></div></div></div>
</blockquote></div></div></div><div><div class="h5"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-family:Arial;font-size:small">________________</span><span style="font-family:Arial;font-size:small">__________</span><br></div><div><div align="left" style="font-family:Arial;font-size:small">Eduardo Sant'Ana da Silva - Dr.</div><div style="font-family:Arial;font-size:small"><font face="Arial">Pesquisador / Consultor de TI<br></font></div><div style="font-family:Arial;font-size:small"><br></div></div></div></div>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-family:Arial;font-size:small">________________</span><span style="font-family:Arial;font-size:small">__________</span><br></div><div><div align="left" style="font-family:Arial;font-size:small">Eduardo Sant'Ana da Silva - Dr.</div><div style="font-family:Arial;font-size:small"><font face="Arial">Pesquisador / Consultor de TI<br></font></div><div style="font-family:Arial;font-size:small"><br></div></div></div></div>
</div>