Announcement Announcement Module
Collapse
No announcement yet.
Spring and BIRT Integration Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and BIRT Integration Exception

    Hello Everyone,

    I am integrating Birt with Spring and have got integration concept example from

    http://www.springsource.org/Business...ndBIRT#frommvc

    I have configured POLO based example and after integration i am facing following exception

    EXCEPTION:

    SEVERE: Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'birtWebConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.eclipse.birt.spring.example.CarService org.eclipse.birt.spring.example.BirtWebConfigurati on.carService; nested exception is java.lang.TypeNotPresentException: Type org.eclipse.birt.report.engine.api.IReportEngine not present
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessPropert yValues(AutowiredAnnotationBeanPostProcessor.java: 288)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:522)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:461)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 95)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:223)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:292 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:607)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:479)
    at org.springframework.web.servlet.FrameworkServlet.c onfigureAndRefreshWebApplicationContext(FrameworkS ervlet.java:647)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:5 98)
    at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:6 61)
    at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:517 )
    at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:458)
    at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:138)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:160)
    at org.apache.catalina.core.StandardWrapper.initServl et(StandardWrapper.java:1267)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1186)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:1081)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:5027)
    at org.apache.catalina.core.StandardContext.startInte rnal(StandardContext.java:5314)
    at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.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$Sync.innerRun(Unkn own Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Could not autowire field: private org.eclipse.birt.spring.example.CarService org.eclipse.birt.spring.example.BirtWebConfigurati on.carService; nested exception is java.lang.TypeNotPresentException: Type org.eclipse.birt.report.engine.api.IReportEngine not present
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor$AutowiredFieldElem ent.inject(AutowiredAnnotationBeanPostProcessor.ja va:514)
    at org.springframework.beans.factory.annotation.Injec tionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.postProcessPropert yValues(AutowiredAnnotationBeanPostProcessor.java: 285)
    ... 30 more
    Caused by: java.lang.TypeNotPresentException: Type org.eclipse.birt.report.engine.api.IReportEngine not present
    at sun.reflect.generics.factory.CoreReflectionFactory .makeNamedType(Unknown Source)
    at sun.reflect.generics.visitor.Reifier.visitClassTyp eSignature(Unknown Source)
    at sun.reflect.generics.tree.ClassTypeSignature.accep t(Unknown Source)
    at sun.reflect.generics.visitor.Reifier.reifyTypeArgu ments(Unknown Source)
    at sun.reflect.generics.visitor.Reifier.visitClassTyp eSignature(Unknown Source)
    at sun.reflect.generics.tree.ClassTypeSignature.accep t(Unknown Source)
    at sun.reflect.generics.repository.ClassRepository.ge tSuperInterfaces(Unknown Source)
    at java.lang.Class.getGenericInterfaces(Unknown Source)
    at org.springframework.core.GenericTypeResolver.doRes olveTypeArguments(GenericTypeResolver.java:298)
    at org.springframework.core.GenericTypeResolver.resol veTypeArguments(GenericTypeResolver.java:292)
    at org.springframework.core.GenericTypeResolver.resol veTypeArgument(GenericTypeResolver.java:271)
    at org.springframework.core.GenericTypeResolver.resol veReturnTypeArgument(GenericTypeResolver.java:259)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$3.doWith(AbstractAutowi reCapableBeanFactory.java:701)
    at org.springframework.util.ReflectionUtils.doWithMet hods(ReflectionUtils.java:473)
    at org.springframework.util.ReflectionUtils.doWithMet hods(ReflectionUtils.java:451)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.getTypeForFactoryBean(A bstractAutowireCapableBeanFactory.java:696)
    at org.springframework.beans.factory.support.Abstract BeanFactory.isTypeMatch(AbstractBeanFactory.java:5 20)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.doGetBeanNamesForType(DefaultLi stableBeanFactory.java:338)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanNamesForType(DefaultList ableBeanFactory.java:316)
    at org.springframework.beans.factory.BeanFactoryUtils .beanNamesForTypeIncludingAncestors(BeanFactoryUti ls.java:187)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.findAutowireCandidates(DefaultL istableBeanFactory.java:858)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.doResolveDependency(DefaultList ableBeanFactory.java:815)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.resolveDependency(DefaultListab leBeanFactory.java:730)
    at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor$AutowiredFieldElem ent.inject(AutowiredAnnotationBeanPostProcessor.ja va:486)
    ... 32 more
    Caused by: java.lang.ClassNotFoundException: org.eclipse.birt.report.engine.api.IReportEngine
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1559)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    ... 56 more
    --------------------------


    I have followed all mentioned steps.

    Can any body help me. i will be highly thankful.

    Regards,
    SB

  • #2
    This forum is for the Spring Integration Project not general integration issues; you should ask your question on one of the web forum.

    I am not familiar with that article but it looks like you are simply missing the birt dependency from your classpath.

    Comment


    • #3
      Hello Everyone,

      Thanks Gary i have opened the same under web category...

      For the reported exception i have added following binary jars to class path

      1. All library jars copied from birt-runtime-4_2_2\ReportEngine\lib

      2. Spring Frame work
      spring-webmvc-portlet-3.2.0.RELEASE.jar
      spring-webmvc-3.2.0.RELEASE.jar
      spring-web-3.2.0.RELEASE.jar
      spring-tx-3.2.0.RELEASE.jar
      spring-test-3.2.0.RELEASE.jar
      spring-struts-3.2.0.RELEASE.jar
      spring-oxm-3.2.0.RELEASE.jar
      spring-orm-3.2.0.RELEASE.jar
      spring-jms-3.2.0.RELEASE.jar
      spring-jdbc-3.2.0.RELEASE.jar
      spring-instrument-tomcat-3.2.0.RELEASE.jar
      spring-instrument-3.2.0.RELEASE.jar
      spring-expression-3.2.0.RELEASE.jar
      spring-core-3.2.0.RELEASE.jar
      spring-context-support-3.2.0.RELEASE.jar
      spring-context-3.2.0.RELEASE.jar
      spring-beans-3.2.0.RELEASE.jar
      spring-aspects-3.2.0.RELEASE.jar
      spring-aop-3.2.0.RELEASE.jar
      aopalliance-1.0.jar

      and I am using Tomcat Server , Eclipse IDE

      Thanks in Advance,

      Regards,
      Sb

      Comment


      • #4
        Hello Everyone,

        I am working on the same integration ( http://www.springsource.org/Business...ndBIRT#frommvc )

        My previous problem fixed by adding resources in deployment Assembly in Eclipse and adding following new library to Java Build path

        org.springframework.web.servlet-3.2.0.RELEASE.jar and adding ...

        Now i am facing next problem in the Following Method

        public IReportEngine getObject(){

        EngineConfig config = new EngineConfig();
        System.out.println("Starting BIRT server "+ this.context.toString() );

        //This line injects the Spring Context into the BIRT Context
        config.getAppContext().put("spring", this.context );
        config.setLogConfig( null != this._resolvedDirectory ? this._resolvedDirectory.getAbsolutePath() : null , this.logLevel);
        try {
        Platform.startup( config );
        }
        catch ( BirtException e ) {
        throw new RuntimeException ( "Could not start the Birt engine!", e) ;
        }

        IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTO RY );
        IReportEngine be = factory.createReportEngine( config );
        this.birtEngine = be ;

        System.out.println("BIRT Reporting Server initialised sucessfully");

        return be ;
        }


        From above method factory object returns null which throws exception on folling lne of code
        IReportEngine be = factory.createReportEngine( config );

        public class BirtWebConfiguration extends WebMvcConfigurerAdapter {


        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/reports").setViewName("birtView");

        }

        @Bean
        public BirtView birtView(){
        BirtView bv = new BirtView();
        //bv.setReportFormatRequestParameter("ReportFormat") ;
        //bv.setReportNameRequestParameter("ReportName");
        bv.setBirtEngine( this.engine().getObject() );
        return bv;
        }


        @Bean public BeanNameViewResolver beanNameResolver(){
        BeanNameViewResolver br = new BeanNameViewResolver() ;
        return br;
        }

        @Bean
        protected BirtEngineFactory engine(){
        BirtEngineFactory factory = new BirtEngineFactory() ;
        //factory.setLogLevel( Level.FINEST);
        //factory.setLogDirectory ( new File ("c:/logs"));
        //factory.setLogDirectory( new FileSystemResource("/logs"));

        return factory ;
        }


        }

        -----------------------------------------
        FULL EXCEPTION
        -----------------------------------------

        May 24, 2013 12:07:53 AM org.springframework.web.servlet.FrameworkServlet initServletBean
        SEVERE: Context initialization failed
        org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'birtView' defined in class org.eclipse.birt.spring.example.BirtWebConfigurati on: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public org.eclipse.birt.spring.core.BirtView org.eclipse.birt.spring.example.BirtWebConfigurati on.birtView()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'engine': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:581)
        at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateUsingFactory Method(AbstractAutowireCapableBeanFactory.java:102 9)
        at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:925)
        at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:490)
        at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:461)
        at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 95)
        at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:223)
        at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:292 )
        at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:607)
        at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:932)
        at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:479)
        at org.springframework.web.servlet.FrameworkServlet.c onfigureAndRefreshWebApplicationContext(FrameworkS ervlet.java:647)
        at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:5 98)
        at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:6 61)
        at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:517 )
        at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:458)
        at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:138)
        at javax.servlet.GenericServlet.init(GenericServlet.j ava:160)
        at org.apache.catalina.core.StandardWrapper.initServl et(StandardWrapper.java:1267)
        at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1186)
        at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:1081)
        at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:5027)
        at org.apache.catalina.core.StandardContext.startInte rnal(StandardContext.java:5314)
        at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.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$Sync.innerRun(Unkn own Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public org.eclipse.birt.spring.core.BirtView org.eclipse.birt.spring.example.BirtWebConfigurati on.birtView()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'engine': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:181)
        at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:570)
        ... 31 more


        -----------------


        Can any body help me. i will be highly thankful.

        Regards,
        SB

        Comment

        Working...
        X