Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alfresco 6.2.1 missing cglib causes failure of eu.xenit.de.control-panel #306

Closed
RVanhuysseXenit opened this issue Jul 16, 2020 · 1 comment · Fixed by #307
Closed

Alfresco 6.2.1 missing cglib causes failure of eu.xenit.de.control-panel #306

RVanhuysseXenit opened this issue Jul 16, 2020 · 1 comment · Fixed by #307
Labels

Comments

@RVanhuysseXenit
Copy link
Contributor

I'm submitting a ... (check one with "x")

[X] bug report
[ ] feature request
[ ] question

Expected Behavior

When installing alfresco-dynamic-extensions-repo-62:2.0.4 (+alfresco-hotfix-MNT-20557:1.0.2) on hub.xenit.eu/alfresco-enterprise/alfresco-repository-enterprise:6.2.1, dynamic-extensions starts up without error.

Current Behavior

The dynamic-extensions dashboard is not available after startup, the following error is thrown:

[ALFRESCO] 2020-07-16 12:58:33,815  INFO  [repo.module.ModuleServiceImpl] [localhost-startStop-1] Found 4 module package(s).
[ALFRESCO] 2020-07-16 12:58:33,834  INFO  [repo.module.ModuleServiceImpl] [localhost-startStop-1] Installing module 'eu.xenit.alfresco.alfresco-hotfix-MNT-20557' version 1.0.2.
[ALFRESCO] 2020-07-16 12:58:33,851  INFO  [repo.module.ModuleServiceImpl] [localhost-startStop-1] Installing module 'alfresco-dynamic-extensions-repo' version 2.0.4.
[ALFRESCO] 2020-07-16 12:58:34,934  WARN  [dynamicextensionsalfresco.osgi.DefaultFrameworkManager] [localhost-startStop-1] Could not resolve all 6 bundles.
[ALFRESCO] 2020-07-16 12:58:35,275  ERROR [dynamicextensionsalfresco.osgi.DefaultFrameworkManager] [localhost-startStop-1] Bundle eu.xenit.de.control-panel failed to resolve. State: 2
[ALFRESCO] 2020-07-16 12:58:35,279  ERROR [dynamicextensionsalfresco.osgi.DefaultFrameworkManager] [localhost-startStop-1] Error starting bundle eu.xenit.de.control-panel:
org.osgi.framework.BundleException: Unable to resolve eu.xenit.de.control-panel [5](R 5.0): missing requirement [eu.xenit.de.control-panel [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=net.sf.cglib.core) Unresolved requirements: [[eu.xenit.de.control-panel [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=net.sf.cglib.core)]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
	at com.github.dynamicextensionsalfresco.osgi.DefaultFrameworkManager.startBundle(DefaultFrameworkManager.java:209)
	at com.github.dynamicextensionsalfresco.osgi.DefaultFrameworkManager.startBundles(DefaultFrameworkManager.java:201)
	at com.github.dynamicextensionsalfresco.osgi.DefaultFrameworkManager.initialize(DefaultFrameworkManager.java:93)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1897)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1839)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1767)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:860)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at com.github.dynamicextensionsalfresco.osgi.OsgiContainerModuleComponent.initializeOsgiContainerApplicationContext(OsgiContainerModuleComponent.java:113)
	at com.github.dynamicextensionsalfresco.osgi.OsgiContainerModuleComponent.startFramework(OsgiContainerModuleComponent.java:100)
	at com.github.dynamicextensionsalfresco.osgi.OsgiContainerModuleComponent.executeInternal(OsgiContainerModuleComponent.java:60)
	at org.alfresco.repo.module.AbstractModuleComponent.execute(AbstractModuleComponent.java:361)
	at org.alfresco.repo.module.ModuleComponentHelper.executeComponent(ModuleComponentHelper.java:736)
	at org.alfresco.repo.module.ModuleComponentHelper.startModule(ModuleComponentHelper.java:647)
	at org.alfresco.repo.module.ModuleComponentHelper.access$5(ModuleComponentHelper.java:530)
	at org.alfresco.repo.module.ModuleComponentHelper$1$1.execute(ModuleComponentHelper.java:263)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
	at org.alfresco.repo.module.ModuleComponentHelper$1.doWork(ModuleComponentHelper.java:284)
	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602)
	at org.alfresco.repo.module.ModuleComponentHelper.startModules(ModuleComponentHelper.java:213)
	at org.alfresco.repo.module.ModuleServiceImpl.startModules(ModuleServiceImpl.java:149)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy142.startModules(Unknown Source)
	at org.alfresco.repo.module.ModuleStarter$1.execute(ModuleStarter.java:73)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
	at org.alfresco.repo.module.ModuleStarter$2.doWork(ModuleStarter.java:83)
	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602)
	at org.alfresco.repo.module.ModuleStarter.onBootstrap(ModuleStarter.java:78)
	at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221)
	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186)
	at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
	at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Inspection of the environment yielded the following:

Possible Solution

Include appropriate cglib in alfresco-dynamic-extensions-repo-62

Steps to Reproduce (for bugs)

https://github.com/xenit-eu/alfred-api/tree/ALFREDAPI-418

./gradlew :apix-docker:docker-62:composeUp

Context

Issue discoverd during testing of alfredapi against alfresco 6.2

Your Environment

  • Alfresco version used: 6.2.1
  • DE version used: 2.0.4
  • java version: openjdk 11.0.7 2020-04-14
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
@kerkhofsd
Copy link
Contributor

kerkhofsd commented Jul 16, 2020

Thanks for this report @RVanhuysseXenit !

Root cause: control-panel bundle explicitly adds net.sf.cglib packages to the Import-Package header:

            'Import-Package': 'javax.annotation;version=!, ' +
                    'net.sf.cglib.core, ' +
                    'net.sf.cglib.proxy, ' +
                    'net.sf.cglib.reflect, ' +
                    'org.aopalliance.aop, ' +
                    'org.aopalliance.intercept, ' +
                    'org.springframework.aop, ' +
                    'org.springframework.aop.framework, ' +
                    '* '

However the cglib jar has been removed since Alfresco 6.2.1 (REPO-4802).

As far as my knowledge goes on this, I think actually we don't need to include the net.sf.sglib packages in the Import-Package header as of Spring 3.2.

Also note that starting with Spring 3.2, there is no need to define the CGLIB dependency (now upgraded to CGLIB 3.0) – it has been repackaged (the all net.sf.cglib package is now org.springframework.cglib) and inlined directly within the spring-core JAR (see the JIRA for additional details). (https://www.baeldung.com/spring-with-maven)

Since our lowest supported version is Alfresco 5.0.d, Spring 3.2.10, I think the appropriate fix is removing the net.sf.cglib imports from the control-panel bundle.
As an additional test to make sure the Spring proxy magic seems to work, I would include a @Configuration annotated class in the test-bundle.

@kerkhofsd kerkhofsd changed the title Missing cglib causes failure of eu.xenit.de.control-panel Alfresco 6.2.1 missing cglib causes failure of eu.xenit.de.control-panel Jul 16, 2020
kerkhofsd pushed a commit that referenced this issue Jul 17, 2020
kerkhofsd added a commit that referenced this issue Jul 30, 2020
#306 Remove net.sf.cglib imports from control-panel Import-Package header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants