I am getting Error while calling Birt Report #1724
Replies: 4 comments 17 replies
-
What means the debugger? At which line appears the exception with the NPE? |
Beta Was this translation helpful? Give feedback.
-
09-Jun-2024 15:44:52.056 INFO [http-nio-8080-exec-167] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath |
Beta Was this translation helpful? Give feedback.
-
I am using spring MVC to call birt report.But stuck to resolve relative path like
I have created file with name of application.properties under the path of /WEB-INF/RESOURSES/APPLICATION.PROPERTIES and this file contains entries like my application.context.xml entry as <mvc:resources mapping="/images/**" location="/WEB-INF/images/" />` but when i want to load this in my service class this not resolved Actually i want to call the birt report from spring mvc and for this purpose i have make all the configuration changes but there is something i am missing thats why not able to resolve the path of report and images as i configured and tell above. for clarity i am pasted here my service class code |
Beta Was this translation helpful? Give feedback.
-
A few years ago we created a sample spring boot BIRT application which you can find here: https://github.com/innoventsolutions/birt-spring-boot. |
Beta Was this translation helpful? Give feedback.
-
Error when creating service class using Birt Report to Run in Spring MVC. Here is Log of Error Description
08-Jun-2024 21:06:11.763 INFO [http-nio-8080-exec-531] org.apache.catalina.core.ApplicationContext.log Destroying Spring FrameworkServlet 'dispatcher' 08-Jun-2024 21:06:11.764 INFO [http-nio-8080-exec-531] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext 08-Jun-2024 21:06:27.899 INFO [http-nio-8080-exec-530] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath 08-Jun-2024 21:06:27.931 INFO [http-nio-8080-exec-530] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext 08-Jun-2024 21:06:32.049 SEVERE [http-nio-8080-exec-530] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'birtReportService': Invocation of init method failed; nested exception is java.lang.NullPointerException.
My Service Class code is
`package service;
import dto.OutputType;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.*;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service;
import static dto.OutputType.HTML;
import static dto.OutputType.PDF;
import dto.Report;
import dto.Report.Parameter;
import java.io.File;
import java.util.*;
import javax.annotation.PostConstruct;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@service
public class BirtReportService implements ApplicationContextAware, DisposableBean {
// For orders_by_customer report - Set parameter cn
Map<String, Object> params = new HashMap<>();
params.put("cn", 112);
runAndRenderTask.setParameterValues(params);
// For orders_by_customer report - Set parameter cn
Map<String, Object> params = new HashMap<>();
params.put("cn", 112);
runAndRenderTask.setParameterValues(params);
}
`
i am using Netbean 8.2 with jdk 1.8 and Runtime for Birt jar file is org.eclipse.birt.runtime_4.8.0-20180626-4.8.0 (1).jar
Beta Was this translation helpful? Give feedback.
All reactions