FTP server was down when XI was sending messages

Hi guys,
I have the following problem:
Yesterday the FTP server of a legacy system was down while some interfaces were running in XI and were producing some files that should be written in target ftp server. In communication channel monitoring I get the following error:
"Error occurred while connecting to the FTP server "120.2.6.133:21": java.net.ConnectException: Connection timed out: connect"
Is there a way to retrieve these messages somehow without having to run the intrfaces again from source system??
Evaggelos

Just goto...Runtime workbench..
  Select the message monitoring there...
  then provide the filters like sender business system and receiver business system...then select the start/end date...may be last 7 days/yesterday...
Then select the status as " ALL CONTAINING ERRORS"...you will see all you messages there select and click on resend...You can even reprocess all the messages at the sam time...Just click on "multiple selection" ON and say select all..
   Thats it..
Regards,
Ravi

Similar Messages

  • Trigger aler or send a mail if target ftp server is down

    Hi,
    I am sending file from source to target using XI.
    Here my target is FTP. If the FTP server is down on the target side while placing the file we need to trigger an alert or send an email to the sender.
    Thanks & Regards
    Sowmya.

    Once the adapter engine tries for the standard retry time and interval, it will change the message status to System Error.
    Create Alert Rule for the Adapter Engine errorrs. SelectAdapter Engine and make the adapter type as All. Rest is same
    The specified item was not found.
    Regards,
    Prateek

  • What happens if receiver FTP server is down or replaced.?

    Hi folks,
    In a scenario like IDOC to FILE or any other to FILE , for any reasons FTP server was down or replaced. Then what happens to the messages ( with quality of service EO r EOIO). What is the status of messages.
      If the FTP server has been changed then those details has to be entered in SLD.?
    Thanks,
    Srinivas Reddy

    >
    Prateek Raj Srivastava wrote:
    > For EO cases, the message will be in Waiting state in Adapter engine (monitoring through RWB) until it retries to post data to FTP. After all retries, it goes to System Error. EOIO messages will move to Holding status.
    >
    to add to this, if you are using EOIO you will have to restart the first message in the queue before others so that the processing can continue.
    In short, either EO or EOIO, the messages will be persisted in PI. you can always manually resend them.
    Another option /people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically

  • Just published a new site to an FTP server and I got a 404 error message saying the site doesn't exist. When I retype the name of the site, I get a page from my hosting service saying this is the future home of [my site]. Any ideas?

    Just published a new site to an FTP server and I got a 404 error message saying the site doesn't exist. When I retype the name of the site, I get a page from my hosting service saying this is the future home of [my site]. Any ideas?

    Hi roddy,
    thanks for responding. I read your link, looked at my settings and they were all correct. I tried to do a republish and got this message: The requested URL /childrenandcaring/index.html was not found on this server.
    When I type the address in the address bar, I go to the site and the page says: This is the new site childrenandcaring.com
    Any other ideas?
    Suzanne

  • Planning server goes down when I try to delete a member in Planning Web

    Hi,
    Planning server goes down when I try to delete a member in Planning Web. I am using Hyperion Planning 4 with Tomcat 4.1.30 and Windows Server 2003.
    I am not sure whats happening. This is the exception log I am looking at:
    2009-07-24 18:19:22 ApplicationDispatcher[HyperionPlanning] Servlet.service() for servlet jsp threw exception
    javax.servlet.ServletException
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.catalina.valves.ErrorDispatcherValve.custom(ErrorDispatcherValve.java:420)
         at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve.java:327)
         at org.apache.catalina.valves.ErrorDispatcherValve.throwable(ErrorDispatcherValve.java:277)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:179)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    ----- Root Cause -----
    java.lang.OutOfMemoryError
    2009-07-24 18:19:22 ErrorDispatcherValve[localhost]: Exception Processing ErrorPage[errorCode=500, location=/Error.jsp]
    javax.servlet.ServletException
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.catalina.valves.ErrorDispatcherValve.custom(ErrorDispatcherValve.java:420)
         at org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve.java:327)
         at org.apache.catalina.valves.ErrorDispatcherValve.throwable(ErrorDispatcherValve.java:277)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:179)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    ----- Root Cause -----
    java.lang.OutOfMemoryError
    Please do help me........ how to resolve this.
    Thanks.

    Hi,
    You could try increasing the java heap size, though sometimes an issue can occur if you are trying to delete a member when a workflow process has started, do you have one running?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • FTP Adapter File Polling does not raise error when FTP server is down

    Hi All,
    Thanks in advance.
    I am polling for new files in a FTP Server. However, if the server is down there is no way for me to catch the fault to notify someone. I am using fault-policies but that never gets triggered when polling an unavailable FTP Server.
    One option is to have a completely separate scheduled process (SOA or not) that tries to connect to the servers but I am trying not to go that route just to keep things manageable and within the realm of the process.
    I am sure that I am not the only one polling for new files in a FTP Server, so I thought to pick your brain to tackle this scenario.
    Thanks for taking the time to read this.

    I was contacted by our DBA team for an exception received while writing a file to a FTP location.
    Then i looked at the exception message and asked them to check the whether they are able to contact the ftp server using command prompt then they said the user password got expired.
    They reset the password and its working now.
    Am i missing something here :(
    Exception:
    WSIF JCA Execute of operation 'Put' failed due to: Error sending file to FTP Server.
    Unable to send file to server.
    ; nested exception is:
    ORABPEL-11429
    Error sending file to FTP Server.
    Unable to send file to server.
    Please ensure 1. Specified remote output Dir has write permission 2. Output filename has not exceeded the max chararters allowed by the OS and 3. Remote File System has enough space.
    Thanks,
    Vijay
    Edited by: veejai24 on 25-Jul-2012 07:10

  • Safari shuts down when i goto send a message from my hotmail account

    safari shuts down when i go to send a message from my hot mail account how do i fix this problem

    Can you send an email from your computer to the ePrint service?  
    If so it may be that your phone is not supported.  Here is a list of email clients that have been tested:
    Outlook 2003, 2007
    Hotmail, Yahoo! Mail, Gmail
    Apple Mail (iPhone, iPad, Macbook, MacbookPro)
    BlackBerry mail client
    Nokia/Symbian client (Nokia)
    You can change your account to locked mode from your ePrint Center.  Once you've changed it you just enter your email address on the allow list.
    Although I am not affiliated with HP, please give Kudos if I've answered your question

  • Is the Oracle ftp server shut down??????????

    i've been trying to resume a download from the oracle ftp but can not do so. can someone tell me if this a problem with oracle's ftp server or my computer?

    I've downloaded about 3/4 of the Oracle 8.1.6 files for W2K and haven't been able to get the last few I need -- it appears that ftp.oracle.com isn't accepting logins for some mysterious reason :-(

  • Server Shutting down, when the Concurrent Users are more

    Hi,
    We are working on EP 5.0 SP5, our problem is that if the concurrent users are more automatically our LDAP or Portal is shutting down (approximately 300 or above..).
    For this problem… where we have to check? help can be appreciated...
    Regards,
    Sudhir

    Hi,
    If you portal is shutting down when it is getting a high load I would look at the memory settings defined in the configtool (if you are using a service or the startupframework) or the go.bats if you are running them manually. I would assume that the problems comes from the java process not being able to get enough memory, so try increasing the heapsize parameter Xmx (?)
    See notes
    597187
    696410 (for EP6 but content and related notes should be relevant)

  • Issue getting FTP server to work when firewall is turned ON.

    I have FTP server setup on a file server for users in a remote office to quickly download large files over the VPN between the offices.  It works fine. 
    I have setup FTP on a different server in a 3rd remote office in order to download some large files.  It will not work unless I turn off the firewall for the Domain network settings.  In the firewall under "Allow a program or feature"
    FTP Server is listed and is checked under Domain, Home, and Public.  I can't figure out what I am doing wrong.  Can someone help me figure this one out?   thanks

    It is clear now that it is a firewall problem. 
    If this is a Windows Firewall then you can give a try to this: http://www.maxpcsecure.com/support/spywaredetector/allow_FTP_Port.htm
    If this is not a Windows Firewall then you need to check with the vendor / developer support for assistance.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Windows 8.1 freezes when I am sending messages to Xbox Live friends

    When I spend an X amount of time in messages, specifically sending messages to Xbox Live friends, my mouse moves slowly. When that happens my PC crawls to a halt and I cannot exit the app nor can I go back to Desktop. 
    Any solutions?

    Hi,
    A slow system reaction normally because of over use of system memory and high usage of CPU, to confirm this, open the taks manager in this way:
    1.type “task manager” at the search box, open task manager, then click “performance” tag to check the memory and CPU usage by right clicking at the application, then stop this one.
    2.if the usage stands on a high percentage, go to the details tag to stop the applications that cost high resources.
    Besides, I suggest to go to the Xbox site to check the minimum requirement:
    Download speed: 3 megabits per second
    Upload speed: 0.5 megabits per second
    Ping speed:Less than 150 milliseconds
    And other requirements you can find it here to check the details for Xbox:
    http://support.xbox.com/en-US/xbox-360/networking/slow-performance-solution
    Regards
    Wade Liu
    TechNet Community Support

  • Web server shuts down when I start it, and starts when I shut it down

    I have an Xserve runing 10.8.4 and Server.app 2.2.1
    I've been messing around, trying to get django to work, and now I appear to have done a bad thing.
    When I flip the switch (or run sudo sudo serveradmin start web) in Server.app from OFF to ON, whilst running a tail -f on /var/log/apache2/error_log, I see this:
    [Wed Jun 26 16:31:44 2013] [warn] NameVirtualHost 10.5.1.6:80 has no VirtualHosts
    [Wed Jun 26 16:31:44 2013] [notice] Apache/2.2.22 (Unix) PHP/5.3.15 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.2 mod_ssl/2.2.22 OpenSSL/0.9.8x DAV/2 configured -- resuming normal operations
    and when I flip the switch from ON to OFF (or sudo serveradmin stop web) I see this:
    [Wed Jun 26 16:32:01 2013] [notice] caught SIGTERM, shutting down
    um... so everything is backwards.
    anyone have any idea what I did?

    Maybe I'm missing something...
    "When I flip the switch (or run sudo sudo serveradmin start web) in Server.app from OFF to ON:
    [notice] Apache/2.2.22 (Unix) PHP/5.3.15 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.2 mod_ssl/2.2.22 OpenSSL/0.9.8x DAV/2 configured -- resuming normal operations
    So Apache starts up (true, you have a configuration error, but that's a different issue.
    Conversely:
    and when I flip the switch from ON to OFF
    [notice] caught SIGTERM, shutting down
    So it shuts down. That doesn't match your original premise, so what's the issue?

  • JMS server shuts down when quota_threshold reached

    Hi,
    Using weblogic 10.3.2. We are using WLS JMS Queues and are having the below issue. We are using filestore as a persistence during peak times huge number of messages are queued and the space on the disk gets filled up where no more messages are able to be persisted but some how WebLogic keeps accepting the messages and we end up restarting the servers to make sure messages starts getting processed. Is there a way if the space on the disk gets full we don't accepts any messages in the queues and once the space gets available start accepting the messages over again. Is there any out-of-the-box functionality available that it automatically detects this kind of behavior and WLS JMS to stop eccepting the new messages till have enough space.
    <There was a failure while performing paging I/O
    weblogic.messaging.kernel.KernelException: Error writing messages for paging
    at weblogic.messaging.kernel.internal.PagingImpl.performPagingIO(PagingImpl.java:578)
    at weblogic.messaging.kernel.internal.PagingImpl.run(PagingImpl.java:488)
    Caused By: weblogic.store.PersistentStoreException: [Store:280019]There was an error while writing to a file store file
    at weblogic.store.io.file.Heap.multiWrite(Heap.java:479)
    at weblogic.messaging.kernel.internal.PagingImpl.performPagingIO(PagingImpl.java:576)
    at weblogic.messaging.kernel.internal.PagingImpl.run(PagingImpl.java:488)
    Caused By: java.io.IOException: Error writing to file, No space left on device, errno=28
    at weblogic.store.io.file.direct.DirectIONative.write(Native Method)
    at weblogic.store.io.file.direct.DirectFileChannel.write(DirectFileChannel.java:173)
    at weblogic.store.io.file.StoreFile.write(StoreFile.java:255)Thanks

    Thanks for the info but the question is how do I know what quotas to set. So the one getting the above error weblogic jms should stop taking any messages until there's enough space available. As currently it keeps accepting the messages and we den up restarting the servers.
    Currently under JMS Server configurations everything is set to -1 and in connection factory timeout is set to 10 ms.
    Thanks

  • Tomacat server shutd down when running JSP?

    Hi ,
    could you please what does this error message mean?My apache server shuts own whenever i close a report(thats accepts a parameter).This is the catalina.log file ..
    08-Jun-2008 10:21:16 org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: c:\program files\java\jdk1.5.0_15\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\program files\java\jdk1.5.0_15\bin;
    08-Jun-2008 10:21:16 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    08-Jun-2008 10:21:16 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1486 ms
    08-Jun-2008 10:21:16 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    08-Jun-2008 10:21:16 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
    08-Jun-2008 10:21:18 org.apache.catalina.core.StandardContext addApplicationListener
    INFO: The listener "listeners.ContextListener" is already configured for this context. The duplicate definition has been ignored.
    08-Jun-2008 10:21:18 org.apache.catalina.core.StandardContext addApplicationListener
    INFO: The listener "listeners.SessionListener" is already configured for this context. The duplicate definition has been ignored.
    08-Jun-2008 10:21:19 org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\apache-tomcat-6.0.16\webapps\ROOT\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    08-Jun-2008 10:21:21 org.apache.coyote.http11.Http11Protocol start*INFO: Starting Coyote HTTP/1.1 on http-8080
    08-Jun-2008 10:21:21 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    08-Jun-2008 10:21:21 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47 config=null
    08-Jun-2008 10:21:21 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4845 ms
    08-Jun-2008 10:27:50 org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-8080
    08-Jun-2008 10:27:51 org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    08-Jun-2008 10:27:52 org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-8080
    As Mr.Evnafets said i removed servelet.jar file from the lib folder.And checked any system.exit() in my code.My code is just a sample one.so there is no system.exit().So i tried again.But same happens.But it work well with reports which doesnot receive any parameters.My code is as follows....
    <%@ page import="java.sql.*" %>
    <%@ page import=" net.sf.jasperreports.engine.*,net.sf.jasperreports.view.JasperViewer,
    java.util.*"%>
    <%
    String refno=request.getParameter("refno");
    Connection conn;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    conn=DriverManager.getConnection("jdbc:odbc:mydsn","","");
    Map parameters = new HashMap();
    parameters.put("refno", refno);
    JasperReport jasperReport;
    JasperPrint jasperPrint;
    jasperReport = JasperCompileManager.compileReport("c:/iReport-2.0.5/prjreports/feereport.jrxml");
    jasperPrint = JasperFillManager.fillReport(jasperReport,parameters, conn);
    JasperExportManager.exportReportToPdfFile(jasperPrint, "c:/iReport-2.0.5/prjreports/feereport.pdf");
    JasperViewer.viewReport(jasperPrint);
    %>
    <jsp:forward page="home.html" />
    Please help me to find out error in this code...
    Thanks

    Well ideally Server logs which you have provided are not of much help here in this which almost indicates nothing for us in the stated case.
    08-Jun-2008 10:21:21 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/47 config=null
    08-Jun-2008 10:21:21 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4845 ms
    *08-Jun-2008 10:27:50 org.apache.coyote.http11.Http11Protocol pause*
    INFO: Pausing Coyote HTTP/1.1 on http-8080
    08-Jun-2008 10:27:51 org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    08-Jun-2008 10:27:52 org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-8080
    As Mr.Evnafets said i removed servelet.jar file from the lib folder.And checked any system.exit() in my code.My code is just a sample one.so there is no system.exit().So i tried again.But same happens.But it work well with reports which doesnot receive any parameters.My code is as follows....
    ********************************************************************Well i'd be more concerned of why the Servlet Container went into Pause Condition reasons could be because of.
    1).OS Stopping Usage of the Application Server Instance by blocking activity Application Port (External factors)
    2).Application Container Configuration Issues
    3).Application Heap Space and other memory / resource lekage issues
    4).Illegal System terminations (not possible as per reference to server logs and the statement made by the OP)
    Let us consider the first fact as this is happening with only as an exclusive problem reported in the application.Believe 1,2 & 4 cases stated could not be the one.
    Now if we are left with case 3.
    <%@ page import="java.sql.*" %>
    <%@ page import=" net.sf.jasperreports.engine.*,net.sf.jasperreports.view.JasperViewer,
    java.util.*"%>
    <%
    String refno=request.getParameter("refno");
    Connection conn;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    conn=DriverManager.getConnection("jdbc:odbc:mydsn","","");
    Map parameters = new HashMap();
    parameters.put("refno", refno);
    JasperReport jasperReport;
    JasperPrint jasperPrint;
    jasperReport = JasperCompileManager.compileReport("c:/iReport-2.0.5/prjreports/feereport.jrxml");
    jasperPrint = JasperFillManager.fillReport(jasperReport,parameters, conn);
    JasperExportManager.exportReportToPdfFile(jasperPrint, "c:/iReport-2.0.5/prjreports/feereport.pdf");
    JasperViewer.viewReport(jasperPrint);
    %>
    *<!-- Why are we forwarding the Request once we have exected JasperViewer.viewReport to view reporting Applet from the browser -->*
    *<jsp:forward page="home.html" />*Also,would like to know what is the size of the data which we were trying to export using the stated report.
    If things are quite high better choose an effective lekage mechanisms by adopting a better design stratergy one thing which comes directly into my mind is usage of BeanDataSource via a customized DAO / Business tiers Built by ourselves for helping on rendering of the report.
    Other than commented concerns if i'm asked to handle displaying of reports i'd use it via few dedicated sources such as servlets / viewhelpers to handle it effectively.Just as an example consider the below case where i'm placing all my .jrxml / compiled .jasper files in a dedicated folder named *"c:/iReport-2.0.5/prjreports"* and have implemented a sample servlet as below.
    ReportingServlet :*
    package com.rutils.common.servlet;
    import net.sf.jasperreports.engine.*;
    import net.sf.jasperreports.engine.export.*;
    import net.sf.jasperreports.j2ee.servlets.ImageServlet
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.File;
    import java.io.OutputStream;
    import java.sql.Connection;
    import com.rutils.utility.auth.Authenticator;
    import com.rutils.utility.db.DBUtils;
    import org.apache.log4j.Logger;
    import java.util.Map;
    * @author  Rahul
    * @version v1.0.1
    public class ReportingServlet extends HttpServlet{
    private Logger logger;
    //Intializing Logger
    static {
      logger = Logger.getLogger(ReportingServlet.class);
    public void processAction(HttpServletRequest request,HttpServletResponse response)throws Exception{
       Connection conn = null;
       JasperReport jasperReport = null;
       JasperPrint jasperPrint = null;
       JRExporter exporter = null;
       OutputStream ouputStream = null;
       if(!Authenticator.getCurrentInstance().authenticate(request)){
          logger.error("User Authtication Failed");
          throw new Exception("User Authtication Failed");
       String filename = request.getParameter("fileName");
       String reporttype = request.getParameter("reportType");
       String disp = request.getParameter("conDisp");
       Map requestMap = request.getParameterMap();
       boolean conDisp = false;
       logger.info("Calling ReportingServlet.processRequest() method with parameters : FileName="+filename+", ReportType="+reporttype+", ContentDisposition="+disp);
       String path = this.getServletContext().getInitParameter("com.rutils.reports.filePath").replace('\\','/');
       if(filename == null || reporttype == null || disp == null)
          throw new Exception("Invalid Data");
       else
         filename = path + "/" + filename;
       File f = new File(filename);
       if(!f.exists()){
          logger.error(filename+" - Requested Report doesn't exist");
          throw new Exception(filename+" - Requested Report doesn't exist");
       if(!reporttype.equals("rtf") || !reporttype.equals("pdf") || !reporttype.equals("csv") || !reporttype.equals("xls") || !reporttype.equals("html")){
          logger.error(reporttype+" - Invalid Report format");
          throw new Exception(reporttype+" - Invalid Report format");
       try{
         conDisp = Boolean.parseBoolean(disp);
         conn = DBUtils.getCurrentInstance().getConnection();
         logger.info("Database Connection Established");
          requestMap.remove("fileName");
          requestMap.remove("reportType");
          requestMap.remove("conDisp");
          logger.info("Report's Parameter Map Created "+requestMap);
          if(fileName.endsWith(".jrxml")){
             jasperReport = JasperCompileManager.compileReport();
             jasperPrint = JasperFillManager.fillReport(jasperReport,requestMap,conn);
         }else{
             jasperPrint = JasperFillManager.fillReport(fileName,requestMap,conn);
         logger.info("Report Object Created...");
         ouputStream = response.getOutputStream();
         if("pdf".equalsIgnoreCase(reporttype)){
               response.setContentType("application/pdf");
               if(conDisp)
                  response.setHeader("Content-Disposition", "inline; filename=\"Report.pdf\"");
               exporter = new JRPdfExporter();
               exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
               exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
         }else if("rtf".equalsIgnoreCase(reporttype)){
            response.setContentType("application/rtf");
            if(conDisp)
              response.setHeader("Content-Disposition", "inline; filename=\"Report.rtf\"");
            exporter = new JRRtfExporter();
            exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
            exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
        }else if("html".equalsIgnoreCase(reporttype)){
           response.setContentType("text/html");
           if(conDisp) 
             response.setHeader("Content-Disposition", "inline; filename=\"Report.xls\"");
           exporter = new JRHtmlExporter();
           request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);                       
           exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
           exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
           exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"jImages?image=");
        }else if("xls".equalsIgnoreCase(reporttype)){
           response.setContentType("application/xls");
           if(conDisp)
              response.setHeader("Content-Disposition", "inline; filename=\"Report.xls\"");
           exporter = new JRXlsExporter();
           exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
           exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
       }else if( "csv".equalsIgnoreCase(reporttype)){
           response.setContentType("application/csv");
           if(conDisp)
              response.setHeader("Content-Disposition", "inline; filename=\"file.csv\"");
           exporter = new JRCsvExporter();
           exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
           exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
       exporter.exportReport();
       request.getSession().removeAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE);                  
       logger.info(reporttype+" Report Exported.");
    }catch (Exception e){
        logger.error("Error Occured :"+e.getMessage());
        throw new Exception(e);
    }finally{
        if (ouputStream != null){     
           try{
              ouputStream.close();
           }catch (Exception ex){}
        if(conn != null){
           try{
             if(!conn.isClosed())
               conn.close();
           }catch (Exception ex){}
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
         this.processAction(request,response);
    public void doService(HttpServletRequest request,HttpServletResponse response) throws Exception{
         this.processAction(request,response);
    NOTE:* Don't forget add jasperreports-1.2.6.jar,commons-digester-1.7.jar,commons-beanutils-1.5.jar,commons-logging-1.0.2.jar,commons-collections-2.1.jar,itext-1.3.1.jar (for .pdf) & poi-2.0-final-20040126.jar (for .xls),log4j.jar in your classpath(WEB-INF/lib)
    Configurations in web.xml :*
       <context-param>
             <param-name>com.rutils.reports.filePath</param-name>
             <param-value>c:/iReport-2.0.5/prjreports</param-value>
       </context-param>
       <servlet>
                 <servlet-name>ReportingServlet</servlet-name>
                  <servlet-class>com.rutils.common.servlet.ReportingServlet</servlet-class>
        </servlet>
        <servlet>
            <servlet-name>JasperImageServlet</servlet-name>
            <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
        </servlet>
       <servlet-mapping>
                 <servlet-name>ReportingServlet</servlet-name>
                 <url-pattern>/report</url-pattern>
      </servlet-mapping>
    <servlet-mapping>
            <servlet-name>Jasper Image Servlet</servlet-name>
            <url-pattern>/jImages</url-pattern>
    </servlet-mapping>Now you can export respective report in the below stated way
    <%@ page language="java"%>
    <%
       String refno = request.getAttribute("refno").toString().trim();
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
       <head>
          <title>Application Reporting Module</title>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
          <meta http-equiv="Pragma" content="no-cache"/>
          <meta http-equiv="Expires" content="-1"/>
       </head>
       <body>
            <h3 align="center">Export Semster Fee Report in the below Formats</h3>
            <table align="right" border="0" width="70%" cellpadding="2" cellspacing="2">
               <tbody>
                     <tr><td><a href='<%=response.encodeURL("/report?fileName=feereport.jrxml&reportType=html&conDisp=false&refno="+refno)%>' target="_parent">HTML</a></td></tr> 
                     <tr><td><a href='<%=response.encodeURL("/report?fileName=feereport.jrxml&reportType=pdf&conDisp=true&refno="+refno)%>' target="_blank">PDF</a></td></tr>     
                     <tr><td><a href='<%=response.encodeURL("/report?fileName=feereport.jrxml&reportType=rtf&conDisp=true&refno="+refno)%>' target="_blank">RTF</a></td></tr>
                     <tr><td><a href='<%=response.encodeURL("/report?fileName=feereport.jrxml&reportType=xls&conDisp=true&refno="+refno)%>' target="_blank">XLS</a></td></tr>
                     <tr><td><a href='<%=response.encodeURL("/report?fileName=feereport.jrxml&reportType=csv&conDisp=true"+refno)%>' target="_blank">CSV</a></td></tr>
               </tbody>
            </table>
       </body>
    </html>Hope this might be of some help :)
    REGARDS,
    RaHuL

  • Application server shuts down when solaris terminal closes

    I'm running the latest version of solaris and have Glassfish v2 installed. I use the solaris terminal to navigate to the startup scripts and start the appserver... it starts up fine. For whatever reason, when I now close the terminal window, the appserver shuts down. Is this normal? How can I avoid this?
    Thanks

    some of that may be up to the application and how it can be started. im not familiar with this so if you have the doc for it handy, take a look at it looking for running as a daemon or service.

Maybe you are looking for

  • To get :SYSTEM.MOUSE_RECORD in Forms 11g

    Dear Friends, I tried :SYSTEM.MOUSE_RECORD but it give the record wher I last clicked, not the record where mouse cursor. I want to get the record where mouse cursor lies. How can I get? Thanks in Advance Ahamed Rafeeque Cherkala

  • Where can I find my gifted apps?

    Hello, I have just bought a Pro. My mum bought me the Pages, Numbers and Keynote apps and gifted them to me. I downloaded them all through the email that was sent to me. I cant find them on my Pro, but can see them in my itunes? What am i doing wrong

  • External editor (PSE10) starts without importing the picture

    Recently acquired PSE 10 and configured it as the external editor under Aperture 3 (running OS Lion). When starting the Aperture external editor option, PSE10 starts happily (as expected) but it does not display the picture I want to edit . With my p

  • Advanced conditional action issue

    I am using Captivate 7. I am experimenting with Advanced conditional actions. I am simulating a numerical keypad (0-9) with each number assigned to a click box. working with 4 digits. I need to impose limits for each of the 4 digits. Example: Digit 1

  • Loss of Time Capsule connection to MacPro & MacPro Book.

    My new Time Capsule is connected to a Mac Pro and MacPro Laptop all running latest OS. After 2 months of correct back up performance both computers now fail to detect the back up drive. I must un plug the Time Capsule and de power it and the TP=Link