We use GIT for deployment. This way you are only uploading the delta. Have a look at how OpenShift does it for the mechanics. I wasn¹t involved in setting up the system we use but I know the team who did leaned heavily on what was done on OpenShift.
I can tell you from experience deployments are much faster to upload and deploy. Z. On 26/05/2015 8:21 pm, "Aditya Chopra" <adity...@turvo.com> wrote: >The reason i am trying to reduce the war file size is because its size >has gone upto 55MB and time taken for copying it to the server for >deployments has increased. > >Is there any best practice around this that we should be following? > >Anyways, i will also check Spring usage to see why the threat context >class loader isn¹t being used. > >Aditya > > >> On 26-May-2015, at 3:37 pm, Mark Thomas <ma...@apache.org> wrote: >> >> On 26/05/2015 10:53, Aditya Chopra wrote: >> >> This thread does beg the question *why* do you want to reduce the size >> of your WAR. Doing so creates problems as you have found. >> >>> In WEB-INF/lib i only have 2 JARs, which are my application JAR¹s. All >>>other dependent JAR¹s i have moved to /mylibs. >>> >>> Below mentioned com.myapp.CustomGrantedAuth class is part of my >>>application JAR present under WEB-INF/lib. >> >> You'll need to speak to the Spring folks to see why the thread context >> class loader isn't being used. Whether that is a Spring bug or a Spring >> usage error in your part I don't know. >> >> Mark >> >> >>> >>> Here is the stack trace: >>> >>> DEBUG [http-nio-8080-exec-3] (DefaultExceptionHandler.java:123) - >>>error. >>> java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: >>>com.myapp.CustomGrantedAuth >>> at >>>org.springframework.security.oauth2.common.util.SerializationUtils.deser >>>ialize(SerializationUtils.java:36) >>> at >>>com.arl.mg.services.CustomTokenStore$2.mapRow(CustomTokenStore.java:124) >>> at >>>com.arl.mg.services.CustomTokenStore$2.mapRow(CustomTokenStore.java:1) >>> at >>>org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(Ro >>>wMapperResultSetExtractor.java:93) >>> at >>>org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(Ro >>>wMapperResultSetExtractor.java:60) >>> at >>>org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcT >>>emplate.java:708) >>> at >>>org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644 >>>) >>> at >>>org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695) >>> at >>>org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:727) >>> at >>>org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737) >>> at >>>org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.j >>>ava:811) >>> at >>>com.arl.mg.services.CustomTokenStore.readAuthentication(CustomTokenStore >>>.java:121) >>> at >>>com.arl.mg.services.CustomTokenServices.loadAuthentication(CustomTokenSe >>>rvices.java:139) >>> at >>>org.springframework.security.oauth2.provider.filter.OAuth2ProtectedResou >>>rceFilter.doFilter(OAuth2ProtectedResourceFilter.java:53) >>> at >>>org.springframework.security.oauth2.provider.filter.CompositeFilter$Virt >>>ualFilterChain.doFilter(CompositeFilter.java:79) >>> at >>>com.arl.mg.error.CustomExceptionHandlerFilter.doFilter(CustomExceptionHa >>>ndlerFilter.java:59) >>> at >>>org.springframework.security.oauth2.provider.filter.CompositeFilter$Virt >>>ualFilterChain.doFilter(CompositeFilter.java:79) >>> at >>>org.springframework.security.oauth2.provider.filter.CompositeFilter.doFi >>>lter(CompositeFilter.java:59) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.access.ExceptionTranslationFilter.doFil >>>ter(ExceptionTranslationFilter.java:113) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.session.SessionManagementFilter.doFilte >>>r(SessionManagementFilter.java:103) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.authentication.AnonymousAuthenticationF >>>ilter.doFilter(AnonymousAuthenticationFilter.java:113) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.authentication.rememberme.RememberMeAut >>>henticationFilter.doFilter(RememberMeAuthenticationFilter.java:139) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.servletapi.SecurityContextHolderAwareRe >>>questFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.savedrequest.RequestCacheAwareFilter.do >>>Filter(RequestCacheAwareFilter.java:45) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.authentication.AbstractAuthenticationPr >>>ocessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.context.request.async.WebAsyncManagerIn >>>tegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:5 >>>0) >>> at >>>org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequ >>>estFilter.java:107) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.context.SecurityContextPersistenceFilte >>>r.doFilter(SecurityContextPersistenceFilter.java:87) >>> at >>>org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doF >>>ilter(FilterChainProxy.java:342) >>> at >>>org.springframework.security.web.FilterChainProxy.doFilterInternal(Filte >>>rChainProxy.java:192) >>> at >>>org.springframework.security.web.FilterChainProxy.doFilter(FilterChainPr >>>oxy.java:160) >>> at >>>org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(Dele >>>gatingFilterProxy.java:344) >>> at >>>org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegating >>>FilterProxy.java:261) >>> at >>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica >>>tionFilterChain.java:239) >>> at >>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt >>>erChain.java:206) >>> at >>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv >>>e.java:219) >>> at >>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv >>>e.java:106) >>> at >>>org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator >>>Base.java:502) >>> at >>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java >>>:142) >>> at >>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java >>>:79) >>> at >>>org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessL >>>ogValve.java:617) >>> at >>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. >>>java:88) >>> at >>>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:5 >>>18) >>> at >>>org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11P >>>rocessor.java:1091) >>> at >>>org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abs >>>tractProtocol.java:668) >>> at >>>org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint >>>.java:1521) >>> at >>>org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.j >>>ava:1478) >>> at >>>java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav >>>a:1142) >>> at >>>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja >>>va:617) >>> at >>>org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThrea >>>d.java:61) >>> at java.lang.Thread.run(Thread.java:745) >>> Caused by: java.lang.ClassNotFoundException: >>>com.myapp.CustomGrantedAuth >>> at java.net.URLClassLoader.findClass(URLClassLoader.java:381) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Class.java:348) >>> at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626) >>> at >>>java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613) >>> at >>>java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) >>> at >>>java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774 >>>) >>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) >>> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) >>> at java.util.ArrayList.readObject(ArrayList.java:791) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav >>>a:62) >>> at >>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor >>>Impl.java:43) >>> at java.lang.reflect.Method.invoke(Method.java:497) >>> at >>>java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017) >>> at >>>java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896) >>> at >>>java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801 >>>) >>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) >>> at >>>java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) >>> at >>>java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) >>> at >>>java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801 >>>) >>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) >>> at >>>java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) >>> at >>>java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) >>> at >>>java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801 >>>) >>> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) >>> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) >>> at >>>org.springframework.security.oauth2.common.util.SerializationUtils.deser >>>ialize(SerializationUtils.java:32) >>> ... 59 more >>> DEBUG [http-nio-8080-exec-3] (ExceptionTranslationFilter.java:115) - >>>Chain processed normally >>> >>> >>> >>>> On 26-May-2015, at 3:17 pm, Mark Thomas <ma...@apache.org> wrote: >>>> >>>> On 26/05/2015 10:44, Aditya Chopra wrote: >>>>> Thanks for quick response Mark. >>>>> >>>>> JARs in /mylib are not dependent on JARs in web app. In fact its the >>>>>other way round. /mylib is having all Spring, hibernate jar¹s, other >>>>>common libs and WEB-INF/lib is containing jar of one of my >>>>>application modules. >>>>> The class for which i am getting ClassNotFoundException exception is >>>>>part of JAR present under WEB-INF/lib. >>>>> >>>>> I enabled the class loader logs and don¹t see that class getting >>>>>loaded on server startup. However, when i copy all JAR¹s from /mylib >>>>>to WEB-INF/lib, that class is getting loaded and i don¹t get the >>>>>ClassNotFoundException on runtime. >>>>> >>>>> Any thoughts what might be causing this? >>>> >>>> Yes. One of the JARs in /mylib depends on one of the JARs in >>>>WEB-INF/lib >>>> and that is not permitted. >>>> >>>> The dependency may not be obvious. If you provide the full stack trace >>>> we might be able to provide you with some pointers. >>>> >>>> Mark >>>> >>>>> >>>>> Aditya >>>>> >>>>>> On 26-May-2015, at 3:04 pm, Mark Thomas <ma...@apache.org> wrote: >>>>>> >>>>>> On 26/05/2015 08:36, Aditya Chopra wrote: >>>>>>> Hi, >>>>>>> >>>>>>> To reduce the size of my war file, i am trying to put all the jar >>>>>>>files being used by my web app in a separate folder /mylibs. I >>>>>>>added path to /mylibs folder under shared.loader property in >>>>>>>catalina.properties but on runtime i am getting a >>>>>>>ClassNotFoundException for one of the classes that is present in >>>>>>>one the project module jar under WEB-INF/lib folder. >>>>>>> >>>>>>> When i add all the libraries required by my project in WEB-INF/lib >>>>>>>folder my application works fine. However, when i put the libraries >>>>>>>in a separate /mylibs folder i get a ClassNotFoundException on >>>>>>>runtime. >>>>>>> >>>>>>> I suspect that it could be due to order in which the classes are >>>>>>>being loaded, so added a Loader component in my context.xml as >>>>>>>below, but that too didn¹t work. Can someone please help me on this? >>>>>> >>>>>> JARs in /mylibs must not depend on JARs in a web application. There >>>>>>is >>>>>> no configuration option that would enable you to bypass this >>>>>>restriction. >>>>>> >>>>>> Mark >>>>>> >>>>>> >>>>>> >>>>>>--------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org >>>>>> >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>>>> For additional commands, e-mail: users-h...@tomcat.apache.org >>>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>>> For additional commands, e-mail: users-h...@tomcat.apache.org >>>> >>> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >><mailto:users-unsubscr...@tomcat.apache.org> >> For additional commands, e-mail: users-h...@tomcat.apache.org >><mailto:users-h...@tomcat.apache.org> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org