Schedueld tasks in web-container

Hi,
i have a small application consisting only of a set of JSP's.
My problem is: I need to execute a task at schedueld times (e.g. every 5 minutes) and I also want the task to run in the web-container.
What is the best way to achieve this?
Thanks in advance

Hi hemmings!
I'm currently working in something like this. I can't use TimerTask approach because schedule may vary before next execution gets reached. For instance, user may want to execute something in Chritsmas and cancel the execution before the day arrives. The points I must cover are:
User configures the execution giving:
Start date, end date. Both might be null = eternity.
When daily, every...
When weekly, every... at weekday...
When Monthly, every... at monthday...
or every... the nst weekday...
Plus daily frequency, starting at... ending at... every...
Scheduler will point to the script that should be executed. Script must accept Java and SQL syntax.
I already did something similar some years ago, but I was not quitely satisfied.
Well, if your requirements are similar to mines I will be glad to share code with you.

Similar Messages

  • Periodic task in web container best practice

    Hi All,
    My wep application has to monitor a specific directory on the hard disk for new incoming files (I know about the difficulties here - that's not the problem). Right now I'm planning to write a servlet which does nothing more but create a java.util.Timer in init() and schedule a java.util.TimerTask with it (and of course cancel() the timer in destroy()).
    How would you solve this?
    Uli

    Hi All,
    My wep application has to monitor a specific directory on the hard disk for new incoming files (I know about the difficulties here - that's not the problem). Right now I'm planning to write a servlet which does nothing more but create a java.util.Timer in init() and schedule a java.util.TimerTask with it (and of course cancel() the timer in destroy()).
    How would you solve this?
    Uli

  • Can I redirect to a completely different web container?

    Hi all
    How can I redirect from a Servlet to a completely different web container. For example let's say I have MyServlet running on machine A, and according to a parameter in the request, I would like to redirect to host B (to another location).
    I tried to use RequestDispatcher.forward, but it uses a relative location (even if I added the absolute URL, like http://hostb:port/new_location).
    Can I redirect to another container?
    thanks,

    Do you need to send the data to the second site as well? That's where you will run into problems.

  • How to view the session in the web container

    hi, Folks,
    is there any way to view the sessions in J2EE web container? I need to know how many living session currently in the web container.
    Thanks

    You did not indicate the Web Server version that you are using for web container. Assuming its Sun Java System Web Server 6.1, per Servlet 2.3 specification, you should be able to use of session creation and destruction events. This can be done using HttpSessionListener to count active sessions. Here's the docs for reference:
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html
    Thanks
    Manish

  • Using local session bean interface from web container using EJB 3.0

    Hi,
    How can you use a local session bean interface from Java (rather than data controls) in a web container using EJB 3.0?
    I can use a remote interface by looking up InitialContext, but I can't find a local interface this way (even from another session EJB). I can use a local interface from an EJB using annotation "EJB", but as I understand, this is not available in the web container.
    If I try to add an ejb-jar.xml file, these seems to mess up by project...
    Hope you can help.
    Roger

    The portable way to retrieve an EJB reference in Java EE is to either inject it or look it up via the
    component's private naming environment. The simplest way is :
    @EJB
    private DocumentManager dm;
    The global JNDI name is only used as an implementation specific way to uniquely assign an
    identifier to a specific Remote EJB. It's best for this not to appear directly in the source code.
    There's more on global JNDI names in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    The alternative to annotations is to use an ejb-ref to declare the ejb dependency. The ejb-ref
    is declared in the standard deployment descriptor corresponding to the component doing the
    lookup. Each ejb-ref has an ejb-ref-name, e.g. <ejb-ref-name>DM_ref</ejb-ref-name>
    The code looks up the ejb-ref-name relative to the java:comp/env namespace to retrieve the
    EJB reference.
    DocumentManager dm = (DocumentManager)
    new InitialContext().lookup("java:comp/env/DM_ref");

  • Error 1324: the folder path 'webi/' contains an invalid character

    Hi pros,
    I am getting this error when trying to install bobj xi 3.1 client version. the service pack is zero.
    however, i previously had bobj xi 3.1 server / client components installed and bobj 4.0 client tools.
    i uninstalled bobj 4 and bobj xi 3.1 server components from control panel. also, deleted them from registry.
    still i am getting the above error.
    kindly advise.

    Hi,
    Can you please check the following thread which is for the exact same question :
    error 1324: the folder path 'webi/' contains an invalid character
    Regards
    Steph

  • Possible to deploy Dist Auth in the same web container with Policy Agent?

    I have a client who has limited hardware resources and wants to deploy the distributed authentication UI in the same web container as the policy agent. Has anyone successfully done this?

    I'm sure it's possible just make sure the DAUI context (e.g. /distAuth) in the agent's configuration for the web server is in the not enforced list properties for the agent.
    However, it's so easy just to put an Apache HTTP server/tomcat and run daui, then setup another web server (Sun, Apache, etc.) with an agent or vice versa and you don't have to worry about the agent clobbering DAUI.

  • Changing the Header in a Hybrid Web Container app on BlackBerry

    Hello Experts!
    I am trying to add a custom header to Hybrid Web Container Apps on SUP 2.0.  It would be nice to add branding or additional text - even the ability to center the text would be nice.  I have tried various jQuery approaches and can see the changes working when I test via Chrome.  However when deploying to my BlackBerry simulator the changes are not reflected.  If I had to guess - it would appear the entire Header area is not modifiable.  To add more context to the problem review the generated code below from workflow_jQueryMobileLookAndFeel.html
    <div data-role="page" data-theme='a' id="ErrorDetailScreenDiv">      
          <div data-role="header" data-position="inline">
           <h1>ErrorDetail</h1>
         </div>
    Recall that each screen is a div with the data-role attribute page; similarly the div with data-role header is the area in question that I am trying to modify.
    Here is the jQuery I am using in the customBeforeWorkflowLoad method in the Custom.js file.
    $('[data-role="header"]').each(function() {
              var dvHeader = $(this);     
              var elem = dvHeader.find('h1');
              var h1Str = elem.text();
              elem.empty();
              dvHeader.remove('h1');
                    //function buildHeader returns html text of a div etc
              var txt = buildHeader(h1Str);
              dvNewHeader = $(txt);
              dvHeader.append(dvNewHeader);     
    Again when testing in chrome the text is removed and the new header is added.
    If I had to guess - I would say the Workflow application which wraps around the Hybrid Web Container App is interfering;  I assume the workflow (native) application reads the h1 tags and the header we see on the device is the workflow app and not the Hybrid Web Container.  My other guess would be the Header area is somehow locked in the BlackBerry scenario.
    Thanks.
    Edited by: JUSTIN MCGREW on Sep 22, 2011 5:18 PM
    Edited by: JUSTIN MCGREW on Sep 22, 2011 5:21 PM
    Edited by: JUSTIN MCGREW on Sep 22, 2011 5:22 PM

    Hello,
    Yes I was aware of the customBeforeShowScreen method of adding a screen header.  I believe in my testing I determined for ListView-based screens and credential screens the dynamic header is not shown and only works on pages with an HTMLView.
    Doesnt it seem a little silly to have two headers?
    Example:
    Login Page
    Logo \ Login Page \ Custom Text
    Screen Body
    I will accept that there is not a method to replace the header at the very top of the screen.
    Thanks for your time and help!
    -Justin

  • How to Configure Apache Web Server  with Tomcat web container in Linux

    Hi all,
    I am working on Tomcat web server 5.0.19 on Linux AS 3.0., ( my Control Server)
    I need map my tomcat to Apache Web Server (httpd) in another system
    (web server).
    I dont have jk2_ or jk_mod .so files to use in my tomcat/conf directory to make them available for httpd.conf files of Apache Web server.
    I have only jk2.properties file in my conf.,
    Please tell me how to go about it
    my mail id [email protected]
    Thank You
    Subramanyam.V
    Hyderabad
    India

    The simple answer is to download a web server that has a web container already integrated on it, so all that painful configuration work is avoided.
    You can use the mature SJS Web Server 6.1 SP5 at
    http://www.sun.com/webserver
    Or you can try a preview of the upcoming version at
    http://www.sun.com/download/products.xml?id=446518d5
    You will get better performance and security, with easy of use, at about the same price ;)

  • Question about AXF Task List Web Tool

    On the Task List Web Tool, i want to display the comments oan each task on this page as another column. I'm running the 10g version on the AXF application. I looked at the configuration guide for the 10g and i dont see any details on how to do this. However the Comments are display on the bottom of the TasViewer Web Tool page.
    This is slowing down the processing of invoice for customers. So i reviewed the 11g it looks like a possiblilty to do this just by configurations in the AXF metdata table but in the 10g version that i;m running i dont have this table. Can you me in a display on how to configure the comments to show on the Task List Web Tool

    Hi Dexter,
    IPM Task List is accessible for different tasks. InvoiceProcessing, SupplierMaintenance etc. In order to access this task list, you have use the following links
    http://host:16000/imaging/faces/CommandExecutor.jspx?sol=InvoiceProcessing&cmd=StartInvoiceProcessing
    Thanks,
    Lakshmi

  • Threads running in web container

    How to get current web container active threads count,and how to get the max web container thread count ,in weblogic

    Hello Slava,
    The output you see when running to web from Reports Builder is controlled by the web source of your report. Please take a look at your web source and confirm whether that the reports JSP tags are indeed present to fetch the data and format the web output.
    Also, note that if you want to deploy your report using its web layout, you would need to save it as a JSP, as only JSPs can be deployed directly over the web.
    RDF files can be run over the web only using rwservlet, and doing so will cause the output to be formatted using the report's paper layout instead of it's web layout.
    Thanks,
    The Oracle Reports Team.

  • Web Service without Web Container

    There is any framework for do a app with a Web Service Server without deploy in a Web Container?
    I want to do a Desktop app with Web Services and WSDL for a php client. I only had found examples for deploy on Tomcat and others.

    If I change this: @SOAPBinding(style = Style.RPC, parameterStyle=ParameterStyle.BARE)
    It have same error that in soap client for php:
    javax.xml.ws.soap.SOAPFaultException: Cannot find dispatch method for {http://schemas.xmlsoap.org/soap/encoding/}parametros
    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
    at $Proxy53.usuarioSaldo(Unknown Source)
    at trservidor.TRServidorView.<init>(TRServidorView.java:128)
    at trservidor.TRServidorApp.startup(TRServidorApp.java:19)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • How to run a report out of the web container?

    Hi All,
    <p>
    Does anyone have tips on running a report outside of the web container?  I'd like to be able to JUnit the scenarios I'm coding up without having an app server running.  What is the ReportClientDocument expecting in the request, response, and context?  The code as shown just returns the enclosed error.
    <p>
    All I'm really trying to do is have the report execute and be able to assert that the data is appropriately retrieved from the data source.  If there's a way to do that without the Viewer, that would be cool, too.
    <p>
    Any tips would be much appreciated.   Sorry about the poorly formatted code and error... the code tags don't seem to be working...
    <p>
    Thanks,
    <p>
    Eric
    <pre>public void testReportRunning() throws ReportSDKExceptionBase{
              ReportClientDocument rcd = initReportClientDoc("./test/data/EBTest1.rpt");
              assertTrue(rcd.isOpen());
              CrystalReportViewer crv = new CrystalReportViewer();
              crv.setReportSource(rcd.getReportSource());
            String htmlContent = crv.getHtmlContent(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockServletContext());
            System.out.println(htmlContent);
    com.businessobjects.report.web.shared.WebReportingException---- Error code:0
         at com.businessobjects.report.web.e.if(Unknown Source)
         at com.businessobjects.report.web.e.a(Unknown Source)
         at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)
         at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)
         at com.crystaldecisions.report.web.ServerControl.getHtmlContent(Unknown Source)
         at com.tririga.crystalpoc.ReportAccessorTest.testReportRunning(ReportAccessorTest.java:82)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:164)
         at junit.framework.TestCase.runBare(TestCase.java:130)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:120)
         at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)</pre>
    Edited by: Eric Batzdorff on Jun 12, 2009 12:24 AM
    Edited by: Eric Batzdorff on Jun 12, 2009 12:24 AM
    Edited by: Eric Batzdorff on Jun 12, 2009 12:25 AM

    There's no documentation as to what's the minimum HTTPServletContext, HTTPServletRequest and HTTPServletResponse the CrystalReportViewer expects. 
    There certainly are plenty of unit testing frameworks for Java Web Apps out there, if that's where you're headed.
    Sincerely,
    Ted Ueda

  • ServerSocket(TCP/IP) listening in the web container part

    So, if I implement the ServerSocket(TCP/IP) listening in the web container part (Websphere), what is the best way to do this?
    I need to monitor socket state and statistics from browser.
    When I receive message from socket, I must read something from database and send as response to client (meaning I need to create my own thread to do this).
    Solution:
    - to have one servlet with serverSoket listener in it or
    - during web application statup to start my own thread with serverSoket listener
    - or....
    Also there is a problem that websphere write warning when i try do use DB connection from thread I have created!
    Any suggestion?

    hi,
    do you use websphere? version?
    More details:
    http://www.javaranch.com/newsletter/200403/AsynchronousProcessingFromServlets.html
    According to a Technical note from WebSphere support "If a Servlet is spinning its own threads and accessing a database, the J2EE specification is not clear on this, so WebSphere Application Server 5.0 will allow it at this time. IBM is working with Sun to clarify this in the specification, so eventually (i.e. J2EE 1.4) spun threads from a Servlet accessing a database outside of a transaction will not be supported either". Later the same tech note states "Customers should consider changing their application to comply with the J2EE specification."
    and check this
    http://www-1.ibm.com/support/docview.wss?uid=swg21121449

  • Using Local EJB obect in web container that installed in on the same Web AS

    we can use the local ejb object in the application that runs in same JVM.
    The Web Container and EJB Container run in the same JVM when Web AS installed as Minimum Cluster Installation(one cluster node).
    But, what happened if we install the Web AS as Large Cluster Installation? Can we still use the local ejb objects in the Web Container?
    Best regards,
    Raja
    Message was edited by: Raja Nasrallah

    Hi Raja,
    Yes you can. When you use local EJB objects there's no remote communication and the web container will find them in the EJB container of the local cluster node. For the application providers this is transparent - they shouldn't care about the configuration of the cluster.
    Best regards,
    Vladimir
    PS: Please consider <a href="https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm#lostme">rewarding points</a> for helpful answers.

Maybe you are looking for

  • Final Cut Pro 10.0.4 Trial Just wont Work please Help

    Ok i have tried everything and this tria just crashes. First of all let me tell you what i have done . I have deleted all teh preference files. I have deleted any and all events from my drive I have run preference manager and deleted all files throug

  • Full (Level 0) backup to local/NFS disk

    I am new to SAP's BR*Tools, and need advice in configuring it to use RMAN.   1. My backups are to be written to a staging area on our SAN. 2. What specific parameters do I need to configure in the initSID.sap file to achive Full (Level 0) backup to l

  • How do I create a group contact for imessage?

    Is there anyway to create a group contact for iMessage text messaging?

  • My "x" button has disappeared from my tabs. How do I get it back?

    Until recently, when using multiple tabs, I would have a close button or "x" in every tab. I did not make any changes to settings, but now, my close tab button is gone or at least not visible. Currently, the only way I can close individual tabs it by

  • Regarding special characters in XSLT

    hi , i am working on XSLT, as we know that XSLT does not support special characters we need to handle them. can anyone provide me with the entire list of characters that XSLT does not support. I had searched in google but could only find a few. thank