Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » createFactoryObject returns null after upgrade of BIRT(Nullpointerexception)
createFactoryObject returns null after upgrade of BIRT [message #665718] Fri, 15 April 2011 15:20 Go to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
Hi,
After an upgrade of BIRT from version 2.2.1.1 to 2.6.2 I have a similar problem as many older bugs I've found in here. I cant find an answer that fixes my problem, though.

My problem is that I get a NullPointerException due to that the method createFactoryObject returns null.
I have verified that the engine path is correct, and that all permissions are correct. All the jar-files from the lib-library and no other are placed correctly.

Now I'm stuck on what to look at or try to make this work, and I appreciate any help on the topic!

The code that generates the nullpointer:
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_ REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);


The log:
java.lang.NullPointerException
at com.edb.finance.reporting.util.BirtEngine.getBirtEngine(Birt Engine.java:57)
at com.edb.finance.reporting.impl.ReportEngineServiceImpl.creat eReport(ReportEngineServiceImpl.java:147)
at com.edb.finance.salessupport.reporting.salessupport.bean.use case.SalesSupportReportingUseCaseBean.printSalesSupportRepor ts(SalesSupportReportingUseCaseBean.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBinding Impl.java:129)
at org.apache.myfaces.application.ActionListenerImpl.processAct ion(ActionListenerImpl.java:63)
at se.lf.bbp.security.authorization.jsf.AuthorizationActionList ener.processAction(AuthorizationActionListener.java:78)
at javax.faces.component.UICommand.broadcast(UICommand.java:106 )
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRo ot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRo ot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication (LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle Impl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:10 6)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceA ction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(S tubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStu bImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.jav a:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha inImpl.java:56)
at se.lf.bbp.security.AuthorizationFilter.doFilter(Authorizatio nFilter.java:168)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha inImpl.java:56)
at org.apache.shale.faces.ShaleApplicationFilter.doFilter(Shale ApplicationFilter.java:285)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha inImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvoca tionAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvoca tionAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Aut henticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityMana ger.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecut e(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAp pServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequ estImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)



