Trying to call Jasper iReport through portlet & getting error

Hi,
I have written the following code which is linked to a button in my portlet.
package com.ext.portlet.drpdwn.action;
import com.liferay.portal.struts.PortletAction;
import com.liferay.portal.util.Constants;
import javax.portlet.WindowState;
import javax.servlet.jsp.PageContext;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.sql.*;
import javax.portlet.PortletException;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.export.*;
public class QualityReportAction extends PortletAction
     public void processAction(ActionMapping mapping, ActionForm form,PortletConfig config,ActionRequest req, ActionResponse res)
throws Exception
          String typeofreport_val = req.getParameter("types_of_reports").trim();
          System.out.println("Report Name is:" +typeofreport_val);
          JasperReport jasperReport;
          JasperPrint jasperPrint;
          JasperDesign jasperDesign;
          Connection connection = null;
          if ( null == typeofreport_val || "".equals("typeofreport_val"))
               setForward(req,"portlet.ext.drpdwn.error");
          else
               try
                    Class.forName("org.postgresql.Driver");
                    String url = "jdbc:postgresql://10.10.33.39:5432/globus_db?user=postgres&password=marines@123";
                    connection = DriverManager.getConnection(url);
                    // load JasperDesign from XML and compile it into JasperReport
                    jasperDesign = JRXmlLoader.load("C:/testRep/CCQR.jrxml");
                    jasperReport = JasperCompileManager.compileReport(jasperDesign);
                    // fill JasperPrint using fillReport() method
                    jasperPrint = JasperFillManager.fillReport(jasperReport,null,connection);
                    JasperExportManager.exportReportToPdfFile(jasperPrint,"C:/testRep/ccqr.pdf");
               catch (SQLException ex)
                    setForward(req,"portlet.ext.drpdwn.error");
                    System.out.println("-------------------------------------------");
                    while (ex != null)
                         ex.printStackTrace();
                         ex = ex.getNextException();
                    System.out.println("-------------------------------------------");
               catch(Exception e)
                    System.out.println("-------------------------------------------");
                    System.out.println("Exception is --> "+e);
                    System.out.println("-------------------------------------------");
               setForward(req,"portlet.ext.drpdwn.success");                    
     public ActionForward render(ActionMapping mapping,ActionForm form,PortletConfig config, RenderRequest req,RenderResponse res) throws Exception
          if (getForward(req) != null && !getForward(req).equals(""))
               return mapping.findForward(getForward(req));
          else
               return
               mapping.findForward("portlet.ext.drpdwn.view");
}When I try to run this code I get the following error:
exception  javax.servlet.ServletException: Servlet execution threw an exception
     com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:144)
     com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:136)
     com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:126)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:95)
     com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:144)
     com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:116)
     com.liferay.filters.doubleclick.DoubleClickFilter.doFilter(DoubleClickFilter.java:138)
     com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter.doFilter(LayoutCacheFilter.java:170)
     com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.doFilter(AutoLoginFilter.java:106)
     com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:136) 
root cause  java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/xml/JRXmlLoader     com.ext.portlet.drpdwn.action.QualityReportAction.processAction(QualityReportAction.java:59)I have the following necessary files in my class path:
itext-1.3.1.jar
iReport.jar
commons-logging-1.0.2.jar
commons-javaflow-20060411.jar
commons-digester-1.7.jar
commons-collections-2.1.jar
commons-beanutils-1.7.jar
jasperreports-2.0.2.jar
jdt-compiler-3.1.1.jar
log4j-1.2.15.jar
xercesImpl.jar   Please suggest me where I am going wrong.
Thanks & Regards
Saurabh.
Edited by: Saurabh.J on Nov 27, 2007 2:33 PM

Disable your anti-virus, install the update, turn you anti-virus back on

