Hi everybody, We like to create a custom Form processor that instead of sending mails, leverage an API using REST to post data.
We tried many things but we keep running into ClassNotFoundExceptions: 2014-04-02 13:41:45,196 WARN magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl: can't resolve class for node /modules/form/templates/components/form/formProcessors/apiProcessor java.lang.ClassNotFoundException: com.mycompany.magnolia.form.ApiProcessor I have tried to follow up the relevant documentation at - http://documentation.magnolia-cms.com/display/DOCS/Form+module#Formmodule-Creatingacustomformprocessor - http://forums.magnolia-cms.com/forum/thread.html?threadId=21a92a59-d487-438d-b3be-0271af17644f And then dozens other sites I found on google which sometimes seem to be related, and often not. What I did thusfar: I first tried to configure the class in magnolia by duplicating /modules/form/templates/components/form/formProcessors/trackEmail to /modules/form/templates/components/form/formProcessors/apiProcessor and changing the class property. I then got the error and tried referencing the class as a component in my module.xml (although I am not sure that is what I am supposed to be doing) Inside module.xml: <module> .. <components> <id>main</id> <component> <type>com.mycompany.magnolia.form.ApiProcessor</type> <implementation>com.mycompany.magnolia.form.ApiProcessorImpl</implementation> </component> <type-mapping> <type>com.mycompany.magnolia.form.ApiProcessor</type> <implementation>com.mycompany.magnolia.form.ApiProcessorImpl</implementation> </type-mapping> </components> <dependencies> <dependency> <name>core</name> <version>${magnoliaVersion}</version> </dependency> <dependency> <name>form</name> <version>2.1</version> </dependency> </dependencies> </module> I then tried to create a completely new module based on the magnolia artifact, but get the same error and stacktrace: 2014-04-02 13:41:45,196 WARN magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl: can't resolve class for node /modules/form/templates/components/form/formProcessors/apiProcessor java.lang.ClassNotFoundException: com.mycompany.magnolia.form.ApiProcessor at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:696) at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:564) at info.magnolia.module.groovy.support.classes.GroovyClassFactory.forName(GroovyClassFactory.java:95) at info.magnolia.jcr.node2bean.impl.Node2BeanTransformerImpl.resolveType(Node2BeanTransformerImpl.java:151) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:117) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toMap(Node2BeanProcessorImpl.java:227) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:132) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toMap(Node2BeanProcessorImpl.java:227) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:132) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:94) at info.magnolia.rendering.template.registry.ConfiguredTemplateDefinitionProvider.<init>(ConfiguredTemplateDefinitionProvider.java:55) at info.magnolia.rendering.template.registry.ConfiguredTemplateDefinitionManager.readProvider(ConfiguredTemplateDefinitionManager.java:103) at info.magnolia.rendering.template.registry.ConfiguredTemplateDefinitionManager$1.visit(ConfiguredTemplateDefinitionManager.java:86) at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:654) at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:656) at info.magnolia.rendering.template.registry.ConfiguredTemplateDefinitionManager.reload(ConfiguredTemplateDefinitionManager.java:81) at info.magnolia.cms.util.ModuleConfigurationObservingManager.reload(ModuleConfigurationObservingManager.java:112) at info.magnolia.cms.util.ModuleConfigurationObservingManager.start(ModuleConfigurationObservingManager.java:105) at info.magnolia.rendering.module.RenderingModule.start(RenderingModule.java:60) at info.magnolia.module.ModuleManagerImpl.startModule(ModuleManagerImpl.java:399) at info.magnolia.module.ModuleManagerImpl.startModules(ModuleManagerImpl.java:344) at info.magnolia.module.ui.ModuleManagerWebUI.onStartup(ModuleManagerWebUI.java:79) at info.magnolia.cms.beans.config.ConfigLoader.load(ConfigLoader.java:149) at info.magnolia.init.MagnoliaServletContextListener$1.doExec(MagnoliaServletContextListener.java:248) at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:414) at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:411) at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:385) at info.magnolia.init.MagnoliaServletContextListener.startServer(MagnoliaServletContextListener.java:245) at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:171) at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:125) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 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:744) I changed interchanging the class property in the magnolia configuration for the Impl class, but that doesn't seem to help. I also copied the complete /modules/form/templates/components/form into a new node, removing the other processors and just leaving mine. The same error. I then moved the node to my earlier module templates section, but nothing changed. As you can see I am quite new to magnolia, so might have some important concepts regarding class loading, although I feel I have at least seen most of the documentation on the subject. Can anybody help, or point me to some more detailed documentation than seems to be available through Google? Kind regards, Arnoud -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=d80fbc62-014f-40d0-ba86-a7997397fab8 ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
