Issue upgrading from 1.7.0 to 1.7.2

46 views
Skip to first unread message

forefr...@gmail.com

unread,
Apr 23, 2017, 10:58:31 PM4/23/17
to xnat_discussion
Hi,

I had successfully installed xnat 1.7.0 and was running just fine. I decided I should probably upgrade to 1.7.2. I followed the exact procedure that the documentation gives as follows

  1. If your Tomcat server is running, shut it down.
  2. Back up your current XNAT installation.
  3. Replace the existing XNAT war file with the upgraded version.
  4. If there is a folder in the webapps folder containing the "exploded" web application, delete that folder.
  5. Start Tomcat.
The issue is that when I go to restart tomcat xnat doesn't start up and I get this error in /data/xnat/home/logs/spring.log

2017-04-24 12:44:05,502 [http-bio-127.0.0.1-8080-exec-6] WARN  org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteConfigPreferenceHandler': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.nrg.prefs.events.AbstractPreferenceHandler.setAvailableMethods(java.util.List); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requiredChannelHandlerMethod' defined in file [/var/lib/tomcat/webapps/xnat/WEB-INF/classes/org/nrg/xnat/event/listeners/methods/RequiredChannelHandlerMethod.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
2017-04-24 12:44:05,564 [http-bio-127.0.0.1-8080-exec-6] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'siteConfigPreferenceHandler': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.nrg.prefs.events.AbstractPreferenceHandler.setAvailableMethods(java.util.List); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requiredChannelHandlerMethod' defined in file [/var/lib/tomcat/webapps/xnat/WEB-INF/classes/org/nrg/xnat/event/listeners/methods/RequiredChannelHandlerMethod.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:843)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5116)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1312)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:690)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.nrg.prefs.events.AbstractPreferenceHandler.setAvailableMethods(java.util.List); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requiredChannelHandlerMethod' defined in file [/var/lib/tomcat/webapps/xnat/WEB-INF/classes/org/nrg/xnat/event/listeners/methods/RequiredChannelHandlerMethod.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 47 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'requiredChannelHandlerMethod' defined in file [/var/lib/tomcat/webapps/xnat/WEB-INF/classes/org/nrg/xnat/event/listeners/methods/RequiredChannelHandlerMethod.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1148)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1075)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)
... 49 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in org.nrg.xnat.initialization.SecurityConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1123)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:814)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 62 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.nrg.xnat.security.TranslatingChannelProcessingFilter]: Factory method 'channelProcessingFilter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 75 more
Caused by: org.springframework.beans.factory.BeanCreationException: Unknown channel attribute 
at org.springframework.security.config.http.ChannelAttributeFactory.createChannelAttributes(ChannelAttributeFactory.java:35)
at org.nrg.xnat.security.TranslatingChannelProcessingFilter.setRequiredChannel(TranslatingChannelProcessingFilter.java:32)
at org.nrg.xnat.initialization.SecurityConfig.channelProcessingFilter(SecurityConfig.java:140)
at org.nrg.xnat.initialization.SecurityConfig$$EnhancerBySpringCGLIB$$f230f267.CGLIB$channelProcessingFilter$8(<generated>)
at org.nrg.xnat.initialization.SecurityConfig$$EnhancerBySpringCGLIB$$f230f267$$FastClassBySpringCGLIB$$6dc9aaaf.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at org.nrg.xnat.initialization.SecurityConfig$$EnhancerBySpringCGLIB$$f230f267.channelProcessingFilter(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 76 more

I've noticed that some other users are getting similar issues but their logs seem slightly different to mine. It looks like it's having an issue on initializing. I've tried searching various phrases from this log to see if anything comes up but I can't find anything. Interestingly if I roll back to 1.7.0 it all works just fine.

Anyway, I'm at a dead end and hoping someone could help me please.

Cheers,

Mic

forefr...@gmail.com

unread,
Apr 27, 2017, 8:56:02 PM4/27/17
to xnat_discussion
Bump...

Herrick, Rick

unread,
Apr 28, 2017, 10:01:55 AM4/28/17
to xnat_di...@googlegroups.com

That sounds like the value set for the security channel in your database is messed up, although why it would work in 1.7.0 and not 1.7.2 is unclear to me. Can you run this query and let me know what you get?

 

SELECT pref.value FROM xhbm_preference pref

LEFT JOIN xhbm_tool tool ON pref.tool = tool.id

WHERE tool.tool_id = 'siteConfig' AND pref.name = 'securityChannel';

 

The value returned must be one of http, https or any. Of course, the weird thing is that the value must be one of those three for 1.7.0 as well.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

 

Voice: (314) 273-1645

Web: http://www.xnat.org

Twitter: @NrgXnat

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

forefr...@gmail.com

unread,
May 3, 2017, 9:08:45 PM5/3/17
to xnat_discussion
Hi Rick,

Thanks for getting back to me. Yeah, it's a real mystery that's for sure.

I've run the query that you specified and it returns a single row with pref.value empty. I'll set it to https like it should be and see if that helps.

Cheers,

Mic

forefr...@gmail.com

unread,
May 4, 2017, 1:34:27 AM5/4/17
to xnat_discussion
So updating pref.name 

update xhbm_preference set value='http' where name='securityChannel';

fixed it for me however I've noticed there are a bunch of config values in xhbm_preference that are seemingly in there twice with two different variations.

Take for example securityChannel is also in there as security.channel. When you update securityChannel the change is not reflected in the user interface but it is when you update security.channel. I noticed this a lot when updating the smtp settings in xhbm_preference. It's like there are a whole heap of legacy fields in the database that have no effect.

Is this the case?


On Saturday, April 29, 2017 at 12:01:55 AM UTC+10, Rick Herrick wrote:

Herrick, Rick

unread,
May 4, 2017, 10:13:15 AM5/4/17
to xnat_di...@googlegroups.com

Yes, that’s the case. The issue is that we have a number of preferences that use what is basically Java properties file conventions for naming, e.g. security.channel. That naming convention causes some weirdness in a few places with the REST API and other places, so we’ve gone with the standard bean property format, e.g. securityChannel. The previous naming convention is supported through preference aliases, so the security channel setting looks like this:

 

@NrgPreference(defaultValue = "any", aliases = "security.channel")
public String getSecurityChannel() {
    return getValue("securityChannel");
}

 

During initialization, the preferences service looks for values that are not yet set and initializes them. It first looks for an instance of the preference that uses an alias and, if it finds one, sets the initial value to the value for that alias and, if not, initializes it to the default value. The general XNAT practice is to be non-destructive of data, so even with a migration like that we leave the old value sitting around. Honestly, I’m still not sure if that’s the correct thing to do in this case, but it is what’s in there at the moment. I may add a function to clean up aliased settings so that the service preserves the data by default but you’d have the option to clean up the aliases, but that’s not available right now.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

 

Reply all
Reply to author
Forward
0 new messages