1 2 Previous Next 16 Replies Latest reply on Oct 26, 2015 10:00 AM by blawrence

    example extension->sample filter->class not found?

    blawrence

      So I've been struggling with this for a few days now.  I'm want to add a custom filter into the portal.  This filter is defined in a Java class in the extension ear.  According to the docs, this should be do-able and everything points to the example extension for reference.

      I followed the example, but I cannot get it to work.

      So I decided to build the sample extension and deploy it.  I've deployed the sample extension ear which includes the SampleFilter to include in the portal but it still doesn't work.  I keep running into ClassNotFoundExceptions.  The only way I can get it to work is if I put the jar file containing the org.exoplatform.sample.ext.web.SampleFilter into gatein.ear or gatein.ear/portal.war.  From what I understand, modifying the portal war this way is not the way this should be done anymore and stuff should be put into the extension.

      I've seen posts where people have said they got it working and even pasted stacktraces that show me its getting called, so I have no idea what I'm doing wrong.

      Its like the classloader that loads up the portal can't find the classes in my extension.

      I started using GateIn 3.7 on JBoss AS 7.1.1 and couldn't get it to work so I just downloaded the most recent distribution (JPP 6.1 on JBoss 7.1.2) to see if that was the issue and run into the same problem there.

      Can anyone explain to me what the problem is?

      Here is the exception stacktrace:

       

      16:48:47,987 ERROR [exo.kernel.container.XMLObject] (MSC service thread 1-6) ERROR: Cannot set  field: filter of org.exoplatform.web.filter.FilterDefinition: java.lang.ClassNotFoundException: org.exoplatform.sample.ext.web.SampleFilter
              at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [rt.jar:1.6.0_21]
              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_21]
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [rt.jar:1.6.0_21]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [rt.jar:1.6.0_21]
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [rt.jar:1.6.0_21]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [rt.jar:1.6.0_21]
              at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_21]
              at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_21]
              at org.exoplatform.commons.utils.ClassLoading.forName(ClassLoading.java:112) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.commons.utils.ClassLoading.forName(ClassLoading.java:48) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLObject.toObject(XMLObject.java:176) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLBaseObject.getObjectValue(XMLBaseObject.java:132) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLObject.toObject(XMLObject.java:185) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ObjectParameter.setXMLObject(ObjectParameter.java:58) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ObjectParameter.JiBX_binding_unmarshal_2_0(ObjectParameter.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingObjectParameter_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.InitParams.JiBX_binding_unmarshal_3_0(InitParams.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingInitParams_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ComponentPlugin.JiBX_binding_unmarshal_1_0(ComponentPlugin.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingComponentPlugin_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_3() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ExternalComponentPlugins.JiBX_binding_unmarshal_1_0(ExternalComponentPlugins.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingExternalComponentPlugins_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.Configuration.JiBX_binding_unmarshal_1_0(Configuration.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingConfiguration_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
              at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2948)
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller$2.run(ConfigurationUnmarshaller.java:283) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller$2.run(ConfigurationUnmarshaller.java:246) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.commons.utils.SecurityHelper.doPrivilegedExceptionAction(SecurityHelper.java:310) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller.unmarshall(ConfigurationUnmarshaller.java:245) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.importConf(ConfigurationManagerImpl.java:233) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.importConf(ConfigurationManagerImpl.java:202) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.addConfiguration(ConfigurationManagerImpl.java:181) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.addConfiguration(ConfigurationManagerImpl.java:120) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.RootContainer.createPortalContainer(RootContainer.java:654) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.RootContainer.createPortalContainers(RootContainer.java:346) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.gatein.integration.jboss.as7.web.StartupService.start(StartupService.java:45)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
      
      16:48:48,017 ERROR [exo.kernel.container.ConfigurationManagerImpl] (MSC service thread 1-6) Cannot process the configuration jndi:/default-host/sample-ext/WEB-INF/conf/sample-ext/web/web-inf-extension-configuration.xml: org.jibx.runtime.JiBXException: Error while unmarshalling (line 66, col 10)
              at org.exoplatform.container.xml.ObjectParameter.JiBX_binding_unmarshal_2_0(ObjectParameter.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingObjectParameter_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.InitParams.JiBX_binding_unmarshal_3_0(InitParams.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingInitParams_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ComponentPlugin.JiBX_binding_unmarshal_1_0(ComponentPlugin.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingComponentPlugin_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_3() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ExternalComponentPlugins.JiBX_binding_unmarshal_1_0(ExternalComponentPlugins.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingExternalComponentPlugins_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.Configuration.JiBX_binding_unmarshal_1_0(Configuration.java) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.JiBX_bindingConfiguration_access.unmarshal() [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
              at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2948)
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller$2.run(ConfigurationUnmarshaller.java:283) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller$2.run(ConfigurationUnmarshaller.java:246) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.commons.utils.SecurityHelper.doPrivilegedExceptionAction(SecurityHelper.java:310) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationUnmarshaller.unmarshall(ConfigurationUnmarshaller.java:245) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.importConf(ConfigurationManagerImpl.java:233) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.importConf(ConfigurationManagerImpl.java:202) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.addConfiguration(ConfigurationManagerImpl.java:181) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.configuration.ConfigurationManagerImpl.addConfiguration(ConfigurationManagerImpl.java:120) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.RootContainer.createPortalContainer(RootContainer.java:654) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.RootContainer.createPortalContainers(RootContainer.java:346) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.gatein.integration.jboss.as7.web.StartupService.start(StartupService.java:45)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]
              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
      Caused by: java.lang.ClassNotFoundException: org.exoplatform.sample.ext.web.SampleFilter
              at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [rt.jar:1.6.0_21]
              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_21]
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [rt.jar:1.6.0_21]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [rt.jar:1.6.0_21]
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [rt.jar:1.6.0_21]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [rt.jar:1.6.0_21]
              at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_21]
              at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_21]
              at org.exoplatform.commons.utils.ClassLoading.forName(ClassLoading.java:112) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.commons.utils.ClassLoading.forName(ClassLoading.java:48) [exo.kernel.commons-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLObject.toObject(XMLObject.java:176) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLBaseObject.getObjectValue(XMLBaseObject.java:132) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.xml.object.XMLObject.toObject(XMLObject.java:185) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              at org.exoplatform.container.xml.ObjectParameter.setXMLObject(ObjectParameter.java:58) [exo.kernel.container-2.4.4-GA-redhat-2.jar:2.4.4-GA-redhat-2]
              ... 29 more
      
        1 2 Previous Next