Re: createFactoryObject returns null after upgrade of BIRT [message #665730 is a reply to message #665718] Fri, 15 April 2011 16:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

In the runtime directory look for the configuration folder. clear
everything but the config.ini. Try to start it again and see if any
files are generated in this directory.

Jason

On 4/15/2011 11:20 AM, aca wrote:
> Hi,
> After an upgrade of BIRT from version 2.2.1.1 to 2.6.2 I have a similar
> problem as many older bugs I've found in here. I cant find an answer
> that fixes my problem, though.
>
> My problem is that I get a NullPointerException due to that the method
> createFactoryObject returns null. I have verified that the engine path
> is correct, and that all permissions are correct. All the jar-files from
> the lib-library and no other are placed correctly.
>
> Now I'm stuck on what to look at or try to make this work, and I
> appreciate any help on the topic!
>
> The code that generates the nullpointer:
> IReportEngineFactory factory = (IReportEngineFactory)
> Platform.createFactoryObject(IReportEngineFactory.EXTENSION_
> REPORT_ENGINE_FACTORY);
> birtEngine = factory.createReportEngine(config);
>
>
> The log:
> java.lang.NullPointerException
> at com.edb.finance.reporting.util.BirtEngine.getBirtEngine(Birt
> Engine.java:57)
> at com.edb.finance.reporting.impl.ReportEngineServiceImpl.creat
> eReport(ReportEngineServiceImpl.java:147)
> at com.edb.finance.salessupport.reporting.salessupport.bean.use
> case.SalesSupportReportingUseCaseBean.printSalesSupportRepor
> ts(SalesSupportReportingUseCaseBean.java:235)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBinding
> Impl.java:129)
> at org.apache.myfaces.application.ActionListenerImpl.processAct
> ion(ActionListenerImpl.java:63)
> at se.lf.bbp.security.authorization.jsf.AuthorizationActionList
> ener.processAction(AuthorizationActionListener.java:78)
> at javax.faces.component.UICommand.broadcast(UICommand.java:106 )
> at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRo ot.java:90)
> at javax.faces.component.UIViewRoot.processApplication(UIViewRo
> ot.java:164)
> at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication
> (LifecycleImpl.java:316)
> at org.apache.myfaces.lifecycle.LifecycleImpl.execute(Lifecycle
> Impl.java:86)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:10 6)
> at weblogic.servlet.internal.StubSecurityHelper$ServletServiceA
> ction.run(StubSecurityHelper.java:227)
> at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(S
> tubSecurityHelper.java:125)
> at weblogic.servlet.internal.ServletStubImpl.execute(ServletStu
> bImpl.java:300)
> at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.jav a:26)
> at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha
> inImpl.java:56)
> at se.lf.bbp.security.AuthorizationFilter.doFilter(Authorizatio
> nFilter.java:168)
> at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha
> inImpl.java:56)
> at org.apache.shale.faces.ShaleApplicationFilter.doFilter(Shale
> ApplicationFilter.java:285)
> at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterCha
> inImpl.java:56)
> at weblogic.servlet.internal.WebAppServletContext$ServletInvoca
> tionAction.wrapRun(WebAppServletContext.java:3715)
> at weblogic.servlet.internal.WebAppServletContext$ServletInvoca
> tionAction.run(WebAppServletContext.java:3681)
> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Aut
> henticatedSubject.java:321)
> at weblogic.security.service.SecurityManager.runAs(SecurityMana
> ger.java:120)
> at weblogic.servlet.internal.WebAppServletContext.securedExecut
> e(WebAppServletContext.java:2277)
> at weblogic.servlet.internal.WebAppServletContext.execute(WebAp
> pServletContext.java:2183)
> at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequ
> estImpl.java:1454)
> at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
> at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
>
>
>
>
Re: createFactoryObject returns null after upgrade of BIRT [message #665941 is a reply to message #665730] Mon, 18 April 2011 09:34 Go to previous messageGo to next message
aca Missing name is currently offline aca Missing nameFriend
Messages: 35
Registered: March 2011
Member
We actually tried emptying everything but the config.ini from the configuration folder directly after I posted this question. But this did not work either for us.
We did however found a solution. We removed the whole ReportEngine folder from the server and downloaded a new birt-runtime-2_6_2. Then we copied the ReportEngine folder from the new download over to the server and like magic, the problem then vanished Smile

Thanks a lot though for the quick answer!

//Aca
Re: createFactoryObject returns null after upgrade of BIRT [message #900149 is a reply to message #665718] Sat, 04 August 2012 17:41 Go to previous messageGo to next message
Omer Akhter is currently offline Omer AkhterFriend
Messages: 4
Registered: August 2012
Junior Member
Hi

I am new to BIRT. I am using BIRT 4.2

I am facing similar problem. I have a maven project. My BIRT dependency looks like this:

<dependency>
	<groupId>org.eclipse.birt.runtime</groupId>
	<artifactId>org.eclipse.birt.runtime</artifactId>
	<version>4.2.0</version>
</dependency>


And when I run my application through eclipse, it works fine.

But when I creat a jar with dependencies using maven-assembly-plugin and try to run it. The createFactoryObject returns null.

Any help ...?

Thanks
Re: createFactoryObject returns null after upgrade of BIRT [message #900392 is a reply to message #900149] Mon, 06 August 2012 20:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you post the complete pom? What libs get downloaded?

Jason

On 8/4/2012 1:41 PM, Omer Akhter wrote:
> Hi
>
> I am new to BIRT. I am using BIRT 4.2
>
> I am facing similar problem. I have a maven project. My BIRT dependency
> looks like this:
>
>
> <dependency>
> <groupId>org.eclipse.birt.runtime</groupId>
> <artifactId>org.eclipse.birt.runtime</artifactId>
> <version>4.2.0</version>
> </dependency>
>
>
> And when I run my application through eclipse, it works fine.
>
> But when I creat a jar with dependencies using maven-assembly-plugin and
> try to run it. The createFactoryObject returns null.
>
> Any help ...?
>
> Thanks
Re: createFactoryObject returns null after upgrade of BIRT [message #900905 is a reply to message #900392] Wed, 08 August 2012 23:15 Go to previous messageGo to next message
Omer Akhter is currently offline Omer AkhterFriend
Messages: 4
Registered: August 2012
Junior Member
Thanks for the response Jason.

Here is the pom. I had to strip the urls because: "You can only use links to eclipse.org sites while you have fewer than 25 messages."
<project xmlns=".../POM/4.0.0" xmlns:xsi=".../2001/XMLSchema-instance" xsi:schemaLocation=".../POM/4.0.0 .../xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
    <maven>3.0.4</maven>
</prerequisites>
<groupId>org.test</groupId>
<artifactId>reportTest</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>org.test.reportTest.App</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.eclipse.birt.runtime</groupId>
        <artifactId>org.eclipse.birt.runtime</artifactId>
        <version>4.2.0</version>
    </dependency>
</dependencies>
<repositories>
<!--    <repository>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>ignore</checksumPolicy>
        </snapshots>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>...oss.sonatype.org/content/repositories/snapshots</url>
    </repository> -->
    <repository>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>ignore</checksumPolicy>
        </snapshots>
        <id>sonatype-nexus-releases</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>...oss.sonatype.org/content/repositories/releases</url>
    </repository>
</repositories>
Re: createFactoryObject returns null after upgrade of BIRT [message #901067 is a reply to message #900905] Thu, 09 August 2012 15:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Omer

Can you look at the jars that get downloaded? Do they match the jars in
the runtime download of BIRT 4.2. Specifically the ones in the
reportengine/lib directory of the runtime download?

Jason

On 8/8/2012 7:15 PM, Omer Akhter wrote:
> Thanks for the response Jason.
>
> Here is the pom. I had to strip the urls because: "You can only use
> links to eclipse.org sites while you have fewer than 25 messages."
> <project xmlns=".../POM/4.0.0" xmlns:xsi=".../2001/XMLSchema-instance"
> xsi:schemaLocation=".../POM/4.0.0 .../xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <prerequisites>
> <maven>3.0.4</maven>
> </prerequisites>
> <groupId>org.test</groupId>
> <artifactId>reportTest</artifactId>
> <version>0.1</version>
> <packaging>jar</packaging>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.5.1</version>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.3</version>
> <configuration>
> <archive>
> <manifest>
> <mainClass>org.test.reportTest.App</mainClass>
> </manifest>
> </archive>
> <descriptorRefs>
> <descriptorRef>jar-with-dependencies</descriptorRef>
> </descriptorRefs>
> </configuration>
> <executions>
> <execution>
> <phase>package</phase>
> <goals>
> <goal>single</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> <plugin>
> <artifactId>maven-dependency-plugin</artifactId>
> <version>2.4</version>
> <executions>
> <execution>
> <phase>install</phase>
> <goals>
> <goal>copy-dependencies</goal>
> </goals>
> <configuration>
>
> <outputDirectory>${project.build.directory}/lib</outputDirectory>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>org.eclipse.birt.runtime</groupId>
> <artifactId>org.eclipse.birt.runtime</artifactId>
> <version>4.2.0</version>
> </dependency>
> </dependencies>
> <repositories>
> <!-- <repository>
> <releases>
> <enabled>false</enabled>
> </releases>
> <snapshots>
> <enabled>true</enabled>
> <updatePolicy>daily</updatePolicy>
> <checksumPolicy>ignore</checksumPolicy>
> </snapshots>
> <id>sonatype-nexus-snapshots</id>
> <name>Sonatype Nexus Snapshots</name>
> <url>...oss.sonatype.org/content/repositories/snapshots</url>
> </repository> -->
> <repository>
> <releases>
> <enabled>true</enabled>
> </releases>
> <snapshots>
> <enabled>false</enabled>
> <updatePolicy>daily</updatePolicy>
> <checksumPolicy>ignore</checksumPolicy>
> </snapshots>
> <id>sonatype-nexus-releases</id>
> <name>Sonatype Nexus Snapshots</name>
> <url>...oss.sonatype.org/content/repositories/releases</url>
> </repository>
> </repositories>
Re: createFactoryObject returns null after upgrade of BIRT [message #915170 is a reply to message #901067] Sun, 16 September 2012 17:59 Go to previous messageGo to next message
Omer Akhter is currently offline Omer AkhterFriend
Messages: 4
Registered: August 2012
Junior Member
Thanks for the reply Jason.

Sorry to be this late with reply but I got around the problem. I am posting my solution here so that it might be helpful for someone else.

Yes, I verified the downloaded jars.

What I did to resolve this, however, was to copy the all the dependencies into a folder:

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency-plugin.version}</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>


and then added them to classpath.

I was trying to create a single jar so that there may be no hassle in deployment/installation. But it seems to be a better solution to me since if I have a change in my code, I would need to replace my jar only.

[Updated on: Sun, 16 September 2012 18:03]

Report message to a moderator

Re: createFactoryObject returns null after upgrade of BIRT [message #915635 is a reply to message #915170] Mon, 17 September 2012 17:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thanks for posting your work around.

Jason
Re: createFactoryObject returns null after upgrade of BIRT [message #1624674 is a reply to message #915635] Thu, 19 February 2015 23:40 Go to previous message
Brian Lieb is currently offline Brian LiebFriend
Messages: 2
Registered: March 2014
Junior Member
I am coming to this discussion a couple of years too late, but I am wondering if anyone has solved Omer's issue without the workaround?

While I appreciate the workaround, it still doesn't give me the ideal solution I would like of having a single deployable jar with my application in it.

I am using org.eclipse.birt.runtime version 4.4.1 and Eclipse Luna and am having the same exact issue.
The code runs fine in eclipse, but I get an NPE on createFactoryObject when I create a jar with dependencies using the maven-assembly-plugin.

BTW, my pom is essentially the same as Omer's except I have some other dependencies for other aspects of my application.

Finally, I am sorry for re-animating an apparent zombie thread, but I could not find anywhere else but here that this specific problem was mentioned.

Previous Topic:How can I specify a font "preferences list" for a report?
Next Topic:Cell colspan change affecting other adjoining cell formatting
Goto Forum:
  


Current Time: Tue Apr 16 06:43:22 GMT 2024

Powered by FUDForum. Page generated in 0.73172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top