diff --git a/gemma-core/pom.xml b/gemma-core/pom.xml index 48f47916af..d8f33f0238 100644 --- a/gemma-core/pom.xml +++ b/gemma-core/pom.xml @@ -112,8 +112,8 @@ 1.5 - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.version} runtime diff --git a/gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssoManagerServiceHelperImpl.java b/gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssoManagerServiceHelperImpl.java index b16784d0c2..f81262976c 100644 --- a/gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssoManagerServiceHelperImpl.java +++ b/gemma-core/src/main/java/ubic/gemma/core/association/phenotype/PhenotypeAssoManagerServiceHelperImpl.java @@ -18,7 +18,7 @@ */ package ubic.gemma.core.association.phenotype; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import ubic.gemma.core.annotation.reference.BibliographicReferenceService; diff --git a/gemma-core/src/main/java/ubic/gemma/core/metrics/MeterRegistryEhcacheConfigurer.java b/gemma-core/src/main/java/ubic/gemma/core/metrics/MeterRegistryEhcacheConfigurer.java index 220c18ceca..864b2b8c89 100644 --- a/gemma-core/src/main/java/ubic/gemma/core/metrics/MeterRegistryEhcacheConfigurer.java +++ b/gemma-core/src/main/java/ubic/gemma/core/metrics/MeterRegistryEhcacheConfigurer.java @@ -1,15 +1,15 @@ package ubic.gemma.core.metrics; import io.micrometer.core.instrument.MeterRegistry; +import io.micrometer.core.instrument.binder.cache.EhCache2Metrics; import net.sf.ehcache.Ehcache; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; -import ubic.gemma.core.metrics.binder.cache.EhCache24Metrics; /** * Add metrics from each available {@link Ehcache} in the given {@link CacheManager} to the supplied meter registry. * @author poirigui - * @see EhCache24Metrics + * @see EhCache2Metrics */ public class MeterRegistryEhcacheConfigurer extends AbstractMeterRegistryConfigurer { @@ -25,7 +25,7 @@ public void configure( MeterRegistry registry ) { for ( String cacheName : cacheManager.getCacheNames() ) { Cache cache = cacheManager.getCache( cacheName ); if ( cache.getNativeCache() instanceof Ehcache ) { - EhCache24Metrics.monitor( registry, ( Ehcache ) cache.getNativeCache() ); + EhCache2Metrics.monitor( registry, ( Ehcache ) cache.getNativeCache() ); } } } diff --git a/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/EhCache24Metrics.java b/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/EhCache24Metrics.java deleted file mode 100644 index adb167c713..0000000000 --- a/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/EhCache24Metrics.java +++ /dev/null @@ -1,106 +0,0 @@ -package ubic.gemma.core.metrics.binder.cache; - -import io.micrometer.common.lang.Nullable; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tag; -import io.micrometer.core.instrument.Tags; -import io.micrometer.core.instrument.binder.cache.CacheMeterBinder; -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Statistics; - -import java.util.function.Function; -import java.util.function.ToLongFunction; - -/** - * Metrics for Ehcache 2.4 series. - * - * @author poirigui - * @see io.micrometer.core.instrument.binder.cache.EhCache2Metrics - */ -public class EhCache24Metrics extends CacheMeterBinder { - - public EhCache24Metrics( Ehcache cache, Iterable tags ) { - super( cache, cache.getName(), tags ); - } - - /** - * Record metrics on an EhCache cache. - * @param registry The registry to bind metrics to. - * @param cache The cache to instrument. - * @param tags Tags to apply to all recorded metrics. Must be an even number of - * arguments representing key/value pairs of tags. - * @return The instrumented cache, unchanged. The original cache is not wrapped or - * proxied in any way. - */ - public static Ehcache monitor( MeterRegistry registry, Ehcache cache, String... tags ) { - return monitor( registry, cache, Tags.of( tags ) ); - } - - /** - * Record metrics on an EhCache cache. - * @param registry The registry to bind metrics to. - * @param cache The cache to instrument. - * @param tags Tags to apply to all recorded metrics. - * @return The instrumented cache, unchanged. The original cache is not wrapped or - * proxied in any way. - */ - public static Ehcache monitor( MeterRegistry registry, Ehcache cache, Iterable tags ) { - new EhCache24Metrics( cache, tags ).bindTo( registry ); - return cache; - } - - @Override - protected Long size() { - return getOrDefault( Statistics::getObjectCount, null ); - } - - @Override - protected long hitCount() { - return getOrDefault( Statistics::getCacheHits, 0L ); - } - - @Override - protected Long missCount() { - return getOrDefault( Statistics::getCacheMisses, null ); - } - - @Override - protected Long evictionCount() { - return getOrDefault( Statistics::getEvictionCount, null ); - } - - @Override - protected long putCount() { - return 0L; - } - - @Override - protected void bindImplementationSpecificMetrics( MeterRegistry registry ) { - } - - @Nullable - private Statistics getStats() { - Ehcache cache = getCache(); - return cache != null ? cache.getStatistics() : null; - } - - @Nullable - private Long getOrDefault( Function function, @Nullable Long defaultValue ) { - Statistics ref = getStats(); - if ( ref != null ) { - return function.apply( ref ); - } - - return defaultValue; - } - - private long getOrDefault( ToLongFunction function, long defaultValue ) { - Statistics ref = getStats(); - if ( ref != null ) { - return function.applyAsLong( ref ); - } - - return defaultValue; - } - -} diff --git a/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/package-info.java b/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/package-info.java deleted file mode 100644 index cc1233fff2..0000000000 --- a/gemma-core/src/main/java/ubic/gemma/core/metrics/binder/cache/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@ParametersAreNonnullByDefault -package ubic.gemma.core.metrics.binder.cache; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/gemma-core/src/main/java/ubic/gemma/core/security/audit/AuditAdvice.java b/gemma-core/src/main/java/ubic/gemma/core/security/audit/AuditAdvice.java index 964dbe457a..d366cc8642 100644 --- a/gemma-core/src/main/java/ubic/gemma/core/security/audit/AuditAdvice.java +++ b/gemma-core/src/main/java/ubic/gemma/core/security/audit/AuditAdvice.java @@ -26,6 +26,7 @@ import org.hibernate.*; import org.hibernate.engine.spi.CascadeStyle; import org.hibernate.engine.spi.CascadingAction; +import org.hibernate.engine.spi.CascadingActions; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.type.Type; import org.slf4j.Logger; @@ -180,7 +181,7 @@ private void processAuditable( Signature method, OperationType operationType, Au */ private void addCreateAuditEvent( Signature method, Auditable auditable, User user, Date date ) { addAuditEvent( method, auditable, AuditAction.CREATE, "", user, date ); - cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingAction.PERSIST ); + cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingActions.PERSIST ); } private void addSaveAuditEvent( Signature method, Auditable auditable, User user, Date date ) { @@ -188,10 +189,10 @@ private void addSaveAuditEvent( Signature method, Auditable auditable, User user CascadingAction cascadingAction; if ( auditable.getId() != null ) { auditAction = AuditAction.UPDATE; - cascadingAction = CascadingAction.MERGE; + cascadingAction = CascadingActions.MERGE; } else { auditAction = AuditAction.CREATE; - cascadingAction = CascadingAction.PERSIST; + cascadingAction = CascadingActions.PERSIST; } addAuditEvent( method, auditable, auditAction, "", user, date ); // we only propagate a CREATE event through cascade for entities that were created in the save @@ -214,7 +215,7 @@ private void addUpdateAuditEvent( Signature method, Auditable auditable, User us addAuditEvent( method, auditable, AuditAction.UPDATE, "", user, date ); // we only propagate a CREATE event through cascade for entities that were created in the update // Note: CREATE events are skipped if the audit trail already contains one - cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingAction.SAVE_UPDATE ); + cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingActions.SAVE_UPDATE ); } private void addDeleteAuditEvent( Signature method, Auditable auditable, User user, Date date ) { @@ -222,7 +223,7 @@ private void addDeleteAuditEvent( Signature method, Auditable auditable, User us throw new IllegalArgumentException( String.format( "Transient instance passed to delete auditing [%s on %s by %s]", method, auditable, user.getUserName() ) ); } addAuditEvent( method, auditable, AuditAction.DELETE, "", user, date ); - cascadeAuditEvent( method, AuditAction.DELETE, auditable, user, date, CascadingAction.DELETE ); + cascadeAuditEvent( method, AuditAction.DELETE, auditable, user, date, CascadingActions.DELETE ); } /** diff --git a/gemma-core/src/main/java/ubic/gemma/persistence/util/Filter.java b/gemma-core/src/main/java/ubic/gemma/persistence/util/Filter.java index 375ac10103..80f519c5d7 100644 --- a/gemma-core/src/main/java/ubic/gemma/persistence/util/Filter.java +++ b/gemma-core/src/main/java/ubic/gemma/persistence/util/Filter.java @@ -59,7 +59,7 @@ public class Filter { */ private static final ConfigurableConversionService conversionService = new GenericConversionService(); - private static void addConverter( Class targetClass, Converter converter, Converter reverseConverter ) { + private static void addConverter( Class targetClass, Converter converter, Converter reverseConverter ) { conversionService.addConverter( String.class, targetClass, converter ); conversionService.addConverter( targetClass, String.class, reverseConverter ); } diff --git a/gemma-core/src/main/resources/ubic/gemma/applicationContext-search.xml b/gemma-core/src/main/resources/ubic/gemma/applicationContext-search.xml index 9c7544b609..aa9529dfa5 100644 --- a/gemma-core/src/main/resources/ubic/gemma/applicationContext-search.xml +++ b/gemma-core/src/main/resources/ubic/gemma/applicationContext-search.xml @@ -31,7 +31,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -94,7 +94,7 @@ - + diff --git a/gemma-core/src/main/resources/ubic/gemma/applicationContext-serviceBeans.xml b/gemma-core/src/main/resources/ubic/gemma/applicationContext-serviceBeans.xml index a23d3e7e14..2d83e520fd 100644 --- a/gemma-core/src/main/resources/ubic/gemma/applicationContext-serviceBeans.xml +++ b/gemma-core/src/main/resources/ubic/gemma/applicationContext-serviceBeans.xml @@ -22,9 +22,7 @@ are listed in a resource. If the resource is in your classpath, list in in 'locations'. Other config files can be added by defining PropertiesConfiguration instances --> - - - + @@ -33,9 +31,7 @@ - - - + classpath:default.properties diff --git a/gemma-core/src/test/java/ubic/gemma/persistence/service/common/description/CharacteristicDaoImplTest.java b/gemma-core/src/test/java/ubic/gemma/persistence/service/common/description/CharacteristicDaoImplTest.java index b1f6c55105..86bd0f1734 100644 --- a/gemma-core/src/test/java/ubic/gemma/persistence/service/common/description/CharacteristicDaoImplTest.java +++ b/gemma-core/src/test/java/ubic/gemma/persistence/service/common/description/CharacteristicDaoImplTest.java @@ -1,6 +1,6 @@ package ubic.gemma.persistence.service.common.description; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/gemma-core/src/test/resources/test.spring.config.xml b/gemma-core/src/test/resources/test.spring.config.xml index 55b9d5bc1c..9b6afb8071 100644 --- a/gemma-core/src/test/resources/test.spring.config.xml +++ b/gemma-core/src/test/resources/test.spring.config.xml @@ -5,9 +5,7 @@ - - - + classpath:default.properties @@ -18,9 +16,7 @@ - - - + diff --git a/gemma-web/.gitignore b/gemma-web/.gitignore index 5e56e040ec..fbaa996186 100644 --- a/gemma-web/.gitignore +++ b/gemma-web/.gitignore @@ -1 +1,2 @@ /bin +/src/main/java/org diff --git a/gemma-web/pom.xml b/gemma-web/pom.xml index 008a86d974..4e971848cb 100644 --- a/gemma-web/pom.xml +++ b/gemma-web/pom.xml @@ -102,6 +102,31 @@ maven-war-plugin 3.3.2 + + org.apache.maven.plugins + maven-dependency-plugin + 3.3.0 + + + generate-sources + + unpack + + + + + org.springframework + spring-webmvc + 3.2.18.RELEASE + sources + + + org/springframework/web/servlet/mvc/AbstractFormController.java,org/springframework/web/servlet/mvc/BaseCommandController.java,org/springframework/web/servlet/mvc/SimpleFormController.java + ${project.build.sourceDirectory} + + + + @@ -187,18 +212,18 @@ - + org.springframework.social spring-social-core - 1.0.3.RELEASE + 1.1.6.RELEASE runtime - + org.springframework.ws spring-ws-core - 2.1.4.RELEASE + 2.4.7.RELEASE @@ -224,19 +249,19 @@ org.quartz-scheduler quartz - 1.8.6 + 2.3.2 - rome + com.rometools rome - 1.0 + 1.18.0 - rome + com.rometools rome-fetcher - 1.0 + 1.18.0 @@ -250,7 +275,7 @@ org.directwebremoting dwr - 2.0.11-RELEASE + 3.0.2-RELEASE @@ -274,7 +299,7 @@ runtime - + org.glassfish.jersey.core jersey-server @@ -288,7 +313,7 @@ org.glassfish.jersey.ext - jersey-spring3 + jersey-spring4 ${jersey.version} @@ -312,7 +337,7 @@ javax.ws.rs javax.ws.rs-api - 2.0.1 + 2.1.1 diff --git a/gemma-web/src/main/java/ubic/gemma/web/controller/GeneralSearchControllerImpl.java b/gemma-web/src/main/java/ubic/gemma/web/controller/GeneralSearchControllerImpl.java index fc2376cddb..63e3597cfd 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/controller/GeneralSearchControllerImpl.java +++ b/gemma-web/src/main/java/ubic/gemma/web/controller/GeneralSearchControllerImpl.java @@ -19,7 +19,7 @@ package ubic.gemma.web.controller; import gemma.gsec.util.SecurityUtil; -import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.StopWatch; import org.springframework.beans.factory.annotation.Autowired; diff --git a/gemma-web/src/main/java/ubic/gemma/web/controller/common/rss/CustomRssViewer.java b/gemma-web/src/main/java/ubic/gemma/web/controller/common/rss/CustomRssViewer.java index d132d5d928..490c54aa51 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/controller/common/rss/CustomRssViewer.java +++ b/gemma-web/src/main/java/ubic/gemma/web/controller/common/rss/CustomRssViewer.java @@ -18,9 +18,9 @@ */ package ubic.gemma.web.controller.common.rss; -import com.sun.syndication.feed.rss.Channel; -import com.sun.syndication.feed.rss.Content; -import com.sun.syndication.feed.rss.Item; +import com.rometools.rome.feed.rss.Channel; +import com.rometools.rome.feed.rss.Content; +import com.rometools.rome.feed.rss.Item; import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/gemma-web/src/main/java/ubic/gemma/web/feed/FeedReader.java b/gemma-web/src/main/java/ubic/gemma/web/feed/FeedReader.java index 2698aba1c8..b5b71c3aa4 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/feed/FeedReader.java +++ b/gemma-web/src/main/java/ubic/gemma/web/feed/FeedReader.java @@ -18,12 +18,12 @@ */ package ubic.gemma.web.feed; -import com.sun.syndication.feed.synd.SyndEntry; -import com.sun.syndication.feed.synd.SyndFeed; -import com.sun.syndication.fetcher.FeedFetcher; -import com.sun.syndication.fetcher.impl.FeedFetcherCache; -import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache; -import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher; +import com.rometools.fetcher.FeedFetcher; +import com.rometools.fetcher.impl.FeedFetcherCache; +import com.rometools.fetcher.impl.HashMapFeedInfoCache; +import com.rometools.fetcher.impl.HttpURLFeedFetcher; +import com.rometools.rome.feed.synd.SyndEntry; +import com.rometools.rome.feed.synd.SyndFeed; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.InitializingBean; import org.springframework.stereotype.Controller; diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/CharacteristicConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/CharacteristicConverter.java index fe83589a5e..d7c57a7e2e 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/CharacteristicConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/CharacteristicConverter.java @@ -19,30 +19,26 @@ package ubic.gemma.web.remote; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.BeanConverter; -import org.directwebremoting.dwrp.ParseUtil; -import org.directwebremoting.dwrp.ProtocolConstants; import org.directwebremoting.extend.*; -import org.directwebremoting.util.LocalUtil; -import org.directwebremoting.util.Messages; - import ubic.gemma.model.common.description.Characteristic; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; +import static org.directwebremoting.extend.ConvertUtil.splitInbound; + /** * @author kelsey - * */ public class CharacteristicConverter extends BeanConverter { @SuppressWarnings("unchecked") @Override - public Object convertInbound( Class paramType, InboundVariable iv, InboundContext inctx ) throws MarshallException { + public Object convertInbound( Class paramType, InboundVariable iv ) throws ConversionException { String value = iv.getValue(); // If the text is null then the whole bean is null @@ -51,13 +47,12 @@ public Object convertInbound( Class paramType, InboundVariable iv, InboundContex } if ( !value.startsWith( ProtocolConstants.INBOUND_MAP_START ) ) { - throw new MarshallException( paramType, Messages.getString( "BeanConverter.FormatError", - ProtocolConstants.INBOUND_MAP_START ) ); + throw new ConversionException( paramType, String.format( "Inbound variable does not start with '%s'.", ProtocolConstants.INBOUND_MAP_START ) ); } if ( !value.endsWith( ProtocolConstants.INBOUND_MAP_END ) ) { - throw new MarshallException( paramType, Messages.getString( "BeanConverter.FormatError", - ProtocolConstants.INBOUND_MAP_START ) ); + throw new ConversionException( paramType, String.format( "Inbound variable does not end with '%s'.", ProtocolConstants.INBOUND_MAP_END ) ); + // ProtocolConstants.INBOUND_MAP_START ) ); } value = value.substring( 1, value.length() - 1 ); @@ -68,17 +63,16 @@ public Object convertInbound( Class paramType, InboundVariable iv, InboundContex Object bean = Characteristic.Factory.newInstance(); if ( instanceType != null ) { - inctx.addConverted( iv, instanceType, bean ); + iv.getContext().addConverted( iv, instanceType, bean ); } else { - inctx.addConverted( iv, paramType, bean ); + iv.getContext().addConverted( iv, paramType, bean ); } Map properties = getPropertyMapFromObject( bean, false, true ); // Loop through the properties passed in - for ( Iterator> it = tokens.entrySet().iterator(); it.hasNext(); ) { - Map.Entry entry = it.next(); + for ( Entry entry : tokens.entrySet() ) { String key = entry.getKey(); String val = entry.getValue(); @@ -89,14 +83,14 @@ public Object convertInbound( Class paramType, InboundVariable iv, InboundContex Class propType = property.getPropertyType(); - String[] split = ParseUtil.splitInbound( val ); - String splitValue = split[LocalUtil.INBOUND_INDEX_VALUE]; - String splitType = split[LocalUtil.INBOUND_INDEX_TYPE]; + String[] split = splitInbound( val ); + String splitValue = split[ConvertUtil.INBOUND_INDEX_VALUE]; + String splitType = split[ConvertUtil.INBOUND_INDEX_TYPE]; - InboundVariable nested = new InboundVariable( iv.getLookup(), null, splitType, splitValue ); - TypeHintContext incc = createTypeHintContext( inctx, property ); + InboundVariable nested = new InboundVariable( iv.getContext(), null, splitType, splitValue ); + Property incc = createTypeHintContext( iv.getContext(), property ); - Object output = converterManager.convertInbound( propType, nested, inctx, incc ); + Object output = converterManager.convertInbound( propType, nested, incc ); // Unfortunate hack. Change the properties association to be a Set instead of a Collection in the // model; Model think this is a generic Collection, Hibernate thinks its a Set. DWR converts collections @@ -111,10 +105,10 @@ public Object convertInbound( Class paramType, InboundVariable iv, InboundContex } return bean; - } catch ( MarshallException ex ) { + } catch ( ConversionException ex ) { throw ex; } catch ( Exception ex ) { - throw new MarshallException( paramType, ex ); + throw new ConversionException( paramType, ex ); } } } diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/DirectionConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/DirectionConverter.java index 4dfa8e7d07..513035b86a 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/DirectionConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/DirectionConverter.java @@ -1,37 +1,35 @@ /* * The gemma-web project - * + * * Copyright (c) 2013 University of British Columbia - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package ubic.gemma.web.remote; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.StringConverter; -import org.directwebremoting.extend.InboundContext; import org.directwebremoting.extend.InboundVariable; -import org.directwebremoting.extend.MarshallException; import ubic.gemma.model.analysis.expression.diff.Direction; /** * DWR converter for Direction type. - * - * @author Paul * + * @author Paul * @see ubic.gemma.model.analysis.expression.diff.Direction */ public class DirectionConverter extends StringConverter { @Override - public Object convertInbound( Class paramType, InboundVariable iv, InboundContext inctx ) throws MarshallException { - String value = ( String ) super.convertInbound( paramType, iv, inctx ); + public Object convertInbound( Class paramType, InboundVariable iv ) throws ConversionException { + String value = ( String ) super.convertInbound( paramType, iv ); return Direction.valueOf( value ); } diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/DoublePointConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/DoublePointConverter.java index 0f9dd8a9cf..e89d3a9b23 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/DoublePointConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/DoublePointConverter.java @@ -18,15 +18,14 @@ */ package ubic.gemma.web.remote; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.BeanConverter; -import org.directwebremoting.dwrp.ObjectOutboundVariable; -import org.directwebremoting.extend.MarshallException; +import org.directwebremoting.extend.ObjectOutboundVariable; import org.directwebremoting.extend.OutboundContext; import org.directwebremoting.extend.OutboundVariable; import org.directwebremoting.extend.Property; import ubic.basecode.dataStructure.DoublePoint; -import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.TreeMap; @@ -41,7 +40,7 @@ public class DoublePointConverter extends BeanConverter { @Override - public OutboundVariable convertOutbound( Object data, OutboundContext outctx ) throws MarshallException { + public OutboundVariable convertOutbound( Object data, OutboundContext outctx ) throws ConversionException { if ( !( data instanceof DoublePoint ) ) return super.convertOutbound( data, outctx ); @@ -54,8 +53,7 @@ public OutboundVariable convertOutbound( Object data, OutboundContext outctx ) t try { Map properties = getPropertyMapFromObject( data, true, false ); - for ( Iterator> it = properties.entrySet().iterator(); it.hasNext(); ) { - Entry entry = it.next(); + for ( Entry entry : properties.entrySet() ) { String name = entry.getKey(); Property property = entry.getValue(); @@ -73,13 +71,13 @@ public OutboundVariable convertOutbound( Object data, OutboundContext outctx ) t } ovs.put( name, nested ); } - } catch ( MarshallException ex ) { + } catch ( ConversionException ex ) { throw ex; } catch ( Exception ex ) { - throw new MarshallException( data.getClass(), ex ); + throw new ConversionException( data.getClass(), ex ); } - ov.init( ovs, getJavascript() ); + ov.setChildren( ovs ); return ov; } diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/GOEvidenceCodeConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/GOEvidenceCodeConverter.java index cd556cb62b..0a8085302c 100755 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/GOEvidenceCodeConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/GOEvidenceCodeConverter.java @@ -19,20 +19,18 @@ package ubic.gemma.web.remote; import org.apache.commons.lang3.StringUtils; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.StringConverter; -import org.directwebremoting.extend.InboundContext; import org.directwebremoting.extend.InboundVariable; -import org.directwebremoting.extend.MarshallException; import ubic.gemma.model.association.GOEvidenceCode; /** * @author luke - * */ public class GOEvidenceCodeConverter extends StringConverter { @Override - public Object convertInbound( Class paramType, InboundVariable iv, InboundContext inctx ) throws MarshallException { - String value = ( String ) super.convertInbound( paramType, iv, inctx ); + public Object convertInbound( Class paramType, InboundVariable iv ) throws ConversionException { + String value = ( String ) super.convertInbound( paramType, iv ); if ( StringUtils.isBlank( value ) ) { return null; } diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/ScaleTypeConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/ScaleTypeConverter.java index f84ad9ccfc..b1ec433580 100755 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/ScaleTypeConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/ScaleTypeConverter.java @@ -1,8 +1,8 @@ /* * The Gemma project - * + * * Copyright (c) 2007 University of British Columbia - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,10 +18,9 @@ */ package ubic.gemma.web.remote; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.StringConverter; -import org.directwebremoting.extend.InboundContext; import org.directwebremoting.extend.InboundVariable; -import org.directwebremoting.extend.MarshallException; import ubic.gemma.model.common.quantitationtype.ScaleType; /** @@ -29,8 +28,8 @@ */ public class ScaleTypeConverter extends StringConverter { @Override - public Object convertInbound( Class paramType, InboundVariable iv, InboundContext inctx ) throws MarshallException { - String value = ( String ) super.convertInbound( paramType, iv, inctx ); + public Object convertInbound( Class paramType, InboundVariable iv ) throws ConversionException { + String value = ( String ) super.convertInbound( paramType, iv ); return ScaleType.valueOf( value ); } } diff --git a/gemma-web/src/main/java/ubic/gemma/web/remote/StandardQuantitationTypeConverter.java b/gemma-web/src/main/java/ubic/gemma/web/remote/StandardQuantitationTypeConverter.java index a8cc639c88..0d2219f14d 100755 --- a/gemma-web/src/main/java/ubic/gemma/web/remote/StandardQuantitationTypeConverter.java +++ b/gemma-web/src/main/java/ubic/gemma/web/remote/StandardQuantitationTypeConverter.java @@ -18,10 +18,9 @@ */ package ubic.gemma.web.remote; +import org.directwebremoting.ConversionException; import org.directwebremoting.convert.StringConverter; -import org.directwebremoting.extend.InboundContext; import org.directwebremoting.extend.InboundVariable; -import org.directwebremoting.extend.MarshallException; import ubic.gemma.model.common.quantitationtype.StandardQuantitationType; /** @@ -30,8 +29,8 @@ */ public class StandardQuantitationTypeConverter extends StringConverter { @Override - public Object convertInbound( Class paramType, InboundVariable iv, InboundContext inctx ) throws MarshallException { - String value = ( String ) super.convertInbound( paramType, iv, inctx ); + public Object convertInbound( Class paramType, InboundVariable iv ) throws ConversionException { + String value = ( String ) super.convertInbound( paramType, iv ); return StandardQuantitationType.valueOf( value ); } } diff --git a/gemma-web/src/main/java/ubic/gemma/web/util/CacheMonitorImpl.java b/gemma-web/src/main/java/ubic/gemma/web/util/CacheMonitorImpl.java index c1f7d7eed9..7313870cfe 100644 --- a/gemma-web/src/main/java/ubic/gemma/web/util/CacheMonitorImpl.java +++ b/gemma-web/src/main/java/ubic/gemma/web/util/CacheMonitorImpl.java @@ -20,8 +20,8 @@ import lombok.SneakyThrows; import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Statistics; import net.sf.ehcache.config.CacheConfiguration; +import net.sf.ehcache.statistics.StatisticsGateway; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -79,13 +79,11 @@ public void clearCache( String cacheName ) { @Override public void disableStatistics() { CacheMonitorImpl.log.info( "Disabling statistics" ); - this.setStatisticsEnabled( false ); } @Override public void enableStatistics() { CacheMonitorImpl.log.info( "Enabling statistics" ); - this.setStatisticsEnabled( true ); } @Override @@ -138,9 +136,9 @@ public String getStats() { @SneakyThrows(IOException.class) private void addEhcacheRow( String rawCacheName, Ehcache cache, Appendable buf ) { - Statistics statistics = cache.getStatistics(); + StatisticsGateway statistics = cache.getStatistics(); - long objectCount = statistics.getObjectCount(); + long objectCount = statistics.getSize(); if ( objectCount == 0 ) { return; @@ -154,13 +152,13 @@ private void addEhcacheRow( String rawCacheName, Ehcache cache, Appendable buf ) .append( "\"Clear " ) .append( escapeHtml4( cacheName ) ) .append( "" ); - long hits = statistics.getCacheHits(); - long misses = statistics.getCacheMisses(); - long inMemoryHits = statistics.getInMemoryHits(); - long inMemoryMisses = statistics.getInMemoryMisses(); + long hits = statistics.cacheHitCount(); + long misses = statistics.cacheMissCount(); + long inMemoryHits = statistics.localHeapHitCount(); + long inMemoryMisses = statistics.localHeapMissCount(); - long onDiskHits = statistics.getOnDiskHits(); - long evictions = statistics.getEvictionCount(); + long onDiskHits = statistics.localDiskHitCount(); + long evictions = statistics.cacheEvictedCount(); buf.append( this.makeTableCellForStat( ( double ) hits / ( hits + misses ) ) ); buf.append( this.makeTableCellForStat( hits ) ); @@ -195,13 +193,4 @@ private String makeTableCellForStat( long hits ) { private String makeTableCellForStat( double hits ) { return "" + ( hits > 0 ? String.format( "%.2f", hits ) : "" ) + ""; } - - private void setStatisticsEnabled( boolean b ) { - for ( String rawCacheName : cacheManager.getCacheNames() ) { - Cache cache = cacheManager.getCache( rawCacheName ); - if ( cache.getNativeCache() instanceof Ehcache ) { - ( ( Ehcache ) cache.getNativeCache() ).setSampledStatisticsEnabled( b ); - } - } - } } diff --git a/gemma-web/src/main/resources/ubic/gemma/applicationContext-schedule.xml b/gemma-web/src/main/resources/ubic/gemma/applicationContext-schedule.xml index 87ebfd4756..b2c5b0a27d 100644 --- a/gemma-web/src/main/resources/ubic/gemma/applicationContext-schedule.xml +++ b/gemma-web/src/main/resources/ubic/gemma/applicationContext-schedule.xml @@ -19,15 +19,15 @@ - - - - - - - - - + + + + + + + + + @@ -37,31 +37,31 @@ W Month 1-12 or JAN-DEC , - * / Day-of-Week 1-7 or SUN-SAT , - * ? / L # Year (Optional) empty, 1970-2099 , - * / See http://www.opensymphony.com/quartz/api/org/quartz/CronExpression.html for details, http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html for examples. If you want a schedule that fire frequently for testing, try 0 0/2 * ? * *. --> - + - + - + - + - + - + - + diff --git a/gemma-web/src/main/webapp/WEB-INF/gemma-servlet.xml b/gemma-web/src/main/webapp/WEB-INF/gemma-servlet.xml index b52c1c7c10..c75b4a59b0 100644 --- a/gemma-web/src/main/webapp/WEB-INF/gemma-servlet.xml +++ b/gemma-web/src/main/webapp/WEB-INF/gemma-servlet.xml @@ -9,7 +9,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd - http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd + http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> @@ -791,8 +791,6 @@ - @@ -802,8 +800,6 @@ class="ubic.gemma.core.tasks.visualization.DifferentialExpressionGenesConditionsValueObject$Cell"/> - @@ -842,7 +838,6 @@ - @@ -961,14 +956,11 @@ class="ubic.gemma.web.controller.expression.experiment.ExpressionExperimentDataFetchCommand"/> - - @@ -990,8 +982,6 @@ - - diff --git a/gemma-web/src/main/webapp/WEB-INF/gemma-ws-servlet.xml b/gemma-web/src/main/webapp/WEB-INF/gemma-ws-servlet.xml index 5f3355b515..d9c6735c97 100644 --- a/gemma-web/src/main/webapp/WEB-INF/gemma-ws-servlet.xml +++ b/gemma-web/src/main/webapp/WEB-INF/gemma-ws-servlet.xml @@ -68,7 +68,7 @@ - + diff --git a/pom.xml b/pom.xml index 82fff99626..92b6d45473 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ ubc.pavlab pavlab-starter-parent - 1.2.5 + 1.3.0-SNAPSHOT gemma-core @@ -235,11 +235,10 @@ org.hibernate hibernate-ehcache - compile - mysql - mysql-connector-java + com.mysql + mysql-connector-j @@ -258,7 +257,7 @@ net.sf.ehcache - ehcache-core + ehcache @@ -389,7 +388,7 @@ org.apache.logging.log4j - log4j-slf4j-impl + log4j-slf4j2-impl org.apache.logging.log4j @@ -644,10 +643,10 @@ - 0.0.10 - 3.2.18.RELEASE + 0.0.11-SNAPSHOT + 4.3.30.RELEASE 3.2.10.RELEASE - 2.25.1 + 2.27 2.14.1 2.2.8 3.9