2 Replies - 337 Views - Last Post: 09 February 2012 - 11:12 PM Rate Topic: -----

Topic Sponsor:

#1 cassiopeia  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 36
  • Joined: 03-April 11

DynamicReport : Illegal attempt to exit early error

Posted 08 February 2012 - 05:01 AM

im working with netbeans platform, in netbeans 7.1. i use DynamicReport for my report. i can display the report correctly, only problem is when i close the report i receive an "Illegal attempt to exit early" error.

i have no idea why i receive that error. any hint, suggestion, or anything else that could help me, i would really appreciete it. i provide error message and report class in case someone need it to figure out or solve my problem. thank you :)


org.netbeans.ExitSecurityException: Illegal attempt to exit early
	at org.netbeans.TopSecurityManager.checkExitImpl(TopSecurityManager.java:217)
	at org.netbeans.TopSecurityManager$PrivilegedCheck.run(TopSecurityManager.java:697)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.netbeans.TopSecurityManager$PrivilegedCheck.check(TopSecurityManager.java:722)
	at org.netbeans.TopSecurityManager$PrivilegedCheck.checkExit(TopSecurityManager.java:710)
	at org.netbeans.TopSecurityManager.checkExit(TopSecurityManager.java:157)
	at java.lang.Runtime.exit(Runtime.java:105)
	at java.lang.System.exit(System.java:960)
	at net.sf.jasperreports.view.JasperViewer.exitForm(JasperViewer.java:238)
	at net.sf.jasperreports.view.JasperViewer$1.windowClosing(JasperViewer.java:202)
	at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:349)
	at java.awt.window.processWindowEvent(window.java:2045)
	at javax.swing.JFrame.processWindowEvent(JFrame.java:296)
	at java.awt.window.processEvent(window.java:2003)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.window.dispatchEventImpl(window.java:2713)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
	at java.awt.EventQueue.access$000(EventQueue.java:101)
	at java.awt.EventQueue$3.run(EventQueue.java:666)
	at java.awt.EventQueue$3.run(EventQueue.java:664)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:680)
	at java.awt.EventQueue$4.run(EventQueue.java:678)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)



this is my code :

public final class Rpt_Category {
    private CategoryPresenter categoryPresenter = new CategoryPresenter();
    
    public Rpt_Category(){
         build();
    }
    
    private void build(){
        StyleBuilder boldStyle         = stl.style().bold();  
        StyleBuilder boldCenteredStyle = stl.style(boldStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);  
        StyleBuilder columnTitleStyle  = stl.style(boldCenteredStyle)  
                                            .setBorder(stl.pen1Point())  
                                            .setBackgroundColor(Color.LIGHT_GRAY);         
        try {  
            report()
            .setColumnTitleStyle(columnTitleStyle)
            .highlightDetailEvenRows()
            .columns(
                        col.column("CategoryId", "categoryId", type.stringType()),  
                        col.column("CategoryName", "categoryName", type.stringType()),  
                        col.column("Information", "information", type.stringType())
                    )                      
            .title(cmp.text("Getting started").setStyle(boldCenteredStyle))
            .pageFooter(cmp.pageXofY().setStyle(boldCenteredStyle))
            .setDataSource(createDataSource())
            .show();
        } 
        catch (DRException e) {  
            e.printStackTrace();  
        }
    }
    
    private JRDataSource createDataSource() {  
        Session session = HibernateUtilities.getSessionFactory().openSession();
        List dataList = categoryPresenter.findAll(session, 0, 500);
        session =(Session) session.close();
        return new JRBeanCollectionDataSource(dataList);    
    }     
}


and this is how i call the report :

Rpt_Category rpt_Category = new Rpt_Category();

This post has been edited by cassiopeia: 08 February 2012 - 05:02 AM


Is This A Good Question/Topic? 0
  • +

Replies To: DynamicReport : Illegal attempt to exit early error

#2 datakeyword  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-February 12

Re: DynamicReport : Illegal attempt to exit early error

Posted 09 February 2012 - 10:23 PM

DynamicReport? I think BIRT or JASPERREPORT is more familiar
Was This Post Helpful? 0
  • +
  • -

#3 cassiopeia  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 36
  • Joined: 03-April 11

Re: DynamicReport : Illegal attempt to exit early error

Posted 09 February 2012 - 11:12 PM

dynamic report built on jasperreport. i dont have to design report manually, i only need to make a class and that very simple and save a lot of time. i already have answer for this problem.

so case close. :)

-cassiopeia-
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1