MyFaces Orchestra
  1. MyFaces Orchestra
  2. ORCHESTRA-50

Unresolved dependency of org.apache.commons.el.Logger

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Deploying to Glassfish v2

      Description

      When deploying an application that uses Orchestra Core 1.3.1, I get a ClassNotFoundException on org.apache.commons.el.Logger. The work around is of course to manually download Apache Commons EL and add is as a dependency. The solution to this bug can be:

      • removing the dependency
      • mentioning the dependency in the docs.

      Stack trace:
      java.lang.NoClassDefFoundError: org/apache/commons/el/Logger
      at org.apache.myfaces.shared_orchestra.util.ClassUtils.<clinit>(ClassUtils.java:44)
      at org.apache.myfaces.orchestra.annotation.spring.AnnotationsInfoInitializer.postProcessBeanFactory(AnnotationsInfoInitializer.java:93)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:553)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:536)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:362)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4523)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
      at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1147)
      at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:141)
      at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
      at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
      at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
      at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
      at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
      at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
      at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
      at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:276)
      at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:294)
      at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:555)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
      at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
      at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
      at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
      at $Proxy1.invoke(Unknown Source)
      at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
      at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
      at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(AutoDeployer.java:564)
      at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArchive(AutoDeployer.java:545)
      at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:492)
      at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:267)
      at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeployTask.run(AutoDeployControllerImpl.java:374)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.lang.ClassNotFoundException: org.apache.commons.el.Logger
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 58 more

      1. ORCHESTRA-50-shared.patch
        59 kB
        Leonardo Uribe
      2. ORCHESTRA-50-core.patch
        7 kB
        Leonardo Uribe

        Activity

        Hide
        Aleksei Valikov added a comment -

        I can reproduce it with the version 1.4.
        The solution is to add the commons-el dependency:

        		<dependency>
        			<groupId>commons-el</groupId>
        			<artifactId>commons-el</artifactId>
        			<version>1.0</version>
        		</dependency>
        

        However it's quite upsetting that commons-el is needed - because of only two things - Logger and Coercions.

        Show
        Aleksei Valikov added a comment - I can reproduce it with the version 1.4. The solution is to add the commons-el dependency: <dependency> <groupId>commons-el</groupId> <artifactId>commons-el</artifactId> <version>1.0</version> </dependency> However it's quite upsetting that commons-el is needed - because of only two things - Logger and Coercions.
        Hide
        Mario Ivankovits added a comment -

        Hmmm ... The shared_* packages are generated out of the common myfaces shared stuff.

        So, this needs to be fixed in myfaces - if this can be fixed at all.

        I'll move this issue.

        Show
        Mario Ivankovits added a comment - Hmmm ... The shared_* packages are generated out of the common myfaces shared stuff. So, this needs to be fixed in myfaces - if this can be fixed at all. I'll move this issue.
        Hide
        Mario Ivankovits added a comment -

        Could someone of the MyFaces masters please have a look at it.

        Thanks!

        Show
        Mario Ivankovits added a comment - Could someone of the MyFaces masters please have a look at it. Thanks!
        Hide
        Aleksei Valikov added a comment -

        Do you really HAVE to use this org.apache.myfaces.shared_orchestra.util.ClassUtils class for one single ClassUtils.classForName(...)?

        Generally you now have something like four references to shared_orchestra:

        • org.apache.myfaces.shared_orchestra.util.ClassUtils
        • org.apache.myfaces.shared_orchestra.util.StringUtils
        • org.apache.myfaces.shared_orchestra.renderkit.RendererUtils
        • org.apache.myfaces.shared_orchestra.taglib.UIComponentTagBase

        I'd say it is worth considering, if you really need all this "shared" stuff for just four utility dependencies.

        Show
        Aleksei Valikov added a comment - Do you really HAVE to use this org.apache.myfaces.shared_orchestra.util.ClassUtils class for one single ClassUtils.classForName(...)? Generally you now have something like four references to shared_orchestra: org.apache.myfaces.shared_orchestra.util.ClassUtils org.apache.myfaces.shared_orchestra.util.StringUtils org.apache.myfaces.shared_orchestra.renderkit.RendererUtils org.apache.myfaces.shared_orchestra.taglib.UIComponentTagBase I'd say it is worth considering, if you really need all this "shared" stuff for just four utility dependencies.
        Hide
        Jakob Korherr added a comment -

        I don't think this is a MyFaces core problem. Take a look at the code that calls ClassUtils.classForName(): org.apache.myfaces.orchestra.annotation.spring.AnnotationsInfoInitializer.postProcessBeanFactory

        This method simply gets all class names from the bean definitions from the given ConfigurableListableBeanFactory and tries to retrieve the right Class Objects via ClassUtils.classForName(). Unfortunately org.apache.commons.el.Logger seems to be one of the beans from the ConfigurableListableBeanFactory and thus it has to be on the classpath in order to function properly.

        The code from MyFaces shared has no relation to org.apache.commons.el.Logger and thus it does not need this dependency. It's just used by Orchestra to retrieve the right Class object in this scenario.

        So this is either a configuration problem (is org.apache.commons.el.Logger really supposed to be a bean?) or a missing orchestra dependency. Thus, I will close this as invalid.

        Show
        Jakob Korherr added a comment - I don't think this is a MyFaces core problem. Take a look at the code that calls ClassUtils.classForName(): org.apache.myfaces.orchestra.annotation.spring.AnnotationsInfoInitializer.postProcessBeanFactory This method simply gets all class names from the bean definitions from the given ConfigurableListableBeanFactory and tries to retrieve the right Class Objects via ClassUtils.classForName(). Unfortunately org.apache.commons.el.Logger seems to be one of the beans from the ConfigurableListableBeanFactory and thus it has to be on the classpath in order to function properly. The code from MyFaces shared has no relation to org.apache.commons.el.Logger and thus it does not need this dependency. It's just used by Orchestra to retrieve the right Class object in this scenario. So this is either a configuration problem (is org.apache.commons.el.Logger really supposed to be a bean?) or a missing orchestra dependency. Thus, I will close this as invalid.
        Hide
        Aleksei Valikov added a comment -

        > Unfortunately org.apache.commons.el.Logger seems to be one of the beans from the ConfigurableListableBeanFactory and thus it has to be on the classpath in order to function properly.

        Below is the source code from the current Orchestra distribution:

        package org.apache.myfaces.shared_orchestra.util;

        import org.apache.commons.el.Coercions;
        import org.apache.commons.el.Logger;
        import org.apache.commons.logging.Log;
        import org.apache.commons.logging.LogFactory;

        import javax.faces.FacesException;
        import javax.servlet.jsp.el.ELException;
        import java.io.InputStream;
        import java.io.IOException;
        import java.lang.reflect.Array;
        import java.util.*;

        public final class ClassUtils

        { //~ Static fields/initializers ----------------------------------------------------------------- private static final Log log = LogFactory.getLog(ClassUtils.class); private static final Logger COERCION_LOGGER = new Logger(System.out); ... }

        > The code from MyFaces shared has no relation to org.apache.commons.el.Logger and thus it does not need this dependency.

        Apparently Orchestra uses an older version of MyFaces Shared. Would you please reopen the issue and assign it back to Mario so that Orchestra team would make sure that a newer Share is used in the next release? Thank you.

        Show
        Aleksei Valikov added a comment - > Unfortunately org.apache.commons.el.Logger seems to be one of the beans from the ConfigurableListableBeanFactory and thus it has to be on the classpath in order to function properly. Below is the source code from the current Orchestra distribution: package org.apache.myfaces.shared_orchestra.util; import org.apache.commons.el.Coercions; import org.apache.commons.el.Logger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import javax.faces.FacesException; import javax.servlet.jsp.el.ELException; import java.io.InputStream; import java.io.IOException; import java.lang.reflect.Array; import java.util.*; public final class ClassUtils { //~ Static fields/initializers ----------------------------------------------------------------- private static final Log log = LogFactory.getLog(ClassUtils.class); private static final Logger COERCION_LOGGER = new Logger(System.out); ... } > The code from MyFaces shared has no relation to org.apache.commons.el.Logger and thus it does not need this dependency. Apparently Orchestra uses an older version of MyFaces Shared. Would you please reopen the issue and assign it back to Mario so that Orchestra team would make sure that a newer Share is used in the next release? Thank you.
        Hide
        Jakob Korherr added a comment -

        Oh, I did not see that. Things have changed here, there a no dependencies to commons-el anymore in shared. I guess new orchestra releases will include the newest code from shared, so this should be automatically solved in the next release!

        Show
        Jakob Korherr added a comment - Oh, I did not see that. Things have changed here, there a no dependencies to commons-el anymore in shared. I guess new orchestra releases will include the newest code from shared, so this should be automatically solved in the next release!
        Hide
        Jakob Korherr added a comment -

        Actually, this has not changed in the version of shared which orchestra uses (2.0.x). However, the pom.xml includes the following:

        <dependency>
        <groupId>commons-el</groupId>
        <artifactId>commons-el</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        </dependency>

        This should be taken into account for the next orchestra release with shared 2.0.x.

        Show
        Jakob Korherr added a comment - Actually, this has not changed in the version of shared which orchestra uses (2.0.x). However, the pom.xml includes the following: <dependency> <groupId>commons-el</groupId> <artifactId>commons-el</artifactId> <version>1.0</version> <scope>compile</scope> </dependency> This should be taken into account for the next orchestra release with shared 2.0.x.
        Hide
        Jakob Korherr added a comment -

        Moved and reopened.

        This is an orchestra issue: Due to the fact that orchestra uses shared version 2.0.x, commons-el still is a dependency and has to be added to the pom.

        Show
        Jakob Korherr added a comment - Moved and reopened. This is an orchestra issue: Due to the fact that orchestra uses shared version 2.0.x, commons-el still is a dependency and has to be added to the pom.
        Hide
        Jakob Korherr added a comment -

        After a lot of digging I found out that commons-el should be a valid dependency of orchestra since orchestra has a dependency to myfaces-shared-orchestra which itself has a dependency to commons-el and so it should be included in the releases correctly. See this mvn dependency:tree:

        org.apache.myfaces.orchestra:myfaces-orchestra-core:jar:1.5-SNAPSHOT
        [INFO] +- org.apache.myfaces.core:myfaces-api:jar:1.1.6:provided
        [INFO] | - javax.servlet:jstl:jar:1.1.0:provided
        [INFO] +- org.apache.myfaces.shared:myfaces-shared-orchestra:jar:2.0.7:provided
        [INFO] | +- commons-el:commons-el:jar:1.0:provided
        [INFO] | - commons-codec:commons-codec:jar:1.3:provided
        // cut for clarity

        In theory this should enough to have maven include it in your projects. Any idea why this does not work?

        Maybe because the version of myfaces-shared-orchestra is set via property, but I really don't know.

        Show
        Jakob Korherr added a comment - After a lot of digging I found out that commons-el should be a valid dependency of orchestra since orchestra has a dependency to myfaces-shared-orchestra which itself has a dependency to commons-el and so it should be included in the releases correctly. See this mvn dependency:tree: org.apache.myfaces.orchestra:myfaces-orchestra-core:jar:1.5-SNAPSHOT [INFO] +- org.apache.myfaces.core:myfaces-api:jar:1.1.6:provided [INFO] | - javax.servlet:jstl:jar:1.1.0:provided [INFO] +- org.apache.myfaces.shared:myfaces-shared-orchestra:jar:2.0.7:provided [INFO] | +- commons-el:commons-el:jar:1.0:provided [INFO] | - commons-codec:commons-codec:jar:1.3:provided // cut for clarity In theory this should enough to have maven include it in your projects. Any idea why this does not work? Maybe because the version of myfaces-shared-orchestra is set via property, but I really don't know.
        Hide
        Aleksei Valikov added a comment -

        Clearly because myfaces-shared-orchestra is a provided-scope dependency. The classes are added to the jar so the dependency is made "provided".

        Possible solutions are:

        • add commons-el to the orchestra dependencies
        • move to a later version of myfaces-shared-orchestra
        • rewrite the orchestra code to avoid dependencies of myfaces-shared
        Show
        Aleksei Valikov added a comment - Clearly because myfaces-shared-orchestra is a provided-scope dependency. The classes are added to the jar so the dependency is made "provided". Possible solutions are: add commons-el to the orchestra dependencies move to a later version of myfaces-shared-orchestra rewrite the orchestra code to avoid dependencies of myfaces-shared
        Hide
        Leonardo Uribe added a comment -

        We should remove the commons-el dependency from shared. This dependency was removed from shared 3.0.x and 4.0.x, but on 2.0.x was not (but in theory code is never used). The problem here is orchestra jars are used on jsf 1.2. Anyway, before remove it we should check if myfaces core 1.1.x and if so, update/move the code from commons-el to prevent this dependency.

        Show
        Leonardo Uribe added a comment - We should remove the commons-el dependency from shared. This dependency was removed from shared 3.0.x and 4.0.x, but on 2.0.x was not (but in theory code is never used). The problem here is orchestra jars are used on jsf 1.2. Anyway, before remove it we should check if myfaces core 1.1.x and if so, update/move the code from commons-el to prevent this dependency.
        Hide
        Leonardo Uribe added a comment -

        Myfaces core 1.1.x depends on commons-el in many parts. So, the solution I propose is do not call ClassUtils.convertToType from myfaces core, and call directly to Coercions.coerce. If some code somewhere else uses this call, copy the required core to shared an make it class scoped, so the code will continue working and we can finally kick out commons-el dependency from shared and also for orchestra.

        If no objections I'll commit this code soon.

        Show
        Leonardo Uribe added a comment - Myfaces core 1.1.x depends on commons-el in many parts. So, the solution I propose is do not call ClassUtils.convertToType from myfaces core, and call directly to Coercions.coerce. If some code somewhere else uses this call, copy the required core to shared an make it class scoped, so the code will continue working and we can finally kick out commons-el dependency from shared and also for orchestra. If no objections I'll commit this code soon.
        Hide
        Dan Tran added a comment -

        this is issued is marked 'Fixed' but i still see with tomcat7 deployment, and there is no traces in SVN it is fixed either

        Show
        Dan Tran added a comment - this is issued is marked 'Fixed' but i still see with tomcat7 deployment, and there is no traces in SVN it is fixed either

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Bart Kummel
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development