From 5d986abfb6ce010b80129cd687b134ff4a464384 Mon Sep 17 00:00:00 2001 From: Assistenza GS Date: Mon, 7 Oct 2019 10:23:43 +0200 Subject: [PATCH 1/2] Upgrade spring-flex-core to Java 8 version (remove JdkVersion class on check about Java version and alignment about method signature) --- spring-flex-core/pom.xml | 33 +-- .../flex/config/FlexConfigurationManager.java | 7 +- .../flex/http/AmfHttpMessageConverter.java | 7 + .../flex/security3/AntPathRequestMatcher.java | 2 +- .../flex/security3/EndpointInterceptor.java | 5 +- .../EndpointSecurityMetadataSource.java | 2 +- .../SecurityConfigurationPostProcessor.java | 9 +- .../security3/EndpointInterceptorTests.java | 6 +- .../EndpointSecurityIntegrationTests.java | 14 +- .../EndpointSecurityMetadataSourceTests.java | 2 +- .../LoginMessageInterceptorTests.java | 4 +- .../SpringSecurityLoginCommandTests.java | 24 +- .../test/resources/custom-services-config.xml | 51 ++-- .../flex/config/security-context.xml | 4 +- .../flex/config/services-config.xml | 180 +++++++------- .../flex/core/services-config-4.6.xml | 22 ++ .../flex/core/services-config.xml | 192 ++++++++------- .../test/resources/custom-services-config.xml | 15 ++ .../hibernate3/config/services-config.xml | 158 +++++++------ .../hibernate3/core/services-config-4.6.xml | 22 ++ .../flex/hibernate3/core/services-config.xml | 22 ++ .../test/resources/custom-services-config.xml | 37 ++- .../hibernate4/config/services-config.xml | 22 ++ .../hibernate4/core/services-config-4.6.xml | 22 ++ .../flex/hibernate4/core/services-config.xml | 22 ++ .../webapp/WEB-INF/flex/services-config.xml | 31 +++ spring-flex-parent/pom.xml | 51 ++-- .../webapp/WEB-INF/flex/services-config.xml | 219 ++++++++++-------- 28 files changed, 758 insertions(+), 427 deletions(-) diff --git a/spring-flex-core/pom.xml b/spring-flex-core/pom.xml index 6206a0d6..57d3f13b 100644 --- a/spring-flex-core/pom.xml +++ b/spring-flex-core/pom.xml @@ -53,6 +53,7 @@ javax.servlet javax.servlet-api + 3.1.0 javax.annotation @@ -94,22 +95,22 @@ org.springframework spring-webmvc - - com.adobe.blazeds - blazeds-core - - - com.adobe.blazeds - blazeds-common - - - com.adobe.blazeds - blazeds-proxy - - - com.adobe.blazeds - blazeds-remoting - + + org.apache.flex.blazeds + flex-messaging-core + + + org.apache.flex.blazeds + flex-messaging-common + + + org.apache.flex.blazeds + flex-messaging-proxy + + + org.apache.flex.blazeds + flex-messaging-remoting + javax.jms jms-api diff --git a/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java b/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java index 59ebe2e6..20067be9 100755 --- a/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java +++ b/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java @@ -36,7 +36,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.ResourceLoaderAware; -import org.springframework.core.JdkVersion; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.ResourcePatternResolver; @@ -98,7 +97,11 @@ public FlexConfigurationManager(ResourceLoader resourceLoader, String configurat */ @SuppressWarnings("unchecked") public MessagingConfiguration getMessagingConfiguration(ServletConfig servletConfig) { - Assert.isTrue(JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_15, "Spring BlazeDS Integration requires a minimum of Java 1.5"); + String[] javaVersionElements = System.getProperty("java.version").split("\\."); + int major = Integer.parseInt(javaVersionElements[1]); + + Assert.isTrue(major >= 5, "Spring BlazeDS Integration requires a minimum of Java 1.5"); + Assert.notNull(servletConfig, "FlexConfigurationManager requires a non-null ServletConfig - " + "Is it being used outside a WebApplicationContext?"); diff --git a/spring-flex-core/src/main/java/org/springframework/flex/http/AmfHttpMessageConverter.java b/spring-flex-core/src/main/java/org/springframework/flex/http/AmfHttpMessageConverter.java index 0016c3e6..3770ad5f 100644 --- a/spring-flex-core/src/main/java/org/springframework/flex/http/AmfHttpMessageConverter.java +++ b/spring-flex-core/src/main/java/org/springframework/flex/http/AmfHttpMessageConverter.java @@ -41,6 +41,7 @@ import flex.messaging.io.amf.AmfMessageDeserializer; import flex.messaging.io.amf.AmfMessageSerializer; import flex.messaging.io.amf.AmfTrace; +import flex.messaging.validators.DeserializationValidator; /** * Implementation of {@link org.springframework.http.converter.HttpMessageConverter HttpMessageConverter} @@ -59,10 +60,16 @@ public class AmfHttpMessageConverter extends AbstractHttpMessageConverter voters = new ArrayList(); + List> voters = new ArrayList>(); voters.add(new RoleVoter()); voters.add(new AuthenticatedVoter()); - adm.setDecisionVoters(voters); + AffirmativeBased adm = new AffirmativeBased(voters); setAccessDecisionManager(adm); } diff --git a/spring-flex-core/src/main/java/org/springframework/flex/security3/EndpointSecurityMetadataSource.java b/spring-flex-core/src/main/java/org/springframework/flex/security3/EndpointSecurityMetadataSource.java index fe44d02d..593f7dc0 100644 --- a/spring-flex-core/src/main/java/org/springframework/flex/security3/EndpointSecurityMetadataSource.java +++ b/spring-flex-core/src/main/java/org/springframework/flex/security3/EndpointSecurityMetadataSource.java @@ -29,7 +29,7 @@ import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityMetadataSource; import org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; import flex.messaging.FlexContext; diff --git a/spring-flex-core/src/main/java/org/springframework/flex/security3/SecurityConfigurationPostProcessor.java b/spring-flex-core/src/main/java/org/springframework/flex/security3/SecurityConfigurationPostProcessor.java index f989029c..1caf13a9 100644 --- a/spring-flex-core/src/main/java/org/springframework/flex/security3/SecurityConfigurationPostProcessor.java +++ b/spring-flex-core/src/main/java/org/springframework/flex/security3/SecurityConfigurationPostProcessor.java @@ -38,6 +38,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.flex.core.ExceptionTranslator; import org.springframework.security.web.FilterChainProxy; +import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.RememberMeServices; import org.springframework.security.web.authentication.logout.LogoutHandler; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; @@ -157,9 +158,11 @@ private static final class FilterChainAccessor { public FilterChainAccessor(FilterChainProxy proxy) { this.filters = new LinkedHashSet(); - for (List filters : proxy.getFilterChainMap().values()) { - this.filters.addAll(filters); - } + List mappings = proxy.getFilterChains(); + for(SecurityFilterChain entry : mappings) { + List filters = entry.getFilters(); + this.filters.addAll(filters); + } } public Set getFilters() { diff --git a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointInterceptorTests.java b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointInterceptorTests.java index 64be05d1..feadf5ce 100644 --- a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointInterceptorTests.java +++ b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointInterceptorTests.java @@ -44,9 +44,9 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import flex.messaging.FlexContext; import flex.messaging.endpoints.AbstractEndpoint; @@ -124,7 +124,7 @@ public void serviceAuthorized() throws Exception { when(this.endpoint.serviceMessage(this.inMessage)).thenReturn(this.outMessage); List authorities = new ArrayList(); - authorities.add(new GrantedAuthorityImpl("ROLE_USER")); + authorities.add(new SimpleGrantedAuthority("ROLE_USER")); Authentication auth = new UsernamePasswordAuthenticationToken("foo", "bar", authorities); SecurityContextHolder.getContext().setAuthentication(auth); diff --git a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityIntegrationTests.java b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityIntegrationTests.java index 2cdb3a76..4b271941 100644 --- a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityIntegrationTests.java +++ b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityIntegrationTests.java @@ -48,9 +48,9 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import flex.messaging.FlexContext; import flex.messaging.MessageBroker; @@ -65,7 +65,7 @@ public class EndpointSecurityIntegrationTests extends AbstractMessageBrokerTests private EndpointSecurityMetadataSource source; - private final AccessDecisionManager adm = new AffirmativeBased(); + private AccessDecisionManager adm; @Mock private AuthenticationManager mgr; @@ -85,10 +85,10 @@ public void setUp() throws Exception { requestMap.put(new AntPathRequestMatcher("/messagebroker/**"), attrs); this.source = new EndpointSecurityMetadataSource(requestMap); - List voters = new ArrayList(); + List> voters = new ArrayList>(); voters.add(new RoleVoter()); - ((AffirmativeBased) this.adm).setDecisionVoters(voters); - + this.adm = new AffirmativeBased(voters); + initializeInterceptors(); this.request = new MockHttpServletRequest(); @@ -103,7 +103,7 @@ public void tearDown() { @Test public void serviceAuthorized() throws Exception { List authorities = new ArrayList(); - authorities.add(new GrantedAuthorityImpl("ROLE_USER")); + authorities.add(new SimpleGrantedAuthority("ROLE_USER")); Authentication auth = new UsernamePasswordAuthenticationToken("foo", "bar", authorities); SecurityContextHolder.getContext().setAuthentication(auth); diff --git a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityMetadataSourceTests.java b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityMetadataSourceTests.java index df3a2fb7..ca4741f5 100644 --- a/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityMetadataSourceTests.java +++ b/spring-flex-core/src/test/java/org/springframework/flex/security3/EndpointSecurityMetadataSourceTests.java @@ -33,7 +33,7 @@ import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; -import org.springframework.security.web.util.RequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import flex.messaging.FlexContext; import flex.messaging.endpoints.AMFEndpoint; diff --git a/spring-flex-core/src/test/java/org/springframework/flex/security3/LoginMessageInterceptorTests.java b/spring-flex-core/src/test/java/org/springframework/flex/security3/LoginMessageInterceptorTests.java index 41823771..52356d06 100644 --- a/spring-flex-core/src/test/java/org/springframework/flex/security3/LoginMessageInterceptorTests.java +++ b/spring-flex-core/src/test/java/org/springframework/flex/security3/LoginMessageInterceptorTests.java @@ -29,7 +29,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import flex.messaging.messages.AcknowledgeMessage; @@ -62,7 +62,7 @@ public void postProcessPassThrough() { @SuppressWarnings("rawtypes") public void postProcessSuccessfulLogin() { List authorities = new ArrayList(); - authorities.add(new GrantedAuthorityImpl("ROLE_USER")); + authorities.add(new SimpleGrantedAuthority("ROLE_USER")); Authentication auth = new UsernamePasswordAuthenticationToken("foo", "bar", authorities); SecurityContextHolder.getContext().setAuthentication(auth); diff --git a/spring-flex-core/src/test/java/org/springframework/flex/security3/SpringSecurityLoginCommandTests.java b/spring-flex-core/src/test/java/org/springframework/flex/security3/SpringSecurityLoginCommandTests.java index ddf099c3..f8cec838 100644 --- a/spring-flex-core/src/test/java/org/springframework/flex/security3/SpringSecurityLoginCommandTests.java +++ b/spring-flex-core/src/test/java/org/springframework/flex/security3/SpringSecurityLoginCommandTests.java @@ -16,10 +16,13 @@ package org.springframework.flex.security3; -import org.junit.After; -import static org.junit.Assert.*; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.Matchers.isA; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -28,6 +31,9 @@ import java.util.ArrayList; import java.util.List; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.flex.core.AbstractMessageBrokerTests; @@ -40,7 +46,7 @@ import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UsernameNotFoundException; @@ -127,8 +133,8 @@ public void validLogin() throws Exception { @Test public void matchingAuthority() throws Exception { List authorities = new ArrayList(); - authorities.add(new GrantedAuthorityImpl("ROLE_USER")); - authorities.add(new GrantedAuthorityImpl("ROLE_ABUSER")); + authorities.add(new SimpleGrantedAuthority("ROLE_USER")); + authorities.add(new SimpleGrantedAuthority("ROLE_ABUSER")); Principal principal = new UsernamePasswordAuthenticationToken("foo", "bar", authorities); List roles = new ArrayList(); @@ -140,8 +146,8 @@ public void matchingAuthority() throws Exception { @Test public void noMatchingAuthority() throws Exception { List authorities = new ArrayList(); - authorities.add(new GrantedAuthorityImpl("ROLE_USER")); - authorities.add(new GrantedAuthorityImpl("ROLE_ABUSER")); + authorities.add(new SimpleGrantedAuthority("ROLE_USER")); + authorities.add(new SimpleGrantedAuthority("ROLE_ABUSER")); Principal principal = new UsernamePasswordAuthenticationToken("foo", "bar", authorities); List roles = new ArrayList(); diff --git a/spring-flex-core/src/test/resources/custom-services-config.xml b/spring-flex-core/src/test/resources/custom-services-config.xml index 4143a274..7112ce75 100755 --- a/spring-flex-core/src/test/resources/custom-services-config.xml +++ b/spring-flex-core/src/test/resources/custom-services-config.xml @@ -1,16 +1,35 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + diff --git a/spring-flex-core/src/test/resources/org/springframework/flex/config/security-context.xml b/spring-flex-core/src/test/resources/org/springframework/flex/config/security-context.xml index ac097b00..f346000d 100644 --- a/spring-flex-core/src/test/resources/org/springframework/flex/config/security-context.xml +++ b/spring-flex-core/src/test/resources/org/springframework/flex/config/security-context.xml @@ -2,9 +2,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.2.xsd"> + http://www.springframework.org/schema/security/spring-security.xsd"> diff --git a/spring-flex-core/src/test/resources/org/springframework/flex/config/services-config.xml b/spring-flex-core/src/test/resources/org/springframework/flex/config/services-config.xml index 752ac9da..4c0d5426 100755 --- a/spring-flex-core/src/test/resources/org/springframework/flex/config/services-config.xml +++ b/spring-flex-core/src/test/resources/org/springframework/flex/config/services-config.xml @@ -1,82 +1,98 @@ - - - - - - - - - - - - - false - - - - - - - true - 4 - - - - - - - - - - [BlazeDS] - false - false - false - false - - - Endpoint.* - Service.* - Configuration - - - - - - - - guests - accountants - employees - managers - - - - - sampleusers - - - - - + + + + + + + + + + true + + + + + + + + false + + true + + + + + + + + true + 4 + + true + + + + + + + + + + + [BlazeDS] + false + false + false + false + + + Endpoint.* + Service.* + Configuration + + + + + + + + + + + + + + + + + + guests + accountants + employees + managers + + + + + sampleusers + + + + + diff --git a/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config-4.6.xml b/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config-4.6.xml index 92385da5..11adb7ec 100644 --- a/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config-4.6.xml +++ b/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config-4.6.xml @@ -19,12 +19,20 @@ + + + true + + false + + true + @@ -33,6 +41,9 @@ true 4 + + true + @@ -58,6 +69,17 @@ + + + + + + + + + + false diff --git a/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config.xml b/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config.xml index be048178..ce27b355 100755 --- a/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config.xml +++ b/spring-flex-core/src/test/resources/org/springframework/flex/core/services-config.xml @@ -1,85 +1,107 @@ - - - - - - - - - - - - - ROLE_USER - - - - - - - - - - - - - - false - - - - - - - true - 4 - - - - - - - - - - [BlazeDS] - false - false - false - false - - - Endpoint.* - Service.* - Configuration - - - - - - - false - - - - - + + + + + + + + + + + + + ROLE_USER + + + + + + + + + + + true + + + + + + + + false + + true + + + + + + + + true + 4 + + true + + + + + + + + + + + [BlazeDS] + false + false + false + false + + + Endpoint.* + Service.* + Configuration + + + + + + + + + + + + + + + + + false + + + + + diff --git a/spring-flex-hibernate3/src/test/resources/custom-services-config.xml b/spring-flex-hibernate3/src/test/resources/custom-services-config.xml index d8ea04f4..1eaf9c96 100755 --- a/spring-flex-hibernate3/src/test/resources/custom-services-config.xml +++ b/spring-flex-hibernate3/src/test/resources/custom-services-config.xml @@ -9,8 +9,23 @@ + + + true + + + + + + + + + + + diff --git a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/config/services-config.xml b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/config/services-config.xml index db67a283..4c0d5426 100755 --- a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/config/services-config.xml +++ b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/config/services-config.xml @@ -1,82 +1,98 @@ - + - - - + + + + + true + + + - - - - false - - + + + + false + + true + + + - - - - true - 4 - - + + + + true + 4 + + true + + + - + - - false - - --> - + + + + [BlazeDS] + false + false + false + false + + + Endpoint.* + Service.* + Configuration + + + - - - - [BlazeDS] - false - false - false - false - - - Endpoint.* - Service.* - Configuration - - - - - - - - guests - accountants - employees - managers - - - - - sampleusers - - - + + + + + + + + + + + + + + guests + accountants + employees + managers + + + + + sampleusers + + + diff --git a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config-4.6.xml b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config-4.6.xml index 2d45d438..f207df75 100755 --- a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config-4.6.xml +++ b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config-4.6.xml @@ -19,12 +19,20 @@ + + + true + + false + + true + @@ -33,6 +41,9 @@ true 4 + + true + @@ -58,6 +69,17 @@ + + + + + + + + + + false diff --git a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config.xml b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config.xml index 4627391f..8dbbf1e3 100755 --- a/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config.xml +++ b/spring-flex-hibernate3/src/test/resources/org/springframework/flex/hibernate3/core/services-config.xml @@ -19,12 +19,20 @@ + + + true + + false + + true + @@ -33,6 +41,9 @@ true 4 + + true + @@ -67,6 +78,17 @@ + + + + + + + + + + false diff --git a/spring-flex-hibernate4/src/test/resources/custom-services-config.xml b/spring-flex-hibernate4/src/test/resources/custom-services-config.xml index d8ea04f4..20e44504 100755 --- a/spring-flex-hibernate4/src/test/resources/custom-services-config.xml +++ b/spring-flex-hibernate4/src/test/resources/custom-services-config.xml @@ -1,16 +1,37 @@ - - - + + + - + - - - + + + + + true + + - + + + + + + + + + + + + + diff --git a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/config/services-config.xml b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/config/services-config.xml index db67a283..abe8e850 100755 --- a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/config/services-config.xml +++ b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/config/services-config.xml @@ -8,6 +8,11 @@ + + + true + + false + + true + @@ -28,6 +36,9 @@ true 4 + + true + @@ -63,6 +74,17 @@ + + + + + + + + + + diff --git a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config-4.6.xml b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config-4.6.xml index 2d45d438..f207df75 100755 --- a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config-4.6.xml +++ b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config-4.6.xml @@ -19,12 +19,20 @@ + + + true + + false + + true + @@ -33,6 +41,9 @@ true 4 + + true + @@ -58,6 +69,17 @@ + + + + + + + + + + false diff --git a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config.xml b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config.xml index 4627391f..8dbbf1e3 100755 --- a/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config.xml +++ b/spring-flex-hibernate4/src/test/resources/org/springframework/flex/hibernate4/core/services-config.xml @@ -19,12 +19,20 @@ + + + true + + false + + true + @@ -33,6 +41,9 @@ true 4 + + true + @@ -67,6 +78,17 @@ + + + + + + + + + + false diff --git a/spring-flex-integration/src/main/webapp/WEB-INF/flex/services-config.xml b/spring-flex-integration/src/main/webapp/WEB-INF/flex/services-config.xml index 259d550a..b67e8a81 100644 --- a/spring-flex-integration/src/main/webapp/WEB-INF/flex/services-config.xml +++ b/spring-flex-integration/src/main/webapp/WEB-INF/flex/services-config.xml @@ -15,20 +15,38 @@ + + + true + + + + + true + + + + + true + + false + + true + @@ -37,6 +55,9 @@ true 4 + + true + @@ -71,4 +92,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/spring-flex-parent/pom.xml b/spring-flex-parent/pom.xml index 139eecfb..fea3f80e 100644 --- a/spring-flex-parent/pom.xml +++ b/spring-flex-parent/pom.xml @@ -57,9 +57,9 @@ - 4.1.1.RELEASE + 5.1.2.RELEASE 2.2.6.RELEASE - 3.2.4.RELEASE + 5.1.2.RELEASE 4.0.0.14931 1.7.7 @@ -186,26 +186,31 @@ spring-flex-core 1.6.0.RC1 - - com.adobe.blazeds - blazeds-core - ${blazeds.version} - - - com.adobe.blazeds - blazeds-common - ${blazeds.version} - - - com.adobe.blazeds - blazeds-proxy - ${blazeds.version} - - - com.adobe.blazeds - blazeds-remoting - ${blazeds.version} - + + + + + org.apache.flex.blazeds + flex-messaging-core + 4.7.3 + + + org.apache.flex.blazeds + flex-messaging-common + 4.7.3 + + + org.apache.flex.blazeds + flex-messaging-proxy + 4.7.3 + + + org.apache.flex.blazeds + flex-messaging-remoting + 4.7.3 + + + javax.jms jms-api @@ -245,7 +250,7 @@ junit junit - 4.9 + 4.12 test diff --git a/spring-flex-samples/spring-flex-testdrive/testdrive/src/main/webapp/WEB-INF/flex/services-config.xml b/spring-flex-samples/spring-flex-testdrive/testdrive/src/main/webapp/WEB-INF/flex/services-config.xml index 772cadaf..050f8bd8 100644 --- a/spring-flex-samples/spring-flex-testdrive/testdrive/src/main/webapp/WEB-INF/flex/services-config.xml +++ b/spring-flex-samples/spring-flex-testdrive/testdrive/src/main/webapp/WEB-INF/flex/services-config.xml @@ -1,92 +1,127 @@ - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - true - 4 - - - - - - - true - 5 - 60000 - 1 - 200 - - - - - - - - - - - - - ROLE_USER - ROLE_ADMIN - - - - - - - - [BlazeDS] - false - false - false - false - - - Endpoint.* - Service.* - Configuration - - - - - - - - - false - - - - + + + + + + + + + + + + + + + + true + + + + + + + + + true + + + + + + + + false + + true + + + + + + + + true + 4 + + true + + + + + + + + true + 5 + 60000 + 1 + 200 + + true + + + + + + + + + true + + + + + + + + + + ROLE_USER + ROLE_ADMIN + + + + + + + + [BlazeDS] + false + false + false + false + + + Endpoint.* + Service.* + Configuration + + + + + + + + + + + + + + + + + + + false + + + + From e2104cef33bdcce90f88342b23bd47bf5f02e6de Mon Sep 17 00:00:00 2001 From: Joe Taras Date: Sat, 19 Nov 2022 20:36:26 +0100 Subject: [PATCH 2/2] Update FlexConfigurationManager.java Check on Java version, compliance for JDK 10 or more --- .../flex/config/FlexConfigurationManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java b/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java index 20067be9..201df0de 100755 --- a/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java +++ b/spring-flex-core/src/main/java/org/springframework/flex/config/FlexConfigurationManager.java @@ -98,7 +98,15 @@ public FlexConfigurationManager(ResourceLoader resourceLoader, String configurat @SuppressWarnings("unchecked") public MessagingConfiguration getMessagingConfiguration(ServletConfig servletConfig) { String[] javaVersionElements = System.getProperty("java.version").split("\\."); - int major = Integer.parseInt(javaVersionElements[1]); + int major = 0; + // Check about Java version + // If Java version is greater or equals than 10 we get the first element (i.e. JDK 12.0.2 get 12) + // Else Java version lower then 10 get the second element (i.e. JDK 1.8.260 get 8) + if (javaVersionElements.length>0 && Integer.parseInt(javaVersionElements[0])>=10) { + major = Integer.parseInt(javaVersionElements[0]); + }else if (javaVersionElements.length>1){ + major = Integer.parseInt(javaVersionElements[1]); + } Assert.isTrue(major >= 5, "Spring BlazeDS Integration requires a minimum of Java 1.5");