Similar Messages

  • I am trying to update PR and PS and get error code A12E3. cannot find solution.

    I am trying to update PR and PS and get error code A12E3. cannot find solution.

    " The feature you are trying to use is on a network resource that is unavailable. I tried to uninstall iTunes, and it would not uninstall. It gave me the following message " The path C:\documents and settings\network service\local settings\application data\apple\apple software update\iTunes.msi cannot be found.
    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • HT201210 im trying to restore my iphone 4 but getting error message as could not be contacted or temporarily unavailable plz help

    im trying to restore my iphone 4 but getting error message as could not be contacted or temporarily unavailable plz help

    Hey santhosh.pv,
    We have a few articles that can help troubleshoot the alert message in iTunes you see when you are trying to restore your iPhone 4. You can resolve many restore issues using the troubleshooting steps documented here:
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    The next article is the companion of the more general article above. Follow the above article first. If, after following that article, the issue persists, continue with this article:
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/ts3694
    Cheers,
    David

  • On mac yosemite, when trying to install my own brushes, I get error message: "Could not load the brushes "blahblah.abr" because the file is not compatible with this version of PS" (PS CC 2014)

    Need help-
    On my mac with yosemite, when trying to install my own brushes, I get error message: "Could not load the brushes "blahblah.abr" because the file is not compatible with this version of PS" (PS CC 2014) ????

    Thank you station_two but I did install them in my
    applications>adobe>presets>brushes and still I get this error message......
    On Tue, Dec 2, 2014 at 6:20 PM, station_two <[email protected]>

  • If am trying to open Indesign cs4 files am getting error plugins required

    i have Adobe Indesign cs4, If am trying to open Indesign cs4 files am getting error plugins required, following plugins are required SCOTCH ROLES.RPLN, SANGAM SERVICER - MAPPER.RPLN, OTICAL KERING.RPLN etc
    After pressing ok again am getting error

    Go to Help > Configure Plugins... and make sure those listed in the first screen are listed and have a checkmark next to them to indicate they are active. That may fix the dictionary problem as well.
    You may also need to reset the prefs. See Replace Your Preferences

  • Trying to update apps on iphone and getting error message, there is not enough available local storage to download these items. you can manage your local device storage usage in settings

    trying to update apps on iphone and getting error message, there is not enough available local storage to download these items. you can manage your local device storage usage in settings. What am I to do?

    The storage you purchased is in the cloud, and doesn't do anything with your pad.  Your problem is simply that you have too much content on your pad.   Go to settings, general, usage, and it will show you how much space you have avaliable on your pad.  If you let the screen sit for a while, all the apps will be displayed, and you can see how much stuff you have associated with each.
    You have to no option but to delete some of the content on your pad.  Videos, comics, pitcures and some music files use a lot of space.   The cloud allows you to leave stuff there, so you can get it when you need it.

  • I am trying to empty my trash and keep getting error code -8003

    I am trying to empty my trash and keep getting error code -8003...how do I get it to empty?

    http://support.apple.com/kb/HT1526

  • I am trying to install lightroom 4 and keep getting error 1935.

    I am trying to install lightroom 4 and keep getting error 1935

    http://forums.adobe.com/community/search.jspa?peopleEnabled=true&userID=&spotlight=false&c ontainerType=14&container=3316&rankBy=date&q=1935

  • TS3694 i have tried to restore my iphone but keep getting error 1015 any suggestions

    i have tried to restore my iphone but keep getting error 1015 any suggestion

    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.

  • Purchased and downloaded elements one yr. ago.  Now new computer.  Have CD, tried to install, after entering S/N get error-"not valid number"  What can I do?

    Purchased and downloaded elements one yr. ago.  Now new computer.  Have CD, tried to install, after entering S/N get error-"not valid number"  What can I do?

    Go here (You may need to use the chat option.):
    Activation & Deactivation Help
    This is the Photoshop Forum.
    Note to mod: Please move to the Photoshop Elements forum.

  • MY I PHON 16GB TRYED TO TO RESET BUT I AM GETTING ERROR 1015, WITH RECOVERY MODE with itune sign, what should i do??

    MY I PHON 16GB TRYED TO TO RESET BUT I AM GETTING ERROR 1015, WITH RECOVERY MODE with itune sign, what should i do??

    Not much you can do.  Your phone is most likely permanently "bricked"  Error 1015 occurs when trying to restore a previously jailbroken phone.  This usually leaves the phone in a state where it can not be recovered as you are experiencing.
    Discussion of jailbroken phones is prohibited by the Terms of Use of this forum.  You'll have to get help elsewhere.  Ask the lovely people who helped you jailbreak your phone.

  • I am trying to download Adobe X1 Pro but get error message 413 header length too long - any ideas?

    I am trying to download Adobe X1 Pro but get error message 413 header length too long - any ideas?

    Hi Theresa ,
    That's a browser error.
    Clear your browser cache and cookies and try again.
    Or use a different browser.
    You may refer to the following link to download Acrobat 11.
    https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    Regards
    Sukrit Dhingra

  • I am trying to update my CS6 Extended and get error U44M2P7 how can I proceed?

    I am trying to update my CS6 Extended and get error U44M2P7

    Hi,
    Please follow the steps mentioned in this doc.
    http://helpx.adobe.com/photoshop/kb/photoshop-cs6-updates-dont-install.html
    Thanks
    kapil

  • Trying to upgrade an itunes download and getting error message "windows installer did not finish as expected.  contact person or vendor"

    trying to upgrade my ITunes for my Iphone and cannot access content.   During upgrade getting message "windows installer did not finish as expected..contact vendor"

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • While trying to integrate EBS 11i and APEX getting error

    Followed white paper document of Rod West to integrate EBS 11i and APEX.
    While trying to integrate EBS 11i and APEX getting below error.
    "This function type can't be launched from forms without first logging into the E-Business Suite homepage".
    Looks like i am missing out something. Please help!

    Hi Rod,
    Thanks for the reply. Please find the details below:
    Created a function "Integrate APEX" .
    -Properties/Type – SSWA plsql function.
    - Web HTML/HTML Call – security_pkg.apex_launch
    -Form/Parameters – Left blank because created apex_launch procedure without parameters
    Attaching to the menu:
    Logged in as System Admin -->Menus-->Queried menu (SUPPORT_GUI) and added the function (Integrate APEX) to this menu..
    security.apex_launch procedure:
    ============================================
    PROCEDURE apex_launch
    AS
    BEGIN
       OWA_UTIL.mime_header ('text/html', FALSE);
       OWA_UTIL.redirect_url (
    http://servername:port/apex/f?p=appid:page::APPS:::'
    END apex_launch;
    =================================================
    Also I have web enabled this package procedure (security.apex_launch).
    When i click on "Integrate APEX" below error pops up.
    "This function type can't be launched from forms without first logging into the E-Business Suite homepage".
    Control is not going to security.apex_launch procedure at all. This i confirmed by putting log messages.
    Let me know if something to be modified.
    Thanks!

Maybe you are looking for