Thread issue in jsp.....

I understand that the j2ee container (tomcat or jrun...) creates ONE instance of the jsp page (i.e. compiled into servlet class) when the jsp page (let's say, myPage.jsp) is accessed the first time. All request for this jsp page will be done through thread.
My questions are:
1. If I instantiate an object (say, myObject) within the scriptlet, will the container create one instance of this object for each "jsp" thread? Or will there be only one instance of the myObject object and each "jsp" thread be running on a thread of myObject?!
2. If I use javaBean in my jsp (i.e. use the <jsp:useBean..../> tag), I know that the container will create a new instance of the bean class. So if there are multiple request on the same jsp page, is it true that many instances of the bean will be created? And there will be no thread issue involed?!!
Thanks!!

When you create an instance of an object inside a scriplet using <% ... %>, that instance is local to the service) method of the servlet corresponding to the JSP. So there is no threading related issue.
Smilar is the argument why there is not threading related issue with using <jsp:useBean>

Similar Messages

  • Thread issue...please clarify

    I am kind of new in Servlet/JSP world.
    I have a servlet and it gets the information from the database and put the information in a bean . In the servlet, the bean is placed in session object. The code is as follows:
    doPost(......)
    HttpSession session = req.getSession(true);
    //Here session is local variable to doPost()
    session.setAttribute("name", databean);
    //databean is the bean created by servlet inside doPost()
    //Then sendRedirect to a JSP page to show the information from the bean.
    The JSP retrives the values as bellow:
    <jsp:useBean id="name" class="common.Databean"
         scope="session" />
    <%
              //Get the information from the bean               
              Rowbean [] rows = name.getRows();
              for(int x = 0; x < rows.length ; x++)
              String description = rows[x].getDescription();
              String category_ident = rows[x].getCategory_ident();
    %>
    My question is :
    Is there any safe threading issue in this procedure..to be specific is that session object is accessable by any other client calling same time the servlet..
    Any explanation will be appreciated.
    Shakilc

    It is quite possible that the session can be accessed by two threads. This would be the case if the user accesses your servlet from two browser windows (or tabs). Browsers have different behaviors with regard to interacting with your application sessions. For example, two IE windows will be treated as two sessions, whereas, two Netscape tabs (not windows) will be treated as a single session. This behavior is browser specific. So, it is quite likely that you may be have two threads accessing your session at the same time. The session implementation is typically synchronized, so that two or more threads cannot modify a session value at the same time, but, one thread can immediately overwrite a value stored by another thread. This is normal behavior and typically acceptable behavior.
    Hope this answers your question.
    Sonny

  • JPS thread issues and Tag Libs

    I was curious as to the thread issues with using Tag Libs inside of JPS'.
    I realize that many threads can access an individual JSP and that a JSP (at least in tomcat) uses the same instance of its tag over and over again.
    But I have the following questions:
    Are there thread race issues with using tags?
    If there are thread race issues wouldn't it be a bad idea to use the setter methods on a tag or have any instance level variables in a tag?
    Is the access to the tag synchronized in the creation of the JSP/Servlet?
    Thanks for your time,
    Nate

    I actually decompiled the JSP that was created by tomcat and it (the complied JSP) is actually using a factory to get an instance of a tag. When the complied JSP is done with the Tag instance it calls the release() method on the Tag and then the factory is allowed to reuse that Tag.
    So, basically when Tags are used like they are supposed to be, there are no threading/race issues.
    I have downloaded the Tag specs, but haven't been able to read them yet. After I do get the chance to read them, I will try and post my findings.

  • Locked thread issue

    We encountered the following locked thread issue. Refer to the thread dump logs.
    Any idea on the root cause of the issue? It seens to us that it is the weblogic app server codes that are causing the locked threads.
    Will appreciate any advise.
    "ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'" id=22 idx=0x50 tid=329 prio=5 alive, in native, blocked, daemon
    -- Blocked trying to get lock: java/lang/String@0x9a73910[fat lock]
    at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
    at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1674)[optimized]
    at jrockit/vm/Locks.lockFat(Locks.java:1775)[optimized]
    at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1311)[optimized]
    at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1258)[optimized]
    at jrockit/vm/Locks.monitorEnter(Locks.java:2455)[optimized]
    at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:153)
    at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" id=24 idx=0x58 tid=331 prio=5 alive, in native, blocked, daemon
    -- Blocked trying to get lock: java/lang/String@0x9a73910[fat lock]
    at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
    at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1674)[optimized]
    at jrockit/vm/Locks.lockFat(Locks.java:1775)[optimized]
    at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1311)[optimized]
    at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1258)[optimized]
    at jrockit/vm/Locks.monitorEnter(Locks.java:2455)[optimized]
    at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:153)
    at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" id=23 idx=0x54 tid=330 prio=5 alive, in native, daemon
    at jrockit/ext/epoll/EPoll.epollWait0(IIII)I(Native Method)
    at jrockit/ext/epoll/EPoll.epollWait(EPoll.java:103)
    at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:156)
    ^-- Holding lock: java/lang/String@0x9a73910[fat lock]
    at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
    at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
    at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
    at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace

    This is standard behavior for the socket muxer threads. Only one of the epoll muxer threads is actually holding the lock at any one time. Here is the output of part of my thread dump on Linux with WLS 10.3.4 on JRockit on startup. The server is not hung up at all. Make a request on the server and take another thread dump and you'll see the lock change.
    1st dump with ExecuteThread 1 waiting to get the lock from ExecuteThread 2
    "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" id=25 idx=0x58 tid=26836 prio=5 alive, blocked, native_blocked, daemon
        -- Blocked trying to get lock: java/lang/String@0xe82d6ec0[thin lock]
        at jrockit/vm/Threads.sleep(I)V(Native Method)
        at jrockit/vm/Locks.waitForThinRelease(Locks.java:955)
        at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1083)
        at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1005)
        at jrockit/vm/Locks.monitorEnter(Locks.java:2179)
        at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:153)
        at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
        at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
        -- end of trace
    "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" id=26 idx=0x5c tid=26837 prio=5 alive, in native, daemon
        at jrockit/ext/epoll/EPoll.epollWait0(ILjava/nio/ByteBuffer;II)I(Native Method)
        at jrockit/ext/epoll/EPoll.epollWait(EPoll.java:115)
        at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:156)
        ^-- Holding lock: java/lang/String@0xe82d6ec0[thin lock]
        at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
        at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
        -- end of trace2nd dump after the server servers a request with ExecuteThread 2 waiting to get the lock from ExecuteThread 1
    "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" id=25 idx=0x58 tid=26836 prio=5 alive, in native, daemon
        at jrockit/ext/epoll/EPoll.epollWait0(ILjava/nio/ByteBuffer;II)I(Native Method)
        at jrockit/ext/epoll/EPoll.epollWait(EPoll.java:115)
        at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:156)
        ^-- Holding lock: java/lang/String@0xe82d6ec0[fat lock]
        at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
        at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
        -- end of trace
    "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" id=26 idx=0x5c tid=26837 prio=5 alive, blocked, native_blocked, daemon
        -- Blocked trying to get lock: java/lang/String@0xe82d6ec0[fat lock]
        at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
        at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1411)
        at jrockit/vm/Locks.lockFat(Locks.java:1512)
        at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1054)
        at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:1005)
        at jrockit/vm/Locks.monitorEnter(Locks.java:2179)
        at weblogic/socket/EPollSocketMuxer.processSockets(EPollSocketMuxer.java:153)
        at weblogic/socket/SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic/socket/SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic/kernel/ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic/kernel/ExecuteThread.run(ExecuteThread.java:117)
        at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
        -- end of traceHere is a blog on this topic: http://jojovedder.blogspot.com/2009/05/weblogic-socket-muxers-are-not-stuck.html

  • Using threads in a jsp page

    I would like to know wether any one had used threads in a jsp page
    like one thread gets the data from database while other shows some text saying "getting data from database"
    Thank you

    "getting data from database" is not a valid message
    to give. You might think it's interesting, but the
    people using your application don't give a damn about
    you fetching something from the database.
    The basic rule is: people are stupid, don't give them
    any reason to be confused.Funny stuff, Ill remember that :-)

  • Problem Deploying Composites to Oracle SOA 11.1.1.5 (STUCK Thread Issue)

    Hi All,
    I got stuck thread issues when deploying composites to Oracle SOA 11.1.1.5 running on Windows Server 2008 R2. Even the SimpleApproval composite which ships with the standard installation is having trouble deploying.
    The composites are deploying fine in Oracle SOA 11.1.1.5 running on Windows XP.
    I'm not so good with thread dumps, so I post it below for rescue.
    Please advice,
    Rommel
    <Jul 18, 2011 10:15:25 AM AST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] Ex
    ecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' has been bus
    y for "605" seconds working on the request "weblogic.servlet.internal.ServletReq
    uestImpl@32d047d4[
    POST /soa-infra/deployer HTTP/1.1
    Connection: TE
    TE: trailers, deflate, gzip, compress
    User-Agent: Oracle HTTPClient Version 10h
    Accept-Encoding: gzip, x-gzip, compress, x-compress
    ECID-Context:
    Authorization: Basic bmFnaGl3ZWJsb2dpY3NvYTp3ZWJsb2dpY3NvYTEwIQ==
    Content-type: application/octet-stream
    Content-Length: 25876
    ]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds
    . Stack trace:
    Thread-55 "[STUCK] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-
    tuning)'" <alive, in native, suspended, priority=1, DAEMON> {
    jrockit.net.SocketNativeIO.readBytesPinned(SocketNativeIO.java:???)
    jrockit.net.SocketNativeIO.socketRead(SocketNativeIO.java:24)
    java.net.SocketInputStream.socketRead0(SocketInputStream.java:???)
    java.net.SocketInputStream.read(SocketInputStream.java:107)
    oracle.net.nt.MetricsEnabledInputStream.read(TcpNTAdapter.java:707)
    oracle.net.ns.Packet.receive(Packet.java:243)
    oracle.net.ns.DataPacket.receive(DataPacket.java:106)
    oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:309)
    oracle.net.ns.NetInputStream.read(NetInputStream.java:254)
    oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrap
    per.java:93)
    oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1573)
    oracle.jdbc.driver.T4C8TTILobd.unmarshalLobData(T4C8TTILobd.java:360)
    oracle.jdbc.driver.T4C8TTILob.readLOBD(T4C8TTILob.java:787)
    oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:303)
    oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:181)
    oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:139)
    oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2690)
    ^-- Holding lock: oracle.jdbc.driver.T4CConnection@32386377[thin lock]
    oracle.sql.BLOB.getBytes(BLOB.java:557)
    oracle.jdbc.driver.OracleBlobInputStream.needBytes(OracleBlobInputStream.jav
    a:188)
    oracle.jdbc.driver.OracleBufferedStream.readInternal(OracleBufferedStream.ja
    va:171)
    oracle.jdbc.driver.OracleBufferedStream.read(OracleBufferedStream.java:151)
    ^-- Holding lock: oracle.jdbc.driver.OracleBlobInputStream@341d0b87[thin loc
    k]
    java.io.BufferedInputStream.fill(BufferedInputStream.java:189)
    java.io.BufferedInputStream.read(BufferedInputStream.java:236)
    ^-- Holding lock: oracle.mds.internal.persistence.db.DBInputStream@341d0bb2[
    thin lock]
    oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:363)
    oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:230)
    oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:217)
    oracle.fabric.common.wsdl.SchemaBuilder.parseXMLSrc(SchemaBuilder.java:1016)
    oracle.fabric.common.wsdl.SchemaBuilder.parseXSDSrc(SchemaBuilder.java:984)
    oracle.fabric.common.wsdl.SchemaBuilder.processSchemaImportsAndInclude(Schem
    aBuilder.java:755)
    oracle.fabric.common.wsdl.SchemaBuilder.loadEmbeddedSchemas(SchemaBuilder.ja
    va:474)
    oracle.fabric.common.wsdl.SchemaBuilder.loadSchemasFromWSDL(SchemaBuilder.ja
    va:423)
    oracle.fabric.common.wsdl.SchemaBuilder.loadAllSchemas(SchemaBuilder.java:21
    4)
    oracle.fabric.common.wsdl.SchemaManager.loadAllXSD(SchemaManager.java:209)
    ^-- Holding lock: oracle.fabric.common.wsdl.SchemaManager@36279195[thin lock
    oracle.fabric.common.wsdl.SchemaManager.getXSDEntityResolver(SchemaManager.j
    ava:424)
    oracle.fabric.composite.model.CompositeModel.loadImports(CompositeModel.java
    :361)
    oracle.fabric.composite.model.CompositeModel.getWSDLManager(CompositeModel.j
    ava:196)
    oracle.integration.platform.blocks.adapter.AbstractAdapterBindingComponent.g
    etWSDLDefinition(AbstractAdapterBindingComponent.java:168)
    oracle.integration.platform.blocks.adapter.AdapterReference.loadDefinition(A
    dapterReference.java:543)
    oracle.integration.platform.blocks.adapter.AdapterReference.load(AdapterRefe
    rence.java:377)
    oracle.integration.platform.blocks.adapter.AdapterReference.load(AdapterRefe
    rence.java:73)
    oracle.integration.platform.blocks.deploy.CompositeDeploymentConnection.depl
    oyReferences(CompositeDeploymentConnection.java:177)
    oracle.integration.platform.blocks.deploy.CompositeDeploymentConnection.depl
    oy(CompositeDeploymentConnection.java:81)
    oracle.integration.platform.blocks.deploy.CompositeDeploymentManagerImpl.ini
    tDeployment(CompositeDeploymentManagerImpl.java:143)
    oracle.integration.platform.blocks.deploy.CompositeDeploymentManagerImpl.loa
    d(CompositeDeploymentManagerImpl.java:61)
    sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:?
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:27
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopU
    tils.java:306)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint
    (ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
    iveMethodInvocation.java:148)
    oracle.integration.platform.blocks.deploy.DeploymentEventPublisher.invoke(De
    ploymentEventPublisher.java:57)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
    iveMethodInvocation.java:148)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPro
    xy.java:151)
    $Proxy309.load(Unknown Source)
    oracle.integration.platform.blocks.deploy.StandaloneCompositeDeploymentCoord
    inatorImpl.coordinateCompositeDeployment(StandaloneCompositeDeploymentCoordinato
    rImpl.java:54)
    oracle.integration.platform.blocks.deploy.servlet.BaseDeployProcessor.deploy
    NewComposite(BaseDeployProcessor.java:365)
    oracle.integration.platform.blocks.deploy.servlet.BaseDeployProcessor.deploy
    SARs(BaseDeployProcessor.java:123)
    ^-- Holding lock: java.lang.Object@3621c97c[thin lock]
    oracle.integration.platform.blocks.deploy.servlet.DeployProcessor.doDeployWo
    rk(DeployProcessor.java:122)
    oracle.integration.platform.blocks.deploy.servlet.DeployProcessor.doDeployWo
    rk(DeployProcessor.java:107)
    oracle.integration.platform.blocks.deploy.servlet.DeployProcessor.doDeploy(D
    eployProcessor.java:96)
    oracle.integration.platform.blocks.deploy.servlet.DeployProcessor.process(De
    ployProcessor.java:68)
    oracle.integration.platform.blocks.deploy.servlet.CompositeDeployerServlet.d
    oPostInsideLoggingSession(CompositeDeployerServlet.java:141)
    oracle.integration.platform.blocks.deploy.servlet.CompositeDeployerServlet.d
    oPost(CompositeDeployerServlet.java:119)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:700)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSe
    curityHelper.java:224)
    weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelpe
    r.java:108)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:206)
    weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)
    oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:299)
    oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java
    :405)
    oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:98)
    oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)
    oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:299)
    oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java
    :405)
    oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:98)
    oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)
    oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:86)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapR
    un(WebAppServletContext.java:3687)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:3681)
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:308)
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:116)
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletC
    ontext.java:2213)
    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.
    java:2135)
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:142
    0)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:203)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:170)
    >

    I just noted that this is a database connectivity issue because when I point my soa related data sources (mds, soa_infra, etc...)to a local xe database, the deployment is doing fine.

  • Need help about Thread issue

    Given from scjp
    1.public static void main(String[] args) {
    2.        NameRunnable nr = new NameRunnable();
    3.        Thread t1 = new Thread(nr);              
    4.        t1.start();
    5.        t1.join();                   
    }There are some questions which i made up myself to test how i understand about the thread issue and I really need some experts to confirm about it.
    Question 1: At line 3, how many threads we have now ?
    my answer is
    there are 2 threads. the first one is main thread and the second one is t.
    I am not sure about the t thread because in the book, they indicate that after instantiating the thread,
    we just have a thread object but not a true thread.
    Question 2: At line 4, after t1.start(), which thread will be executed first.
    My answer is
    we dont know because it depends on the scheduler.
    Question 3: what t1.join() does ?
    my answer is
    blablabla.What I am thinking is t.join() joins the current thread to the end of t so that when t finishes the current thread can run again. However, which one is the current thread now. That is why I am stuck
    Please help me. I appreciate
    Edited by: newbie on Nov 25, 2010 4:46 PM
    Edited by: newbie on Nov 25, 2010 4:47 PM
    Edited by: newbie on Nov 25, 2010 4:49 PM

    newbie wrote:
    Given from scjp
    public static void main(String[] args) {
    NameRunnable nr = new NameRunnable();
    Thread t1 = new Thread(nr);              
    t1.start();
    t1.join();                   
    }There are some questions which i made up myself to test how i understand about the thread issue and I really need some experts to confirm about it.
    Question 1: At line 3, how many threads we have now ?
    my answer is
    there are 2 threads. the first one is main thread and the second one is t.
    I am not sure about the t thread because in the book, they indicate that after instantiating the thread,
    we just have a thread object but not a true thread.
    Don't use code blocks for prose. It won't autowrap and can lead to display problems if a line is too long.
    Which is line 3?
    What do you mean by "how many threads to we have?" Do you mean how many Thread objects exist, or how many threads (lower case "t") are executing.
    After you have called t1.start(), there are at least 2 threads executing--the main thread, and the one you started. I say "at least" because the JVM has some administrative threads of its own.
    Question 2: At line 4, after t1.start(), which thread will be execute first.
    My answer is
    we dont know because it depends on the scheduler.
    Correct. And don't think of one executing "first." They can take turns, or they can both execute at the same time (if you have a multicore or multi-CPU machine).
    Question 3: what t1.join() does ?
    my answer is
    blablabla.What I am thinking is t.join() joins the current thread to the end of t so that when t finishes the current thread can run again. However, which one is the current thread now. That is why I am stuck
    Please help me. I appreciateDid you read [url http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html#join()]the docs for join()? They tell you exactly what it does. If you don't understand after reading, post again.

  • JMeter +JSF 1.2 +Multiple threads issue

    I have an issue when running JMeter with an JSF 1.2 application.
    I have the regex and xpath fix working. It is extracting the correct ViewState value, but only as long as I am running one thread. If I start a thread group with multiple threads the regex/xpath will eventually return the default value and the test will fail.
    Scenario 1 (SUCCESS):
    I run one thread and one thread group, regex/xpath return the
    "ViewState" value correctly and the test runs perfectly until I stop it.
    Scenario 2 (FAILURE):
    I run multiple threads and one thread group, regex/xpath
    eventually return the DEFAULT value instead the "ViewState" value to
    all but one thread. The more threads the faster they fail. It really
    seems like there is a threading issue.
    Has anyone experienced similar issues when running regex/xpath and multiple threads?

    Thank you, I tried what you suggested and revealed something interesting. The application in some cases prints the following on the screen:
    *~com.sun.faces.saveStateFieldMarker~*, and it is in those cases JMETER Xpath extraction fails.
    Well I have to look more into it. Thank again for the help.

  • Deadlock with thread issues while generating reports with Crystal Report XI

    We are facing deadlock with thread issues while generating report with Crystal Report XI
    Version Number is 11.0 and the database used is Oracle
    In the log file on line number 74350  by 2008/12/16 13:35:54 there is a dead lock with Thread: u20184u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '0'.
    And  a dead lock with Thread: u20180u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '4'.
    Exactly after 10 minutes we can see the thread 4 and 0 are declared as STUCK by 2008/12/16  13:45:54 .
    Is this an existing issue with Crystal Report?
    Is there some solution for this problem?
    THE LOG FILE INFORMATION IS GIVEN BELOW
    [deadlocked thread] [ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@15214b9' that is held by thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
         com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
         com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
         com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
         com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
         com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    [deadlocked thread] [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@12e0415' that is held by thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
         com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
         com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
         com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.a(Unknown Source)
         com.crystaldecisions.reports.common.ab.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
         com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
         com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
         com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
         com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Can you please suggest any work around for this?

    I'm not referring to Servlet threading issues.
    I'll clarify.
    You have two threads, both entering ReportClientDocument.open(...) method.
    Thread 4 is waiting to acquire 'com.crystaldecisions.reports.queryengine.av@15214b9'
    Thread 0 is waiting to acquire ''com.crystaldecisions.reports.queryengine.av@12e0415'
    So I'm thinking ??? are they the same objects?
    My specific question concerning the ReportClientDocument is that both are calling open - i.e., trying to open a new report.  You wouldn't be trying to open different reports using the same ReportClientDocument - so was wondering if you've cached the RCD and trying to open two different reports at the same time on the same instance via different threads.
    You'd normally tie a ReportClientDocument instance to a HTTP Session, to ensure each user gets their own copy.
    Sincerely,
    Ted Ueda

  • Timed out issue in jsp page!

    Dears,
    It is really amazing for me to see this issue in my application which I deployed in Oracle Application Server 10g r2.
    I am using JDeveloper 10g to create jsp pages.
    On one jsp page i am displaying 15 html tables for a report.
    All tables have 1 query to get records from oracle 10g database.
    Am opening one connection and than one by one running queries just before each table and rendering data through ResultSet
    (which is scrollable).
    If I test this page from JDeveloper, it is displaying fine.
    But when I deploy this page in Oracle Application Server 10g,
    and create a portlet and show this jsp page in portlet and open this page,
    this page most of the time giving 'TIMED OUT', and a few times displaying report properly.
    I tried PreparedStatement to run multiple queries for Oracle DB, but couldn't make it successfully.
    BTW,
    I checked my OAS log, it shows following error:
    09/03/16 18:39:08 hrwfapp: [instance=(null), id=(null)] ERROR: Request has exceeded its warning timeout Time[elapsed=61046ms.
    Warning timeout=20000ms.] Request[id=5003532663665,3 providerId=493501 portletId=117 portletName=AttritionReports
    portletInstance=35555_ATTRITIONREPORTS_493501 user=PUBLIC] Thread[ name=AJPRequestHandler-ApplicationServerThread-6
    priority=5 alive=true interrupted=false groupName=ApplicationServerThreadGroup]
    Please help me in this regard, what should I do to avoid Timed out issue.
    Best Regards

    Hi,
    if this occurs only in combination with portlets then I would try the Oracle Portal forum for help or use customer support to help you analyzing the issue
    Frank

  • Issue in JSP on Weblogic

    I am facing one issue
    Please look into the follwoing thread
    http://forum.java.sun.com/thread.jspa?threadID=5124070
    It is quite urgent
    ~Aman

    The ResourceBundle looks for the properties file in the classpath.
    "Neeraj Jain" <[email protected]> wrote in message
    news:[email protected]..
    I'm trying the i18n stuff within JSP and to run it on weblogic,but getting
    the error
    "java.util.MissingResourceException: Can't find resource for base name
    Message, locale en_US"
    I have tried to put properties files in the
    /weblogic/myserver/serverclasses
    and also restarted the server but it did't work.Please tell me thesolution:
    where to put the properties file in Weblogic.
    BTW it worked fine when i tried it on JSWDK.
    Thanks,

  • Threading issues - Best way to debug

    Hey everyone... I have a small server program that I wrote in Java. Its module based where each thread that is created runs through a list of modules and returns the output. It works just fine and I am doing a little stress test using Siege. I set it up running 50 concurrent users with no delay and take millions of requests with no errors at all.
    However, when I move it up to 125 concurrent users, I start getting NullPointerExceptions on a fairly routine basis (inside of one of the modules). The server is still running with no issues, just with that many users it appears to have a bug.
    I was wondering what the best way figure out why this would be happening. Or is this kind of thing to be expected and I should just implement some method of throttling for the threads. I plan to do that eventually, just trying to get the bugs out first.
    Thanks in advance!

    I think you are seeing the NPE concurrent scenario because of the assumptions you code is making about how JVM should behave. You code may be making assumption of "happens-before" pattern which may seem valid when you look at the code, but in fact are not.
    Take a look at this presentation that outlines the Java Memory model and defines the contract between concurrent programs and JVM.
    http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-1630&yr=2006&track=coreplatform
    Throttling the method is a bad idea (and a cop out). How would you arrive at the optimal number threads that can safely access your program ? Will your code be portable when it is deployed on a computer with different computing power than what you are testing on ?
    Hope this helps.
    -Prashant

  • Issue with JSPs with inner classes (bug)

    FYI:
    Turning on Versioning in the registry (Disable=0) JSPs with inner classes causes the following IllegalAccessException...
    This has been confirmed with SP3 and SP4 with our testing...
    14/Jan/2002 13:26:24:4] error: Exception: SERVLET-run_failed: Failed in running template: /NASApp/fortune/foo.jsp, java
    lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
    xception Stack Trace:
    ava.lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
    at jsp.APPS.fortune.foo._jspService(foo.java:78)
    at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPRunner.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Looking for work around....
    Cheers,
    Martin Gee

    I do not see why you would use two sorts.
    And what is the issue exactly by the way? Errors?
    So, the records before the Merge Join need to come sorted, to achieve this simply tick:
    Arthur My Blog

  • Memory leaks and multi threading issues in managed client.

    In our company we use a lot of Oracle, and after the release of the managed provider we migrated all applications to it. First the  things were very impressive : the new client was faster, but after some days applications that uses 100MB with old client goes to 1GB and up. The memory is not the only issue, we use a lot of multi threading, and we experience connection drops and not disposal, after 1 days working one of the application had over 100 sessions on the server. I think there is something wrong with connection pool and multi threading.
    Is someone experience same problems.
    Yesterday we went back with unmanaged provider. Now things are back to normal.

    connection drops: did you try to use "Validate Connection=true" parameter in your connection string?
    the new client was faster: are you sure with this statement? Even in 64bit environment? I got quite serious performance problems when running application under 64bit process: https://forums.oracle.com/thread/2595323

  • Hi Guys! Will you share your thoughts on a Thread issue?

    Hi! I am working on figuring out how to get my application to use threads to enable the simultaneous movement of (n) balls across the JFrame area. The task is to enable the user to click on the application and with each click a new ball should be created as a Thread and then it should bounce back and forth across the screen.
    I have been working on this now for a couple of days. It would be really great if one of you guys could help me! :-)
    Here are my specific issues:
    I am using the mousePressed() method to generate the data needed to instantiate a Ball object. However, I cannot get it to work as a Thread.
    I tried calling the start() method on it but all that happens is the application stays blank.
    I cannot get this thing to work -and I really need to make it work today -- Please --- is there a sweetheart out there who will take a minute to help? ;-)
    Jennifer
    My code is below:
    Balls.java
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Balls extends JFrame implements MouseListener
          private int x, y, r, g, b;//Variables to hold x,y and color values
          private Vector basketOBalls;//Hold all of the Ball objects (and Threads created)
          private Ball ballFactory;//Ball objects created here
            Method Name: Balls()
            Return Value: none
            Input Parameters: None
            Method Description: Constructor
          public Balls()
            //call to super for Title of app
            super( " Bouncing Balls " );
            //Listen for mouse events
            addMouseListener( this ); 
            //instantiate the basketOBalls object
            basketOBalls = new Vector(20);
                //Set Initial JFrame Window Size
            setSize( 400, 400 );
         //Show it!
         show();
         }//EOConstructor
            Method Name: mousePressed(MouseEvent e)
            Return Value: none
            Input Parameters: MouseEvent
            Method Description: This takes the info from the users
            mouse click and creates a new Ball Object and then adds it
            to the basketOBalls Vector. Presently, it (incorrectly?) also
            calls the repaint() method in order to draw the ball to the
            screen.
           public void mousePressed( MouseEvent e )
               x = e.getX();//set x value
               y = e.getY();//set y value
               r = 1 + (int) ( 254 * Math.random() );//set red value
               g = 1 + (int) ( 254 * Math.random() );//set green value
               b = 1 + (int) ( 254 * Math.random() );//set blue value
               Color colorin = new Color( r, g, b );
               ballFactory = new Ball( x, y, colorin );
               //new Thread(ballFactory).start(); //This is the Problem area!!!!!!!!!!!!!!!!!!!!!
               basketOBalls.addElement( ballFactory );
               repaint();
            }//EOmP
            Method Name: paint( Graphics g )
            Return Value: none
            Input Parameters: Graphics Object g
            Method Description: Walk through the Vector to
            explicitly cast each object back as a Ball and
            then calls the Ball draw() and ball move() methods
            in order to make the balls move on the screen.
        public void paint( Graphics g )
            Ball b;
            for( int i = 0; i < basketOBalls.size(); i++)
               b = (Ball) (basketOBalls.elementAt(i));
               b.draw(g);
               b.move();
            }//EOFor
          }//EOpaint
            Method Name: main()
            Return Value: none
            Input Parameters: String args[]
            Method Description: This makes it all go.
          public static void main( String args[] )
            Balls app = new Balls();
            app.addWindowListener(
              new WindowAdapter()
                     public void windowClosing( WindowEvent e )
                                    System.exit(0);
                     }//EOwindowClosing Method
              }//EOWindowAdapter Method
              );//EOaddWindowListener Argument
          }//EOMain
        public void mouseClicked( MouseEvent e ) { }
        public void mouseReleased( MouseEvent e ) { }
        public void mouseEntered( MouseEvent e ) { }
        public void mouseExited( MouseEvent e ) { }
    }//EOFBall.java
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Ball extends JFrame //implements Runnable
            public static final int APP_SIZE = 400;//set bounds for screen area
         public static final int RADIUS = 15;//set size of balls
            private Color bgColor = java.awt.Color.lightGray;//may be used to clear background of JFrame
         private int x, y;//x & y coordinates
         private int speedX, speedY;//distances to use to redraw the balls
            private Color color = null;//the color of a ball
            Method Name: Ball(int initX, int initY, Color colorin) 
            Return Value: none
            Input Parameters: int, int , color
            Method Description: Constructor that creates a Ball object
         public Ball(int initX, int initY, Color colorin)
              x = initX;
              y = initY;
                    color = colorin;
                 speedX = (int)(1 + (Math.random() * 10));
              speedY = (int)(1 + (Math.random() * 10));
            Method Name: move()
            Return Value: none
            Input Parameters: none
            Method Description: This calculates the balls position and keeps it within
            the 400 pixel size of the application frame.
         public void move()
              x += speedX;
              y += speedY;
              if ((x - RADIUS < 0) || (x + RADIUS > APP_SIZE))
                   speedX = -speedX;
                   x += speedX;
              if ((y - RADIUS < 0) || (y + RADIUS > APP_SIZE))
                   speedY = -speedY;
                   y += speedY;
         } //EOMove
            Method Name: draw(Graphics bg) 
            Return Value: none
            Input Parameters: graphics
            Method Description: This method is how the ball draws itself
            public void draw(Graphics bg)
                bg.setColor( color );
                bg.fillOval(x - RADIUS, y - RADIUS, 2 * RADIUS, 2 * RADIUS);
    //PROBLEM AREA PROBLEM AREA PROBLEM AREA PROBLEM AREA PROBLEM AREA PROBLEM AREA
            Method Name: run() 
            Return Value: none
            Input Parameters: none
            Method Description: This method is called by start() in the Balls.java file
            found in the mousePressed() method. however, it does not work properly.
         public void run()
               while(true)
              try
                 Thread.sleep(100);
                       move();
                       draw(g);
                       repaint();
                    catch(Exception e)
                    e.printStackTrace( System.out );
        }//EOF

    There needs to be only one thread. On every mouse pressed just add a new Ball object to the vector located in Balls class. That thread need only invoke a repaint on your main class called Balls.
    public class Balls extends JFrame implements Runnable,MouseListener{
    Vector vector = new Vector();
    public static void main(String[] args){
    Balls balls = new Balls(); balls.setSize(400,400);
    balls.setVisible(true);
    Thread thread = new Thread(this);
    thread.start();
    public void run(){ 
    while(true){
    repaint();
    try{
    Thread.sleep(4000); //delay
    }catch(InterruptedException e){}
    public void paint(Graphics){
    for(i=0; i<vector.size(); i++){
    Ball b = (Ball)vector.elementAt(i);
    reposition(b);
    g.drawArc(b.getX(),b.getY(),0,360);
    public void reposition(Ball b){
    // reposition ball using balls get/set methods.
    public void MouseClicked(MouseEvent e){
    // add a new ball to vector.
    public class Ball{
    int x,y;
    public int getX(){ return x; }
    public int getY(){ return y; }
    public int setX(int x){ this.x = x; }
    public int setY(int y){ this.y = y; }
    Do check the syntax and compilation errors. The code above should give you some idea for approach.

Maybe you are looking for

  • Trying to access SharePoint Site, Hosted in Azure, from public Internet

    I am looking for basic guidance on how to browse a SharePoint 2013 Environment, Hosted in Azure, from a PC not located on the same network. In other words from an internet connected PC. I believe this was working until some Azure or Windows update to

  • Popup with open and save file option

    Hi, I have created a button on my page name as "Export File" and created a process and called on "EXPORT FILE" button. I am using utl file in this procedure and i want to download this file and file will be .ics file using for calendar. My page proce

  • Windows Vista Ultimate Quick Install for Tungsten E2

    Well, I have a Tungsten E2, which I use commenly, but not often. I just got a my dad's old computer for Christmas (which is a huge upgrade from mine, which was made in the 1990's I think), and he got me Windows Vista Ultimate for it. I can do everyth

  • Lightroom and new Raw Converters

    In Photoshop we will get about each 3 months new Raw-/DNG-converters. This was in CS, CS2 and I think it will be also in CS3. Does anyone know, how to integrate new raw-converters in Lightroom? Will we get parallel with raw Converter 4.0 / 4.1 / 4.2

  • How to make the text resize to fit the window ?

    Hi, I'm making a website using Adobe Edge and I want the text to resize when the window is resized too. I tried some jQuery plugins but had no success. Any help would be greatly appreciated. Thanks in advance, Rafael Carignato