Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory

    Hi,

    I'm new to the Spring BlazeDS Integration project. Currently I am following a tutorial for the Spring BlazeDS Integration 1.0.0.RELEASE, found on www.dzone.com.

    However when try to run the server I get the following exception:

    Code:
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_flexRemotingAnnotationPostProcessor': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMapPropertyEditor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:886)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:843)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:443)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:276)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:273)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:179)
    	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:872)
    	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:530)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:359)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:427)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:341)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    	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:585)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMapPropertyEditor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.registerCustomEditors(AbstractBeanFactory.java:966)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.initBeanWrapper(AbstractBeanFactory.java:921)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:882)
    	... 34 more
    Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
    	at org.springframework.flex.config.json.JsonConfigMapPropertyEditor.<init>(JsonConfigMapPropertyEditor.java:41)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:127)
    	... 38 more
    Aug 7, 2009 5:47:11 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /dzone-server threw load() exception
    java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
    	at org.springframework.flex.config.json.JsonConfigMapPropertyEditor.<init>(JsonConfigMapPropertyEditor.java:41)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:127)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:105)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.registerCustomEditors(AbstractBeanFactory.java:966)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.initBeanWrapper(AbstractBeanFactory.java:921)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:882)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:843)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:443)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:276)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:273)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:179)
    	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:872)
    	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:530)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:359)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:427)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:341)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    	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:585)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Any help with this will be much appreciated,
    Thanks.
    Last edited by flashbuilder; Aug 7th, 2009, 03:08 PM.

  • #2
    That tutorial, while being a nice introduction of the concepts, is actually using some outdated syntax from M2 and the download doesn't have all the right dependencies for the final 1.0.0.RELEASE. I would suggest using the testdrive sample bundled with the distro as a start. It is the same application covered in the DZone tutorial, but with everything properly up-to-date.

    The library that you are missing in this case is Jackson. It is pulled down as a transitive dependency of Spring BlazeDS Integration if you're using Maven.

    See this post for a guide to getting going with the final version of the testdrive: (http://blog.springsource.com/2009/06...ntegration-10/)

    Comment


    • #3
      Thanks for the quick response and advice. I'll check out the guide for the testdrive.

      Comment


      • #4
        Is there a reason why there is nothing in any of the documentation which simply lists the direct dependencies of the blazeds integration project? Maven shouldn't be a requirement just to discover this information. I don't care about the transitive dependencies, as every other project will correctly list its direct dependencies. The distribution with dependencies contains all of the jars in the ivy-cache, but figuring out which ones I actually need is a non-trivial exercise.

        Comment


        • #5
          stuck up with the same error

          Hi everybody

          I am a flex developer and struggling with my first flex spring integration example. I went through many links including the one suggested in this discussion but nothing seems giving a solution. i am using spring-flex-1.0.1.RELEASE, is this problem related to the this spring-blazeDS integartion release ? In most of the examples they have been using Maven which i doesnt know about it.

          Could anybody in this forum give me an insight about how to get out of this error and please help me to take first step in the enterprise world.

          Comment


          • #6
            You need to include the right JAR files on your classpath. I highly recommend learning and using Maven to help with this rather than trying to do it manually, but for the time being you can grab a copy of the pre-built sample application (with all the necessary dependencies in WEB-INF/lib) here: http://static.springsource.org/sprin....1.RELEASE.zip

            Comment


            • #7
              Thank you jeremyg484. I look in to this pre-built sample app. I am also gonna try my hands on Maven as you suggested.

              Comment


              • #8
                Not to sound like a broken record but I agree with idea and the others that Maven shouldn't be requirement or relied on at all to set up blazeds integration. Maybe I'm mistaken but if the big point of Maven is to use an Internet connection to automatically download all the "STUFF" needed, that's not a good solution. Some (many?) enterprise development environments are on internal networks that do not allow Internet access. If I can't use it in my work environment AT ALL, I've just about zero interest in learning anything about "Maven" at this point in time.

                I'm also curious why I need to include a JSON library like this at all in my project when I've no intention of using JSON. One of the big reasons I've ditched the old legacy front end "HTML generation" technologies for Flex was to reduce dependency and code bloat, so this is why I'm sensitive to such concerning things creeping back.

                So anyway, my question (yes I do have one ) is:
                Is there or will there ever be a list of direct dependencies so that those of us who don't want (or cannot) use Maven can obtain what we need without adding a ton of library bloat to our projects?

                I'm looking at the list of files in the testdrive WEB-INF/lib and there's 36 jar files (!!!) - does a simple "hello world" app really need almost 50 jars to run? I'm not really looking forward to adding jars one by one and deploying/starting my app server over and over to find out which one is needed next, if that's what has to happen.

                Comment


                • #9
                  Looking in the spring-flex-testdrive folder in the zip link posted, there's 19 samples. WEB-INF/lib isn't so easy to find in there.

                  Comment


                  • #10
                    Ok, found it - copying all the jar files (apparently?) needed into a spring-blazeds subdirectory inside your project's WEB-INF/lib slightly mitigates having to deal with 50 jars every time you're digging through your project files. Still have no idea if every single one of those jars is really needed, but I'm tired of playing 'find the jar' games.

                    It would be helpful if the number of jars/dependencies were greatly reduced (this applies to Spring in general as well...). The more required 3rd party junk, the more likelihood that *another* framework/library/tool which may require a different version of that 3rd party junk dependency is going to produce seizures. :/ I'm all for code-reuse, but mainly at the final project/application level - 'frameworks' or architectures or tools like Hibernate and so on should not be so bloated and complex that they require a dozen 3rd party potentially conflicting dependencies just to work. And if they really do, they should fully integrate/customize/rename that 3rd party code so as to avoid conflicts. "End-user" developers can only stand so much of this jar dependency hell before they've had enough.

                    Anyway, rants aside, the jar files are found in spring-flex-testdrive\testdrive\target\testdrive\WEB-INF\lib within the zip file link posted above.

                    Comment


                    • #11
                      json NoClassDefFoundError

                      I solve this by doing the following steps:
                      - check to see if the word NoClassDefFoundError is found in the directory where you think that you downloaded all the jars for this project (the word is easy to find (if exists) as class names are not compacted in jars (zips) because they are file names, also (they are stored as plain text))
                      - i found that I have the jar "commons lang3..." and not "common lang v3..." as human brain interpret the title so I deleted the "lang" jar that had no NoClassDefFoundError inside and downloaded the real lang library (commons-lang-2.4.jar - !!! this can increment in time, take the last one (or the one that goes with the whole package - the last one usually works))

                      Good luck !

                      Dorin


                      Originally posted by flashbuilder View Post
                      Hi,

                      I'm new to the Spring BlazeDS Integration project. Currently I am following a tutorial for the Spring BlazeDS Integration 1.0.0.RELEASE, found on www.dzone.com.

                      However when try to run the server I get the following exception:

                      [CODE]SEVERE: StandardWrapper.Throwable
                      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_flexRemotingAnnotationPostProcessor': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMap PropertyEditor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
                      at
                      ...............................

                      Comment


                      • #12
                        json NoClassDefFoundError

                        I solve this by doing the following steps:
                        - check to see if the word NoClassDefFoundError is found in the directory where you think that you downloaded all the jars for this project (the word is easy to find (if exists) as class names are not compacted in jars (zips) because they are file names, also (they are stored as plain text))
                        - i found that I have the jar "commons lang3..." and not "common lang v3..." as human brain interpret the title
                        so I deleted the "lang" jar that had no NoClassDefFoundError inside and downloaded the real lang library (commons-lang-2.4.jar - !!! this can increment in time, take the last one (or the one that goes with the whole package - the last one usually works))

                        Good luck !

                        Dorin

                        Comment

                        Working...
                        X