[JRDVX-8] Updating to 5.6 breaks module installation Created: 03/Dec/17  Updated: 06/Mar/18  Resolved: 06/Mar/18

Status: Closed
Project: DavEx Integration
Component/s: None
Affects Version/s: 0.2
Fix Version/s: 0.3

Type: Bug Priority: Neutral
Reporter: Michael Dähnert Assignee: Richard Gange
Resolution: Fixed Votes: 0
Labels: architecture, core, maintenance
Remaining Estimate: 0d
Time Spent: 1d
Original Estimate: Not Specified
Environment:

Magnolia 5.6


Attachments: File 2018-02-19_patch.diff    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Error:

java.lang.NoSuchMethodError: info.magnolia.module.InstallContext.getConfigHierarchyManager()Linfo/magnolia/cms/core/HierarchyManager

Code:

  protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException {
    NodeData methodsProp = ctx.getConfigHierarchyManager().getContent("/server/IPConfig/allow-all").getNodeData("methods");

Stacktrace:

java.lang.NoSuchMethodError: info.magnolia.module.InstallContext.getConfigHierarchyManager()Linfo/magnolia/cms/core/HierarchyManager;
	at info.magnolia.jackrabbit.davex.setup.HttpMethodsTask.doExecute(HttpMethodsTask.java:66) ~[magnolia-module-jackrabbit-davex-0.2.jar:?]
	at info.magnolia.module.delta.AbstractRepositoryTask.execute(AbstractRepositoryTask.java:57) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:511) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:493) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:279) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:407) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:404) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:378) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.performInstallOrUpdate(ModuleManagerImpl.java:273) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ui.ModuleManagerWebUI$2.run(ModuleManagerWebUI.java:126) [magnolia-core-5.6.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
2017-12-03 08:56:20,192 ERROR info.magnolia.module.InstallContextImpl           : [70/707 tasks - null]> Could not perform installation: info.magnolia.module.InstallContext.getConfigHierarchyManager()Linfo/magnolia/cms/core/HierarchyManager;
java.lang.NoSuchMethodError: info.magnolia.module.InstallContext.getConfigHierarchyManager()Linfo/magnolia/cms/core/HierarchyManager;
	at info.magnolia.jackrabbit.davex.setup.HttpMethodsTask.doExecute(HttpMethodsTask.java:66) ~[magnolia-module-jackrabbit-davex-0.2.jar:?]
	at info.magnolia.module.delta.AbstractRepositoryTask.execute(AbstractRepositoryTask.java:57) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:511) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:493) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:279) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:407) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:404) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:378) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ModuleManagerImpl.performInstallOrUpdate(ModuleManagerImpl.java:273) ~[magnolia-core-5.6.jar:?]
	at info.magnolia.module.ui.ModuleManagerWebUI$2.run(ModuleManagerWebUI.java:126) [magnolia-core-5.6.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
2017-12-03 08:56:20,511 INFO  fo.magnolia.objectfactory.ObservedComponentFactory: Re-loaded info.magnolia.freemarker.FreemarkerConfig from node /server/rendering/freemarker


 Comments   
Comment by Michael Dähnert [ 08/Jan/18 ]

Hi @Richard,

did you worked it out? Please let me know, if I can support your work on this, because I'm unable to upgrade as long as this issue persists.

Thanks a lot
Michael

Comment by Richard Gange [ 31/Jan/18 ]

Hi JaXt0r-

Sorry for my delays. I was working on it before the Christmas holidays and hit some problems with the structure of the module. I have just returned from holidays I need to dig back into this. Hopefully I can get something released in the upcoming weeks. Just out of curiosity, is your project enterprise or community based?

Cheers
Rich

Comment by Michael Dähnert [ 01/Feb/18 ]

Thanks for the reply, Richard,

We're using magnolia's community version.
Please let me know, if you want to have any support on that. So that I can support by making a git pull request or sth. like that.

Best regards
Michael

Comment by Richard Gange [ 02/Feb/18 ]

Sure Michael! No problem at all. I'll let you know my progress.

Comment by Richard Gange [ 16/Feb/18 ]

Hi Michael-

I had some time today to look at this again. The code is compiling just fine but I am still having some problems with SetupTest.java.

-------------------------------------------------------------------------------
Test set: info.magnolia.jackrabbit.davex.setup.SetupTest
-------------------------------------------------------------------------------
Tests run: 9, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 103.034 sec <<< FAILURE!
httpMethodsAreRegisteredOnInstallWithValuesAlreadySetForDavex(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 18.347 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnInstallWithValuesAlreadySetForDavex(SetupTest.java:109)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
httpMethodsAreRegisteredOnUpdateFrom01WhenDefaultValuesAreStillSet(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.78 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnUpdateFrom01WhenDefaultValuesAreStillSet(SetupTest.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
httpMethodsAreRegisteredOnUpdateFrom01WhenWebDAVValuesAreAlreadySet(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.681 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnUpdateFrom01WhenWebDAVValuesAreAlreadySet(SetupTest.java:116)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
httpMethodsAreRegisteredOnUpdateFrom01WhenDavexValuesAreAlreadySet(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.6 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnUpdateFrom01WhenDavexValuesAreAlreadySet(SetupTest.java:125)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
httpMethodsAreRegisteredOnInstallWhenWebDAVValuesAreAlreadySet(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.552 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnInstallWhenWebDAVValuesAreAlreadySet(SetupTest.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
ignoreWhiteSpaceOrderAndUnknownMethodsWhenHttpMethodsAreUpdated(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.526 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.ignoreWhiteSpaceOrderAndUnknownMethodsWhenHttpMethodsAreUpdated(SetupTest.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
httpMethodsAreRegisteredOnInstallWithDefaultValues(info.magnolia.jackrabbit.davex.setup.SetupTest)  Time elapsed: 10.494 sec  <<< ERROR!
java.lang.ClassCastException: $java.util.LinkedHashMap$$EnhancerByCGLIB$$46ea0def cannot be cast to info.magnolia.cms.security.IPSecurityManager
	at info.magnolia.jackrabbit.davex.setup.SetupTest.getAllowedMethods(SetupTest.java:147)
	at info.magnolia.jackrabbit.davex.setup.SetupTest.httpMethodsAreRegisteredOnInstallWithDefaultValues(SetupTest.java:94)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

This is where I left off.

Comment by Michael Dähnert [ 18/Feb/18 ]

Thanks for the feedback on your progress.
I'm glad to hear you're already on SetupTesting.

Can't wait to hear your next positive result.

Comment by Richard Gange [ 19/Feb/18 ]

Yeah, but the problem is I don't know how to fix it. So this is why I have not released the fixed version yet. Do you happen to have any ideas? I've been asking around the office but no one has been able to assist me.

Comment by Michael Dähnert [ 19/Feb/18 ]

Description of the error:
Magnolia will transform its previously set content-structure into an object. If there is no 'class' property in the requested tree-element, it will treat it as a HashMap and convert it so.

Solution:
I added the required 'class' property and now we get the right object without ClassCastExceptions.

Further investigations:
I checked the other open source code from your git-repository, but I couldn't find another usage of this structure

setupProperty(...);
SomeClass someClass = Components.getComponent(SomeClass.class);

The only way magnolia uses elements after setupProperty(...) is

// https://git.magnolia-cms.com/projects/MODULES/repos/demo-projects/browse/enterprise/magnolia-travel-demo-multisite/src/test/java/info/magnolia/demo/travel/multisite/setup/TravelDemoMultiSiteModuleVersionHandlerTest.java#139-140
session.getNode("/modules/multisite/config/sites/sportstation/templates"), hasProperty("prototypeId", "travel-demo-multisite:pages/prototype")

Maybe setupProperty() is broken and should not be used for tests any longer?

I added a tiny patch, which will have the IpSecurityManager convert itself to the instance we require.

Further problems:
Now it converts like a charm, but the .getRules() method will throw a NPE.

Question:
Ist this test really this important? It seems of no importance to me. Maybe it will be sufficient to have the remaining tests only.

Comment by Richard Gange [ 20/Feb/18 ]

Awesome, thanks for this feedback. It's probably the best idea. Just remove the parts that are broken.

Comment by Michael Dähnert [ 20/Feb/18 ]

I'll change it and also have a look at updating our test-environment with the new version of your module.
So I can provide you with feedback on a productive system.

I think I can handle it even this week.

Later
Michael

Comment by Richard Gange [ 21/Feb/18 ]

Ok, I went ahead and completely removed the SetupTest class. Try 0.3-SNAPSHOT. If that works ok I will do a release.

Cheers

Comment by Michael Dähnert [ 01/Mar/18 ]

Sorry for the late reply. Somehow I overlooked the Jira notification.

I'll check it ASAP
Thanks.

Comment by Michael Dähnert [ 03/Mar/18 ]

I checked it and your version works like a charm.
You can now release it, if you like.

Thanks a lot for your efforts.

Best regards
Michael

Comment by Richard Gange [ 06/Mar/18 ]

Released v0.3 today.

Generated at Mon Feb 12 00:42:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.