[jira] [Commented] (TOMEE-2100) Jax-RS Providers are ordered by ?hashcode? instead of priority
[ https://issues.apache.org/jira/browse/TOMEE-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16102212#comment-16102212 ] ASF GitHub Bot commented on TOMEE-2100: --- GitHub user jgallimore opened a pull request: https://github.com/apache/tomee/pull/96 TOMEE-2100 add @Priority to default sorting This creates a default comparator when no setting for cxf.jaxrs.provider-comparator is specified. This will order by priority first, but will still incorporate the default CXF sorting where priorities are the same for backwards compatibility. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jgallimore/tomee tomee-2100 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tomee/pull/96.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #96 commit a72f6d34b8bcd5740c976b4b2333268a6f5cfade Author: Jonathan GallimoreDate: 2017-07-26T15:15:13Z TOMEE-2100 add @Priority to default sorting > Jax-RS Providers are ordered by ?hashcode? instead of priority > -- > > Key: TOMEE-2100 > URL: https://issues.apache.org/jira/browse/TOMEE-2100 > Project: TomEE > Issue Type: New Feature > Components: TomEE Core Server >Affects Versions: 7.0.3 >Reporter: TURPIN Michel > Labels: features > Attachments: tomee-priority.zip > > > When multiple providers share the same possible tasks, their priority is not > taken into consideration when it comes to choose the effective > implementation. This would allow effective overriding of providers, for > instance using Jackson instead of Johnzon as a writer/reader. > The attached zip contains a project with 5 body writers with differents > priorities. You may run it with the {{mvn clean package tomee:run}} command. > The {{FooResource}} class is then accessible through the > {{http://localhost:8080/tomee-priority/resources/foo/}} URL. It must show "B". > As I run it, it shows me "D", you might have different values. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
tomee git commit: ignore @EjbModule in previous commit logic
Repository: tomee Updated Branches: refs/heads/master bdbc90564 -> c54c0eaf5 ignore @EjbModule in previous commit logic Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c54c0eaf Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c54c0eaf Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c54c0eaf Branch: refs/heads/master Commit: c54c0eaf565bd9bec46aa386c6767e4fd2224b59 Parents: bdbc905 Author: Romain Manni-BucauAuthored: Wed Jul 26 18:09:27 2017 +0200 Committer: Romain Manni-Bucau Committed: Wed Jul 26 18:09:27 2017 +0200 -- .../src/main/java/org/apache/tomee/embedded/Container.java| 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tomee/blob/c54c0eaf/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java -- diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java index 3ed2737..cb745a3 100644 --- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java +++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java @@ -42,6 +42,7 @@ import org.apache.openejb.assembler.classic.Assembler; import org.apache.openejb.assembler.classic.BeansInfo; import org.apache.openejb.assembler.classic.EjbJarInfo; import org.apache.openejb.assembler.classic.EnterpriseBeanInfo; +import org.apache.openejb.assembler.classic.ManagedBeanInfo; import org.apache.openejb.assembler.classic.WebAppInfo; import org.apache.openejb.config.AnnotationDeployer; import org.apache.openejb.config.AppModule; @@ -890,6 +891,12 @@ public class Container implements AutoCloseable { appInfo = configurationFactory.configureApplication(file); // ensure to activate CDI for classpath deployment, we can desire to move it but it breaks less apps this way for (final EjbJarInfo jar : appInfo.ejbJars) { +if (jar.enterpriseBeans.size() == 1) { +final EnterpriseBeanInfo next = jar.enterpriseBeans.iterator().next(); +if (ManagedBeanInfo.class.isInstance(next) && ManagedBeanInfo.class.cast(next).hidden) { +continue; +} +} if (jar.beans == null) { if (!jar.enterpriseBeans.isEmpty()) { jar.beans = new BeansInfo();
[jira] [Commented] (TOMEE-2103) [Embedded TomEE] CDI should be enabled by default
[ https://issues.apache.org/jira/browse/TOMEE-2103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16101741#comment-16101741 ] Romain Manni-Bucau commented on TOMEE-2103: --- Hi Svetlin, yes, it was to avoid to breaks apps not working in a CDI context (ambiguous injections etc). CDI hasn't been backward compat here :(. > [Embedded TomEE] CDI should be enabled by default > - > > Key: TOMEE-2103 > URL: https://issues.apache.org/jira/browse/TOMEE-2103 > Project: TomEE > Issue Type: Bug >Reporter: Svetlin Zarev > Attachments: org.example.zip > > > Since JavaEE7 CDI should be enabled by default (i.e. it should not require > beans.xml) > Expected output of the attached app (or when beans.xml is present): > {code} > AroundConstruct: before > constructor > AroundConstruct: after > post-construct > AroundInvoke: before > work > AroundInvoke: after > {code} > Actual output: > {code} > constructor > post-construct > AroundInvoke: before > work > AroundInvoke: after > {code} > As you can see the @AroundConstruct is not invoked. This happens only in the > case of embedded tomee -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (TOMEE-2103) [Embedded TomEE] CDI should be enabled by default
[ https://issues.apache.org/jira/browse/TOMEE-2103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16101701#comment-16101701 ] Svetlin Zarev commented on TOMEE-2103: -- This happens because DeploymentLoader::discoverModuleType classifies the app as EjbModule, but (default, empty) beans.xml is added (to altDD) only if the app is classified either as WebModule or AppModule. > [Embedded TomEE] CDI should be enabled by default > - > > Key: TOMEE-2103 > URL: https://issues.apache.org/jira/browse/TOMEE-2103 > Project: TomEE > Issue Type: Bug >Reporter: Svetlin Zarev > Attachments: org.example.zip > > > Since JavaEE7 CDI should be enabled by default (i.e. it should not require > beans.xml) > Expected output of the attached app (or when beans.xml is present): > {code} > AroundConstruct: before > constructor > AroundConstruct: after > post-construct > AroundInvoke: before > work > AroundInvoke: after > {code} > Actual output: > {code} > constructor > post-construct > AroundInvoke: before > work > AroundInvoke: after > {code} > As you can see the @AroundConstruct is not invoked. This happens only in the > case of embedded tomee -- This message was sent by Atlassian JIRA (v6.4.14#64029)
tomee git commit: TOMEE-2103 forcing annotated mode by default with tomee embedded
Repository: tomee Updated Branches: refs/heads/master cf5ed054f -> bdbc90564 TOMEE-2103 forcing annotated mode by default with tomee embedded Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/bdbc9056 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/bdbc9056 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/bdbc9056 Branch: refs/heads/master Commit: bdbc90564fb5b69b80d93313806c1f5c0bee3461 Parents: cf5ed05 Author: Romain Manni-BucauAuthored: Wed Jul 26 14:32:07 2017 +0200 Committer: Romain Manni-Bucau Committed: Wed Jul 26 14:33:02 2017 +0200 -- .../org/apache/tomee/embedded/Container.java| 21 1 file changed, 21 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tomee/blob/bdbc9056/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java -- diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java index 06c9290..3ed2737 100644 --- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java +++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java @@ -39,6 +39,7 @@ import org.apache.openejb.UndeployException; import org.apache.openejb.assembler.WebAppDeployer; import org.apache.openejb.assembler.classic.AppInfo; import org.apache.openejb.assembler.classic.Assembler; +import org.apache.openejb.assembler.classic.BeansInfo; import org.apache.openejb.assembler.classic.EjbJarInfo; import org.apache.openejb.assembler.classic.EnterpriseBeanInfo; import org.apache.openejb.assembler.classic.WebAppInfo; @@ -887,6 +888,26 @@ public class Container implements AutoCloseable { } } else { appInfo = configurationFactory.configureApplication(file); +// ensure to activate CDI for classpath deployment, we can desire to move it but it breaks less apps this way +for (final EjbJarInfo jar : appInfo.ejbJars) { +if (jar.beans == null) { +if (!jar.enterpriseBeans.isEmpty()) { +jar.beans = new BeansInfo(); +jar.beans.version = "1.1"; +jar.beans.discoveryMode = "annotated"; +final BeansInfo.BDAInfo info = new BeansInfo.BDAInfo(); +info.discoveryMode = "annotated"; +info.uri = jar.moduleUri; +jar.beans.noDescriptorBdas.add(info); +for (final EnterpriseBeanInfo bean : jar.enterpriseBeans) { +if (bean.ejbClass == null) { +continue; +} +info.managedClasses.add(bean.ejbClass); +} +} +} +} if (overrideName) { appInfo.appId = name; for (final EjbJarInfo ejbJar : appInfo.ejbJars) {
[jira] [Created] (TOMEE-2103) [Embedded TomEE] CDI should be enabled by default
Svetlin Zarev created TOMEE-2103: Summary: [Embedded TomEE] CDI should be enabled by default Key: TOMEE-2103 URL: https://issues.apache.org/jira/browse/TOMEE-2103 Project: TomEE Issue Type: Bug Reporter: Svetlin Zarev Attachments: org.example.zip Since JavaEE7 CDI should be enabled by default (i.e. it should not require beans.xml) Expected output of the attached app (or when beans.xml is present): {code} AroundConstruct: before constructor AroundConstruct: after post-construct AroundInvoke: before work AroundInvoke: after {code} Actual output: {code} constructor post-construct AroundInvoke: before work AroundInvoke: after {code} As you can see the @AroundConstruct is not invoked. This happens only in the case of embedded tomee -- This message was sent by Atlassian JIRA (v6.4.14#64029)