Issue upgrading a site from 4.5.3 to 4.6 Beta

Any issue about installation and configuration of the Cyclos 4 version

Moderators: rmvanarkel, hugo, alexandre

Post Reply
simonjwoolf
Posts: 113
Joined: Mon May 28, 2012 8:49 am

Issue upgrading a site from 4.5.3 to 4.6 Beta

Post by simonjwoolf »

When upgrading from a working 4.5.3 install to 4.6 Beta, and then restarting Tomcat, the site no longer starts.
The upgrade was done by replacing the entire /web directory and copying in the pre-existing cyclos.properties file from the old version

The key issue appears to be:

Code: Select all

org/cyclos/bootstrap/ServicesBeanNameGenerator : Unsupported major.minor version 52.0 (unable to load class org.cyclos.bootstrap.ServicesBeanNameGenerator)
Here's the full trace from Catalina.out:

Code: Select all

Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8501"]
Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8502"]
Jun 21, 2016 12:55:26 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service bristol-stage
Jun 21, 2016 12:55:26 PM org.apache.catalina.util.LifecycleBase stop
INFO: The stop() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/cyclos]] after stop() had already been called. The second call will be ignored.
Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8501"]
Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8502"]
Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8501"]
Jun 21, 2016 12:55:26 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8502"]
Jun 21, 2016 12:55:28 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8501"]
Jun 21, 2016 12:55:28 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8502"]
Jun 21, 2016 12:55:28 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 441 ms
Jun 21, 2016 12:55:28 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service bristol-stage
Jun 21, 2016 12:55:28 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Jun 21, 2016 12:55:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/local/sites/bristol-stage/tomcat/webapps/cyclos
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
12:55:29,788 ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring/services.xml]; nested exception is java.lang.UnsupportedClassVersionError: org/cyclos/bootstrap/ServicesBeanNameGenerator : Unsupported major.minor version 52.0 (unable to load class org.cyclos.bootstrap.ServicesBeanNameGenerator)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510)
	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:4779)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: org/cyclos/bootstrap/ServicesBeanNameGenerator : Unsupported major.minor version 52.0 (unable to load class org.cyclos.bootstrap.ServicesBeanNameGenerator)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2840)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1668)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.instantiateUserDefinedStrategy(ComponentScanBeanDefinitionParser.java:263)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parseBeanNameGenerator(ComponentScanBeanDefinitionParser.java:161)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:111)
	at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:86)
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411)
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:168)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:138)
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
	... 26 more
Jun 21, 2016 12:55:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jun 21, 2016 12:55:29 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/cyclos] startup failed due to previous errors
12:55:29,814  WARN XmlWebApplicationContext - Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue Jun 21 12:55:29 BST 2016]; root of context hierarchy
	at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:415)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:975)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:934)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:581)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5466)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Jun 21, 2016 12:55:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8501"]
Jun 21, 2016 12:55:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8502"]
Jun 21, 2016 12:55:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1289 ms
---
Simon Woolf
Cyclos Consultant
simonjwoolf
Posts: 113
Joined: Mon May 28, 2012 8:49 am

Re: Issue upgrading a site from 4.5.3 to 4.6 Beta

Post by simonjwoolf »

OK, so from a quick google it seems this refers to a JRE version mismatch.

From 4.6 do we need to upgrade to JRE 1.8?

Code: Select all

# java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
---
Simon Woolf
Cyclos Consultant
rmvanarkel
Posts: 248
Joined: Tue Oct 05, 2010 1:14 pm

Re: Issue upgrading a site from 4.5.3 to 4.6 Beta

Post by rmvanarkel »

Yes, please check the release note:

- This is a Beta version, please don't use it at a production environment as it can contain bugs. Also there is no compatible mobile app version for it. But enjoy the preview of all the exiting new features!
- Cyclos 4.6 now requires Java 8
- New REST API, accessible through [/network]/api. This API is not stable yet, and is still subject to change.

IMPORTANT: If you have an error during the first startup, and later on the products (or administrator group permissions) gives an error, you should manually run the following commands in the database in order to fix the issue:

alter table products_ad_custom_fields
drop constraint products_ad_custom_fields_pkey;

alter table products_ad_custom_fields
add column id bigserial not null,
add column subclass varchar(31) default 'MY' not null,
add column manage boolean not null default true,
add column version integer not null default 0,
add column view boolean not null default true,
add column enable boolean default true,
add primary key (id);

alter table products_ad_custom_fields
alter column subclass drop default,
alter column manage drop default,
alter column version drop default,
alter column view drop default,
alter column enable drop default;

alter table products_ad_custom_fields
add constraint uk_products_ad_custom_fields unique (subclass, product_id, custom_field_id);

insert into products_ad_custom_fields(product_id, custom_field_id, subclass, view, manage, version)
select distinct product_id, f.id, 'USER', true, true, 0 from products_permissions pp, ad_custom_fields f, products p
where pp.permission = 'USER_ADS_MANAGE'
and pp.product_id = p.id
and f.network_id = p.network_id;
simonjwoolf
Posts: 113
Joined: Mon May 28, 2012 8:49 am

Re: Issue upgrading a site from 4.5.3 to 4.6 Beta

Post by simonjwoolf »

Thanks, Mea Culpa that I didn't read the notes properly.

Still awaiting confirmation about whether earlier versions of Cyclos can run with Java 8, or whether we would have to have a mixed Java environment (v 7 & 8 on same server, with different Tomcat instances) if we are running a production site that is on 4.5.3 and a staging site on 4.6 Beta
---
Simon Woolf
Cyclos Consultant
simonjwoolf
Posts: 113
Joined: Mon May 28, 2012 8:49 am

Re: Issue upgrading a site from 4.5.3 to 4.6 Beta

Post by simonjwoolf »

In case this is useful for others, I have been told that Cyclos 4.4 and higher should all work OK with Java 8 - but only in production, not in development (not sure why....).

I haven't tested this yet.
---
Simon Woolf
Cyclos Consultant
Post Reply