Starting new threads from a servlet

Hi
I read somewhere that starting new threads from a servlet is not supported in the future releases of J2EE .
Any one aware of this.
I have a listener program started as a new thread from the init method of a servlet which is set to load on startup.
I have to think about another way to do this if this is not suppported in the future releases
any comments

Dr clap
Actually I was getting some warning messages in my websphere server console when I tried to make JDBC connections from the thread I opened in the servlet.
Everthing works fine but with the warning messages,
Then someone from IBM answered me in one of the forums quote
Cause: These messages are being produced due to an
"unsupported" environment. When application is
spinning its own threads from an EJB, spinning a
thread and accessing a database is not supported (per
the J2EE specification). One exception to this rule is
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 must allow
for 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.
Since we don't want to promote the usage of these
"naked" threads accessing databases, we are producing
the warning messages. Although they may be filling up
the logs, we feel that these are necessary to warn the
user that they are doing something not in-line with
the intended usage. Customer should consider changing
their application to comply with the
J2EE specification.
"""

Similar Messages

  • Starting new threads from within shutdown hooks

    I'd like to discuss this statement from the java 6 API:
    "A shutdown hook is simply an initialized but unstarted thread. When the virtual machine begins its shutdown sequence it will start all registered shutdown hooks in some unspecified order and let them run concurrently. *When all the hooks have finished it will then run all uninvoked finalizers if finalization-on-exit has been enabled. Finally, the virtual machine will halt*. Note that daemon threads will continue to run during the shutdown sequence, as will non-daemon threads if shutdown was initiated by invoking the exit method. "
    Now, my question is this: If I have a hook that starts a new non-daemon thread and then goes on to complete it's run() method, will the JVM finalize and halt? Or will it wait for my new thread to complete as well?
    I trust the specification, and believe that the JVM will either not allow me to create the thread or will finalize and shutdown even if it is running. However it's not explicitly stated anywhere, and I think that it's a hole in the documentation.
    I'm going to write a test case for this now. But chime in if you have thoughts.

    This is what happens if you start a new thread from a shutdown hook and do not wait for it to finish:
    public class ShutdownTest {
        private static class Shutdownhook extends Thread{
            public void run() {
                System.out.println("Shutdownhook starting");
                Thread t = new Thread(){
                    public void run(){
                        System.out.println("Thread successfully started");
                        try{ Thread.sleep(5000); }
                        catch(Throwable e){ System.out.println("Throwable from sleep: "+e); }
                        System.out.println("Thread successfully finished");
                t.start();
                //try {t.join();} catch (InterruptedException e) {}
                System.out.println("Shutdownhook completing");
        public static void main(String[] args) {
            Runtime.getRuntime().addShutdownHook(new Shutdownhook());
            System.out.println("Exiting from main()");
            Runtime.getRuntime().exit(0);
    Exiting from main()
    Shutdownhook starting
    Shutdownhook completing
    Thread successfully startedHowever, as you might expect, if you join() or wait for the thread's isAlive() to return false, you will be able to complete the thread.
    I'll leave someone else to figure out if that new thread gets finalized and if finalizers on exit is on, what happens. Mostly because it doesn't matter for my purposes.
    Enjoy

  • When i start new task from adf 12.1.3, i receive error.

    Hi,
    When i start new task from adf 12.1.3, i receive error.
    ".... Caused by: java.lang.IllegalStateException: Invalid SCAEntityId "-1". ..."
    How to fix it?
    Thanks.

    When call create instance, receive error
    String task = ims.createProcessInstance(ibpmContext,  pms.getCompositeDN()+"/"+pms.getProcessName());
    ------error------------------------
    BPM-70204
    Exception
    exception.70204.type: error
    exception.70204.severity: 2
    exception.70204.name: Error creating process instance.
    exception.70204.description: Error creating instance for target process default/HelloWorldProject!1.0*soa_39bf35b3-5d40-4af1-b3cc-54e170a8be1f/HelloWorldProcess.
    exception.70204.fix: Verify server log to find the problem cause.
        at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:258)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:474)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:285)
        at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl_12130_WLStub.createProcessInstance(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:84)
        at com.sun.proxy.$Proxy520.createProcessInstance(Unknown Source)
        at view.beans.BPMTaskManagement.initiateBpmTask(BPMTaskManagement.java:75)
        at view.beans.AssignedTasksHelper.startNewProcess(AssignedTasksHelper.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
        at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:1113)
        at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
        at org.apache.myfaces.trinidad.component.UIXComponent.broadcastInContext(UIXComponent.java:364)
        at oracle.adf.view.rich.event.ProxyEvent.broadcastWrappedEvent(ProxyEvent.java:72)
        at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:124)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:1074)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:402)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:202)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
    Caused by: java.lang.IllegalStateException: Invalid SCAEntityId "-1".
        at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean.createComponentInstance(BPMNInstanceManagerBean.java:242)
        at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean_j9rppc_IBPMNCubeInstanceManagerLocalBeanImpl.__WL_invoke(Unknown Source)
        at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:33)
        at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean_j9rppc_IBPMNCubeInstanceManagerLocalBeanImpl.createComponentInstance(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
        at com.sun.proxy.$Proxy333.createComponentInstance(Unknown Source)
        at oracle.bpm.services.instancemanagement.impl.InstanceManagementService.createProcessInstance(InstanceManagementService.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at oracle.bpel.services.workflow.common.WorkflowServiceCacheEventAdvice.invoke(WorkflowServiceCacheEventAdvice.java:114)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at com.sun.proxy.$Proxy343.createProcessInstance(Unknown Source)
        at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean.createProcessInstance(InstanceManagementServiceBean.java:103)
        at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl.__WL_invoke(Unknown Source)
        at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:34)
        at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl.createProcessInstance(Unknown Source)
        at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:226)

  • Messages - missing 'Start New Conversations From'

    Have an iPhone 4 that I am attempting to use without cellular service.
    Am able to use Facetime but am having a problem with Messages.
    In the Settings > Messages > Send & Receive the phone does not display the 'Start New Conversations From' section.
    I am unable to send from Messages. I assume these two items are related.
    I've tried resetting the phone, using a different apple id / icloud account, all to no avail.
    Any ideas?
    TIA

    This worked for me.  Turn off iMessage in Settings---> Messages. Then turn off iPhone. Restart iPhone then turn iMessage back on.   The phone number should reappear.

  • Create or open a new browser from a servlet

    Hi everybody(sorry my english is so terrible), i have one problem .It`s possible to create ,instance or open a new browser from a servlet without javascript?.

    Hi everybody(sorry my english is so terrible), i have
    one problem .It`s possible to create ,instance or
    open a new browser from a servlet without javascript?.Well, sorta. You have to create a link with a target to "_blank" that the user clicks on. For example:
    Some Page
    will open somePage.jsp in a new browser window. There would be no way, other then js to do it automatically (and often those are blocked, now-a-days with pop-up blockers), flash (can be blocked as well, requires a plugin to use, costs money to get the developement kit), or an applet (java program embeded in web page, requires a plugin, can be blocked). Or some other client-side script/application. (ie servlets run on the server so they can't interact with the client's computer. You need something on the client's computer to do the job).

  • IMessage: "Start New Conversations From" setting is ignored

    In my iMessage settings, I have the option set to start new conversations from my email address instead of my phone number. I don't want anyone having my phone number, so this is a VITAL feature for me.
    The problem is that the setting is IGNORED! New conversations are in fact coming from my phone number. I have tried changing the setting back and forth, even wiped my phone and started from scratch, and still, new conversations come from my phone number instead of my email address.
    How can I get iMessage to acknowledge the setting and start new conversations from my email address?
    Thanks!

    This worked for me.  Turn off iMessage in Settings---> Messages. Then turn off iPhone. Restart iPhone then turn iMessage back on.   The phone number should reappear.

  • TS4268 how to get "start new conversations from" on a iphone 4

    when i go into imessage and to send and recieve it only comes up with : You can be reached by iMessage at: then my phone number and email and then it says add an email..   How do I get it to say : Start new conversations from. Right now when I send a message it shows up as my email even though my email isnt selected my phone number is!!!. so my friends dont reply cause they dont know my email. i have a i phone 4 and am very frustrated someone please help me!

    Download previous purchases from the iTunes Store - Support - Apple

  • HT5538 If there is no "start new conversations from", what's wrong then? What should I do?

    I'm getting really tired of chat with my friends from my email, and I can't choose my number in "send and receive". There is no "start new conversations from"
    please help me, i've tried everything

    I would turn imessage off, then
    Hold down the Sleep/Wake button and the home button together until the apple logo appears (ignore the ON/OFF slider) then let both buttons go and wait for device to restart (no data will be lost).
    After that I would turn imessage back on and try to set it like you want.  Make sure you have yourself correctly entere in the contacts app, make sure you have your phone number entered in settings/phone/my number and in have your information entered in settings/general/siri under my info

  • Imessage sends messages from email despite selecting phone number for "start new conversations from"

    On both my phone and my computer I have selected to start new conversations from my phone number, but just now I continued a conversation from my macbook and it sent it from my email address instead of my phone number! All the other answers I found for this question were outdated, I couldn't find "Caller ID" in settings for iOS 8 or Yosemite.

    If this is a continuing conversation, I don't believe the device looks at it as a new conversation, which is what that setting is for, from what I understand. If there is a checkmark by the phone number on all devices, then it should start there, but if the conversation was originally started from the email, I believe it will continue until you start a new conversation.

  • Add telephone number to Start new messages from

    My wife and I both have iphone and we have an ipad. On messaging from the ipad, we would like to have both numbers available to "Start new Messages from" How do i add another number to the ipad in that area?

    Actually, it is possible, but I find that it causes more problems than its worth - for me and my wife anyway. I should qualify this by saying that as long as all of the iPhone numbers are associated with one shared Apple ID, it's possible to do this.
    Settings>Messages>Send & Receive at>You can be reached by iMessages at> Check the phone number that you want to start the conversation from in there. Of course, the phone number has to be listed in there in the first place and you have to remember to change it every time you each want to shows your own number.
    This should explain to you how to add all of your phone numbers if the are not already listed in there.
    http://support.apple.com/kb/HT5538
    Basically, you have to sign out of Messages on all devices, then sign in again on the phones to be able to add the numbers to the iPad.

  • IMessage randomly starts new conversation from email address

    My wife's phone has been having this problem for a while - both on her iPhone 5, and on her new iPhone 6.
    In the settings for iMessage, it says she can be reached by iMessage at ___, and then lists her Verizon cellular number, and her iCloud email address. Under "start new conversations from" it lists her Verizon cellular number, and her iCloud email address, with the phone numbering having a check mark.
    The issue: some iMessages she sends me will be from her phone number, and some from her email address. There appears to be no rhyme or reason to where the  iMessage originates. The only clue I can decipher is it appears that when she sends photos, it might be coming through her email address, but I can say that's for certain.
    Any idea what the cause is?

    My wife's phone has been having this problem for a while - both on her iPhone 5, and on her new iPhone 6.
    In the settings for iMessage, it says she can be reached by iMessage at ___, and then lists her Verizon cellular number, and her iCloud email address. Under "start new conversations from" it lists her Verizon cellular number, and her iCloud email address, with the phone numbering having a check mark.
    The issue: some iMessages she sends me will be from her phone number, and some from her email address. There appears to be no rhyme or reason to where the  iMessage originates. The only clue I can decipher is it appears that when she sends photos, it might be coming through her email address, but I can say that's for certain.
    Any idea what the cause is?

  • IMessage, Start new conversations from number missing?

    I sign in with my Apple-ID. But then apperienlty you can choose which you will start new conversations from, hotmail or number, but that does not appear for me? Settings ---> Messages ---> Send and recieve.       PLEASE HELP ME

    This worked for me.  Turn off iMessage in Settings---> Messages. Then turn off iPhone. Restart iPhone then turn iMessage back on.   The phone number should reappear.

  • TS4268 Missing Phone Number at "Start new conversations from"

    How come there is missing of the phone number at the "Start new conversations from:" inside Settings -> Messages -> Send & Receive" and only have the e-mail address but both of the phone number and e-mail address under "You can be reached by iMessage at:", please advise how to add it back ?

    Yes, I have solved it.  You could try to go from Settings -> Messages, turn the iMessage from ON to OFF, then you switch off your iphone and turn it on; go back to Settings -> Messages, change the iMessage from OFF to ON, then switch off your iphone and turn it back on, go to check whether you could see or add back the phone number assoicated with the iMessage.   Good Luck !

  • Is there a way two start a new thread from a BLS to do some background work

    Hi all-
    I am thinking about creative ways to do offline processing...  Our MII app loads a list of current orders for the user's browser.  The user selects an order and requests back to MII for running the SAP transactions.  Then their browser is reloaded with the up to date list again.  When SAP is down they cannot process.
    Certainly a traditional store and forward where all data is loaded to MII and transaction requests are queued up to be processed by MII/SAP in the background is possible. Con: Data synch issues are very complex however.  Pro: It does provide excellent response time to the user.
    I am just noodling about options... 
    >>Is there a way to start a thread that could take the XML output going to the web page and store that in the database in the background?  I.E.  release the data to the irpt and terminate the user's BLS while a background BLS is saving a copy of the XML/orders to the database.
    Then when offline, the user can work from the last current list of orders they had.  When SAP comes back up the system goes back to online operation.  Thus the data sync would only be temporary.  It does not have the response time benefit however.  Maybe some more thinking, ...But I really want to know if there is a way to multi-thread this app.
    Thanks,
    --Amy Smith
    --Haworth

    I assume you're still running 12.0?  12.1 introduces a new action block for transaction calls, which allows for async threads to nested transaction calls.
    I don't know how using query caching would work on the XacuteQuery template for your list of orders - especially when it would attempt to renew the cache when SAP was unavailable.
    An XML file periodically saved to the web tab of your project would also provide you with a cache approach to servicing the user screen - a simple point of abstraction.

  • Start a new thread from JSP ???

    suppose my JSP code is like this,
    <%
    Obj.heavyProcess();
    %>
    How can I start a new thread to do
    out.println(" ");
    out.flush("");
    while the heavyProcess is going on? I need to do this because my ISP will cut any Idle connection after certain time and my heavyProcess takes a long time to finish.
    for certain reasons, I can not do waiting page, refreshing, etc.

    The same way as you would from a normal java application. Write your thread class
    package com.yourpkg;
    public class YourHeavyProcess implements Runnable{
       private YourObject obj;
       public YourHeavyProcess(YourObject obj){
                this.obj = obj;
       public void run(){
           obj.heavyProcess();
    }and create and invoke this thread from your jsp.
    <%
            YourObject obj = new YourObject();
            Thread t = new Thread(new YourHeavyProcess(obj));
            t.start();
    %>
    out.println()..;
    out.flush()....;Note that the thread cannot write anything to the output stream as the response is over and done with. It can only perform backend tasks (like data archival for instance)
    You could consider using a Timer and a TimerTask class which provides a slightly higher abstraction layer over threads . Look at [url http://forum.java.sun.com/thread.jspa?threadID=758874]this  post (reply 48) for an example.
    And finally you wouldnt want a large number of threads to be generated and competing for cpu time on your web server (whose primary responsibility is to receive http requests and send responses). You can use a thread pool to manage the number of threads spawned by your application. If you use java5, take a look at the [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executors.html]java.util.concurrent.Executor class for thread pool implementations that you can use off the shelf.
    cheers,
    ram.

Maybe you are looking for