You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2020/05/15 12:09:50 UTC
[deltaspike] branch master updated (e346e97 -> 19606ca)
This is an automated email from the ASF dual-hosted git repository.
struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/deltaspike.git.
from e346e97 DELTASPIKE-1405 upgrade to apache parent 23 and fix distribution
new 0cc4e03 use spaces instead of tabs
new 19606ca DELTASPIKE-1408 in some situations CDI.current() doesn't work in Weld3
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../core/api/config/base/CoreBaseConfig.java | 5 +++
.../core/api/provider/BeanManagerProvider.java | 12 ++++--
deltaspike/parent/code/pom.xml | 44 ++++++++++++----------
3 files changed, 38 insertions(+), 23 deletions(-)
[deltaspike] 02/02: DELTASPIKE-1408 in some situations
CDI.current() doesn't work in Weld3
Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/deltaspike.git
commit 19606ca588233676a6db64cb61b81f382014181d
Author: Mark Struberg <st...@apache.org>
AuthorDate: Fri May 15 14:09:05 2020 +0200
DELTASPIKE-1408 in some situations CDI.current() doesn't work in Weld3
So we try a fallback onto CDI-1.0 tricks to resolve the BeanManager.
---
.../deltaspike/core/api/config/base/CoreBaseConfig.java | 5 +++++
.../deltaspike/core/api/provider/BeanManagerProvider.java | 12 +++++++++---
deltaspike/parent/code/pom.xml | 8 ++++++--
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
index e988f57..313bb9b 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/base/CoreBaseConfig.java
@@ -26,6 +26,11 @@ public interface CoreBaseConfig extends DeltaSpikeBaseConfig
{
interface BeanManagerIntegration
{
+ /**
+ * Whether to use CDI.current() if available.
+ * This might fail in some CDI containers in some situations.
+ * Try switching to 'false' to enforce the 'old' DeltaSpike BeanManager lookup.
+ */
Boolean DELEGATE_LOOKUP =
ConfigResolver.resolve("deltaspike.bean-manager.delegate_lookup")
.as(Boolean.class)
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
index 117f13f..5897b59 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
@@ -186,7 +186,8 @@ public class BeanManagerProvider implements Extension
setBeanManagerProvider(this);
// CDI#current delegation enabled, skip everything
- if (CDI_CURRENT_METHOD != null && CDI_CURRENT_BEAN_MANAGER_METHOD != null)
+ if (CDI_CURRENT_METHOD != null && CDI_CURRENT_BEAN_MANAGER_METHOD != null &&
+ resolveBeanManagerViaStaticHelper() != null)
{
return;
}
@@ -208,7 +209,11 @@ public class BeanManagerProvider implements Extension
// CDI#current delegation enabled, skip everything
if (CDI_CURRENT_METHOD != null && CDI_CURRENT_BEAN_MANAGER_METHOD != null)
{
- return resolveBeanManagerViaStaticHelper();
+ BeanManager bm = resolveBeanManagerViaStaticHelper();
+ if (bm != null)
+ {
+ return bm;
+ }
}
BeanManagerInfo bmi = getBeanManagerInfo(ClassUtils.getClassLoader(null));
@@ -274,7 +279,8 @@ public class BeanManagerProvider implements Extension
public void cleanupFinalBeanManagers(@Observes AfterDeploymentValidation adv)
{
// CDI#current delegation enabled, skip everything
- if (CDI_CURRENT_METHOD != null && CDI_CURRENT_BEAN_MANAGER_METHOD != null)
+ if (CDI_CURRENT_METHOD != null && CDI_CURRENT_BEAN_MANAGER_METHOD != null &&
+ resolveBeanManagerViaStaticHelper() != null)
{
return;
}
diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml
index c807d77..4a10e2b 100644
--- a/deltaspike/parent/code/pom.xml
+++ b/deltaspike/parent/code/pom.xml
@@ -695,7 +695,7 @@
<properties>
<!-- Actual Weld version used with this profile -->
- <weld.version>3.0.4.Final</weld.version>
+ <weld.version>3.1.3.Final</weld.version>
<cdicontainer.version>weld-${weld.version}</cdicontainer.version>
</properties>
@@ -753,7 +753,11 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-api</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
+ </dependency>
+
<!--Other than Weld dependencies-->
<dependency>
<groupId>javax.el</groupId>
[deltaspike] 01/02: use spaces instead of tabs
Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/deltaspike.git
commit 0cc4e034a3158ebfc319070688e890dd529e6f72
Author: Mark Struberg <st...@apache.org>
AuthorDate: Fri May 15 08:06:00 2020 +0200
use spaces instead of tabs
---
deltaspike/parent/code/pom.xml | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml
index d1afb08..c807d77 100644
--- a/deltaspike/parent/code/pom.xml
+++ b/deltaspike/parent/code/pom.xml
@@ -41,7 +41,7 @@
<version.activation>1.1.1</version.activation>
<version.annotation>1.3.2</version.annotation>
<bval.artifactId>bval-jsr303</bval.artifactId>
- <validation.artifactId>geronimo-validation_1.0_spec</validation.artifactId>
+ <validation.artifactId>geronimo-validation_1.0_spec</validation.artifactId>
<jboss.as.version>7.1.1.Final</jboss.as.version>
<wildfly.version>10.1.0.Final</wildfly.version>
<wildfly.arquillian.version>1.0.2.Final</wildfly.arquillian.version>
@@ -72,7 +72,7 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
-
+
<!-- Preparation for Java 9+, include a dependency on the JAXB APIs -->
<dependency>
<groupId>javax.xml.bind</groupId>
@@ -183,13 +183,13 @@
<jdk>[1.9,)</jdk>
</activation>
<properties>
- <!-- Need newer implementations to be able to run on Java9+ -->
+ <!-- Need newer implementations to be able to run on Java9+ -->
<bval.artifactId>bval-jsr</bval.artifactId>
- <validation.artifactId>geronimo-validation_1.1_spec</validation.artifactId>
- <hibernate.validator.version>6.0.17.Final</hibernate.validator.version>
+ <validation.artifactId>geronimo-validation_1.1_spec</validation.artifactId>
+ <hibernate.validator.version>6.0.17.Final</hibernate.validator.version>
</properties>
</profile>
-
+
<profile>
<!-- use this profile to compile and test DeltaSpike with Apache OpenWebBeans -->
<id>OWB</id>
@@ -260,10 +260,10 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>${validation.artifactId}</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>${validation.artifactId}</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>${bval.artifactId}</artifactId>
@@ -360,10 +360,10 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>${validation.artifactId}</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>${validation.artifactId}</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>${bval.artifactId}</artifactId>
@@ -466,10 +466,10 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>${validation.artifactId}</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>${validation.artifactId}</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>${bval.artifactId}</artifactId>