Blocking ThreadPoolExecutor

Hi,
I'd like to use ThreadPoolExecutor to manage a set number of threads that I have for executing tasks, and have clients of the executor block when all threads in the pool are busy.
So, in the code below, the first three calls to execute() will cause the Runnable to be executed, but the fourth will block until one of the first three calls completes.
ThreadPoolExecutor executor = new ThreadPoolExecutor( 0, 3, 0, TimeUnit.MILLISECONDS( 3, 3, 0L, TimeUnit.MILLISECONDS, new SynchronousQueue<Runnable>() );
while ( true ) {
    executor.execute( new Runnable() {
        public void run() {
             // do something
}However I can't seem to find any way of doing this - I always just get a RejectedExecutionException (or if I use a different RejectedExecutionHandler.DiscardPolicy the while loop just spins continuously, occasionally successfully executing a job). Any ideas?

Thanks for the replys.
I looked at using a custom RejectedExecutionHandler but then realised I could actually do what I needed less verbosely like this:
public class BlockingThreadPoolExecutor extends ThreadPoolExecutor {
    private final Semaphore semaphore;
    public BlockingThreadPoolExecutor( int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue ) {
        super( corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue );
        semaphore = new Semaphore( maximumPoolSize, true );
    @Override
    public void execute( Runnable command ) {
        try {
            semaphore.acquire();
        } catch ( InterruptedException e ) {}
        super.execute( command );
    @Override
    protected void afterExecute( Runnable command, Throwable t ) {
        semaphore.release();
}This works - almost. Unfortunately there is a race condition which means an execution will still be rejected with the following :
1. three tasks are entered & begin execution on threads A,B and C
2. thread D submites a fourth task and blocks in execute(), waiting to aquire a permit
3. thread A completes its task and calls afterExecute(), releasing a permit
4. D aquires a permit and calls super.execute()
5. D offers its task to the workQueue BEFORE the thread A either dies or calls take() on the workQueue
Note that implementing the solution using a RejectedExecutionHandler makes no difference - the problem is to do with there being a small amount of work done after the call to afterExecute() which applies in this case also.
Can't see away round it, which sucks, so I'm probably going to give up using ThreadPoolExecutor unless anyone has any good ideas?

Similar Messages

  • Implementing non-blocking read

    Hi all
    I have some doubts about implementing non-blocking io in my application.
    I am using Jsch library (an ssh implementation) to open an ssh connection with a host. The API only provides me with methods to open a connection and retreive the input & output streams. I want to make my read on inputstream non-blocking.In such a case is it possible to use nio for the purpose?
    If it's not possible then I am planning to use threading to make read() non-blocking. Here also i need some clarifications. I am planning to use a ThreadPoolExecutor to create a thread pool for reading data. SO whenever i have a read i'll assign this task to the pool which will use one of the free threads to execute the inputStresm.read().
    Now the question is if one of the threads in this pool blocks forever during a read since it didn't get any response from the other side, is there a way to stop that read and make that thread free again to execute more tasks? or will the thread block forever till the application is closed?
    In my case i cannot afford to have too many such blocked threads, since this application will not be restarted very often. Once it is started it can go on for may be days or months.
    Please suggest what would be best in my case taking into account performance as most important factor.
    Thanks in advance.
    Anu

    endasil wrote:
    First of all, let me state that I agree with the others in saying that I don't fully agree with your premises.
    That said, I believe that this does a non-blocking read based on the contract of InputStream.available() and .read(byte[], int, int):
    private int nonBlockingRead(InputStream in, byte[] buffer) throws IOException {
    return in.read(buffer, 0, Math.min(in.available(), buffer.length));
    If the InputStream is obtained from a JSSE socket then it is my understanding that available() always returns zero. This is allowed under the InputStream.available() contract as defined in the Javadoc - http://java.sun.com/javase/6/docs/api/java/io/InputStream.html#available() . If I am right then your code will never read anything from a JSSE socket InputStream and I would suspect that Jsch is using JSSE sockets.

  • How to use ThreadPoolExecutor / ArrayBlockingQueue with event objects

    I am having some trouble figuring out how to use the new java.util.concurrent library for a simple thread pool that has custom threads pulling off event objects from a queue.
    I started with this kind of code below, which I know is not right but am having trouble seeing the correct approach. Any help is appreciated. Thank You!
    -Paul
    public class testThreadPool {
    public static void main( String [] args ) {
    //work queue actaully only takes runnables,
    //but I need to add my event objects to this queue ??
    ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(20);
    ThreadPoolExecutor pool = new ThreadPoolExecutor(10,//pool size
    20,//max pool size
    1,
    TimeUnit.SECONDS,
    workQueue);//the work queue
    //this will ensure that the pool executor creates worker
    //threads of type MyThreadWorker
    pool.setThreadFactory(new MyThreadFactory());
    pool.prestartAllCoreThreads();
    //throw some events on the queue and let the pool workers
    //start to execute with the given event object
    workQueue.add(MyEvent);
    workQueue.add(AnotherEvent);
    class MyThreadFactory implements ThreadFactory {
    public Thread newThread(Runnable runnable) {
    return new (Thread)MyThreadWorker();
    class MyThreadWorker implements Runnable {
    private boolean m_run = true;
    public void run(){
    Object obj;
    while (m_run) {
    obj = null;
    //get the event object from the blocking queue
    try {
    obj = workQueue.take();
    } catch (InterruptedException e) {
    if ( obj == null ) continue;
    if ( obj == null ) continue;
    if (obj instanceof MyEvent) {
    //do this
    } else if (obj instanceof AnotherEvent) {
    //do this
    public void stopRunning(){
    m_run = false;
    this.interrupt();
    }

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • ThreadPoolExecutor constructor

    The thread pool executor takes a blocking queue as its argument (i.e. the work queue) which according to the API’s is used for +“… holding tasks before they are executed”+
    If a thread pool executor is permitted a maximum of 2 threads and has a fixed size work queue of 1 ….. if the main thread calls submit() twice before one of the pooled threads has a chance to execute will this result in the second call to submit() throwing an exception because of the size of the work queue being exceeded?
    I’m just slightly confused by the following description from the API:
    +•     If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread rather than queuing.+
    +•     If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread.+
    +•     If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected.+
    As +“fewer than corePoolSize threads are running”+, i.e. no threads are running, does the work queue actually get used (and so is its size relevant)?

    submit() on ThreadPoolExecutor will call execute this code:
        public Future<?> submit(Runnable task) {
            if (task == null) throw new NullPointerException();
            RunnableFuture<Object> ftask = newTaskFor(task, null);
            execute(ftask);
            return ftask;
        }That code will then call execute that is implemented like this in ThreadPoolExecutor:
        public void execute(Runnable command) {
            if (command == null)
                throw new NullPointerException();
            if (poolSize >= corePoolSize || !addIfUnderCorePoolSize(command)) {  // 1
                if (runState == RUNNING && workQueue.offer(command)) { //2
                    if (runState != RUNNING || poolSize == 0)
                        ensureQueuedTaskHandled(command);
                else if (!addIfUnderMaximumPoolSize(command)) // 3
                    reject(command); // is shutdown or saturated // 4
        }addIfUnderCorePoolSize at 1 will return false since it can't create a new thread (you had already created two threads)
    workQueue.offer at 2 will return false since we already had placed one item in the bound queue and can't add a new item right now
    addIfUnderMaximumPoolSize will also return false since we can't create a new thread
    reject at 4 will then be executed
    Kaj

  • Invalid Stored block length - Error Oracle 12c DB installation in OEL6

    Hi Guys,
    I got the below error message during the installation on Oracle 12c DB in OEL6.
    "Invalid Stored Block Length". And the installation got terminated.
    All the pre-req got passed and now i got sucked at this step.
    Can someone help me on this please.....
    Thanks,
    Sunil

    Here is the Error Log
    INFO: Extracting files to '/u01/app/oracle/product/12.1.0/db_1'.
    INFO: Performing fastcopy operations based on the information in the file 'oracle.server_EE_dirs.lst'.
    INFO: Performing fastcopy operations based on the information in the file 'oracle.server_EE_filemap.jar'.
    INFO: Performing fastcopy operations based on the information in the file 'racfiles.jar'.
    INFO: Performing fastcopy operations based on the information in the file 'oracle.server_EE_exp_1.xml'.
    INFO: Performing fastcopy operations based on the information in the file 'oracle.server_EE_1.xml'.
    INFO: Performing fastcopy operations based on the information in the file 'setperms1.sh'.
    INFO: Number of threads for fast copy :1
    INFO: invalid stored block lengths
    SEVERE: oracle.sysman.oii.oiif.oiifb.OiifbEndIterateException: invalid stored block lengths
      at oracle.sysman.oii.oiic.OiicInstallAPISession.doOperation(OiicInstallAPISession.java:490)
      at oracle.sysman.oii.oiic.OiicAPIInstaller.doOperation(OiicAPIInstaller.java:1009)
      at oracle.sysman.oii.oiic.OiicAPIInstaller.doOperation(OiicAPIInstaller.java:970)
      at oracle.install.driver.oui.OUISetupDriver.setup(OUISetupDriver.java:358)
      at oracle.install.driver.oui.SetupJob.call(SetupJob.java:315)
      at oracle.install.driver.oui.SetupJob.call(SetupJob.java:49)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
    INFO: Update the state machine to STATE_READY
    INFO: isSuccessfullInstallation: false
    INFO: isSuccessfullRemoteInstallation: true
    INFO: Adding ExitStatus FAILURE to the exit status set
    INFO: Shutting down OUISetupDriver.JobExecutorThread
    SEVERE: [FATAL] invalid stored block lengths
       CAUSE: No additional information available.
       ACTION: Refer to the logs or contact Oracle Support Services
       SUMMARY:
           - invalid stored block lengths.
    Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:7314
    INFO: Advice is ABORT
    SEVERE: Unconditional Exit
    INFO: Adding ExitStatus FAILURE to the exit status set
    INFO: Dispose the current Session instance
    INFO: Dispose the install area control object
    INFO: Update the state machine to STATE_CLEAN
    INFO: Finding the most appropriate exit status for the current application
    INFO: Exit Status is -1
    INFO: Shutdown Oracle Database 12c Release 1 Installer

  • How to migrate util.concurrent PooledExecutor|ThreadPoolExecutor.workerDone

    The PooledExecutor of the old util.concurrent framework had a method
       * Cleanup method called upon termination of worker thread.
      protected synchronized void workerDone(Worker w) {
    ...  }In the new ThreadPoolExecutor this method is private. In my child class of PooledExecutor / ThreadPoolExecutor I need to redefine it. How can I do this?
    My problem is: I am working with IBM WebSphere MQ (=MQSeries) Sessions. An MQ Session can only be deleted by the thread that has created it.
    I would be grateful for your Help!

    Define your own implementation of ThreadFactory that creates a new thread with a try/finally clause such that the code you want to execute on the threads termination is executed in the finally clause. If you still want to leverage the Executors thread factories, simply embed the provided Runnable inside another runnable that sets up the try/finally and calls the provided Runnable's run() method inside its try block.
    Should suit your needs nicely.

  • IllegalMonitorStateException Thrown From Synchronized Block

    Greetings,
    We recently had a case where a java.lang.IllegalMonitorStateException was thrown from section of code (in activemq) that I'm 99.9% sure was properly synchronized. Has anyone ever seen this exception thrown when the object whose wait method is being called is currently owened (via. a synchronized block)?
    The code that this exception occurred was in the backport-util-concurrent library. A get method (which is synchronized) call was made to a FutureTask instance which (eventually) calls Object.wait(). This call threw the exception. Below is the FutureTask code.
    public synchronized Object get() throws InterruptedException, ExecutionException
      waitFor();
      return getResult();
    private void waitFor() throws InterruptedException
      while (!isDone())
        wait();
    }And the stack trace on the exception was:
    ERROR - 21/2 08:56:41 - Failed to checkpoint a message store: java.lang.IllegalMonitorStateException - org.apache.activemq.store.journal.JournalPersistenceAdapter 395
    java.lang.IllegalMonitorStateException
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.waitFor(FutureTask.java:267)
    at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.get(FutureTask.java:117)
    at org.apache.activemq.store.journal.JournalPersistenceAdapter.doCheckpoint(JournalPersistenceAdapter.java:386)
    at org.apache.activemq.store.journal.JournalPersistenceAdapter$2.iterate(JournalPersistenceAdapter.java:129)
    at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:117)
    at org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunner.java:26)
    at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:44)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:619)We are running Java 1.6 on solaris (64-bit). If anybody has any feedback on what might have caused this problem it would be appreciated.
    Thanks,
    Corey

    There seem to be some difficult to reproduce bugs in JDK 6 relating to hotspot compilation (and maybe synchronization). A few threads worth checking out:
    http://forum.java.sun.com/thread.jspa?threadID=5251785&tstart=0
    http://forum.java.sun.com/thread.jspa?threadID=5262404&tstart=0
    My own bug report (this one is reproducible): http://www.blinkenbyte.org/jvm/hotspot_bug_reviewid_1085121.html
    Which reminds me, I need to get around to submitting an update to the report.. disabling HotSpot compilation on the problematic method made the problem go away in my case...
    If at all possible to turn this into a test case, please do so and submit a bug report to Sun. Somehow Sun needs to pay attention to this problem, but I haven't even got a bug id on my problem despite it being 100% reproducible.

  • Java.io.IOException: cannot verify signature block file META-INF/MYKEY

    Hello,
    i have a serios problem in my company.
    I developed javaws aplication running since years and now we have starting problems with actual java, it brings security warnings. This warning says this application will be blocked in further releases.
    The app is signed with an old java 6 jarsigner.  If I sign the jar files of the app with java 7 u45 or u40, I receive the following exception by webstart :
    java.io.IOException: cannot verify signature block file META-INF/MYKEY
        at com.sun.deploy.cache.CacheEntry$10.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
        at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
        at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
        at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
        at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
        at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    do somebody have an idea what I could try to do to solve this problem?
    I create the keystore  on the follwoing way: C:\Programme\Java\jdk1.7.0_45\bin>keytool -genkey -keyalg RSA -alias MYKEY -keystore fspKeys -storepass xxxxxxxx

    I have JRE 1.5.0_14 in the client machine.
    Once this exception comes, no matter how many times I tried to relaunch the application same exception (cannot verify signature block is shown. Once i restart the server, its working fine.
    Regarding jardiff, Yes. we use it.
    Also, this exception is not shown on every machine which are trying to download same update. Only on few..
    Any idea regarding this, please share it.
    Chakri
    Edited by: chakriv on Mar 22, 2010 9:02 PM

  • Blocked trying to get lock: java.lang.Class@[fat lock]

    Joe,
      Can you please help me understand what is going on with this thread dump? There is no dead lock; but I have stuck thread. Is it waiting an Oracle prepared statement?
    ===== FULL THREAD DUMP ===============
                Wed Sep  4 16:12:27 2013
                Oracle JRockit(R) R28.0.1-21-133393-1.6.0_20-20100512-2126-linux-x86_64
                "Main Thread" id=1 idx=0x4 tid=26484 prio=5 alive, waiting, native_blocked
                    -- Waiting for notification on: weblogic/t3/srvr/T3Srvr@0x1398a8228[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/lang/Object.wait(Object.java:485)
                    at weblogic/t3/srvr/T3Srvr.waitForDeath(T3Srvr.java:902)
                    ^-- Lock released while waiting: weblogic/t3/srvr/T3Srvr@0x1398a8228[fat lock]
                    at weblogic/t3/srvr/T3Srvr.run(T3Srvr.java:465)
                    at weblogic/Server.main(Server.java:67)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "(OC Main Thread)" id=2 idx=0x8 tid=26487 prio=5 alive, native_waiting, daemon
                "(GC Worker Thread 1)" id=? idx=0xc tid=26488 prio=5 alive, daemon
                "(GC Worker Thread 2)" id=? idx=0x10 tid=26489 prio=5 alive, daemon
                "(GC Worker Thread 3)" id=? idx=0x14 tid=26490 prio=5 alive, daemon
                "(GC Worker Thread 4)" id=? idx=0x18 tid=26491 prio=5 alive, daemon
                "(Code Generation Thread 1)" id=3 idx=0x1c tid=26494 prio=5 alive, native_waiting, daemon
                "(Code Optimization Thread 1)" id=4 idx=0x20 tid=26495 prio=5 alive, native_waiting, daemon
                "(VM Periodic Task)" id=5 idx=0x24 tid=26496 prio=10 alive, native_blocked, daemon
                "(Attach Listener)" id=6 idx=0x28 tid=26497 prio=5 alive, native_blocked, daemon
                "Finalizer" id=7 idx=0x2c tid=26498 prio=8 alive, native_waiting, daemon
                    at jrockit/memory/Finalizer.waitForFinalizees(J[Ljava/lang/Object;)I(Native Method)
                    at jrockit/memory/Finalizer.access$700(Finalizer.java:12)
                    at jrockit/memory/Finalizer$4.run(Finalizer.java:189)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Reference Handler" id=8 idx=0x30 tid=26499 prio=10 alive, native_waiting, daemon
                    at java/lang/ref/Reference.waitForActivatedQueue(J)Ljava/lang/ref/Reference;(Native Method)
                    at java/lang/ref/Reference.access$100(Reference.java:11)
                    at java/lang/ref/Reference$ReferenceHandler.run(Reference.java:82)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "(Sensor Event Thread)" id=9 idx=0x34 tid=26500 prio=5 alive, native_blocked, daemon
                "VM JFR Buffer Thread" id=10 idx=0x38 tid=26501 prio=5 alive, in native, daemon
                "Timer-0" id=13 idx=0x3c tid=26502 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/TaskQueue@0x1399c29d0[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/lang/Object.wait(Object.java:485)
                    at java/util/TimerThread.mainLoop(Timer.java:483)
                    ^-- Lock released while waiting: java/util/TaskQueue@0x1399c29d0[fat lock]
                    at java/util/TimerThread.run(Timer.java:462)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Timer-1" id=14 idx=0x40 tid=26504 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/TaskQueue@0x1399c2a58[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/util/TimerThread.mainLoop(Timer.java:509)
                    ^-- Lock released while waiting: java/util/TaskQueue@0x1399c2a58[fat lock]
                    at java/util/TimerThread.run(Timer.java:462)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" id=15 idx=0x44 tid=26505 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: weblogic/work/ExecuteThread@0x1399c3848[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at jrockit/vm/Locks.wait(Locks.java:1964)[inlined]
                    at java/lang/Object.wait(Object.java:485)[inlined]
                    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:157)[optimized]
                    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x1399c3848[fat lock]
                    at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "JFR request timer" id=16 idx=0x48 tid=26506 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/TaskQueue@0x1399c2ae0[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/lang/Object.wait(Object.java:485)
                    at java/util/TimerThread.mainLoop(Timer.java:483)
                    ^-- Lock released while waiting: java/util/TaskQueue@0x1399c2ae0[fat lock]
                    at java/util/TimerThread.run(Timer.java:462)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.time.TimeEventGenerator" id=18 idx=0x4c tid=26507 prio=9 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: weblogic/time/common/internal/TimeTable@0x1399c5070[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at weblogic/time/common/internal/TimeTable.snooze(TimeTable.java:286)
                    ^-- Lock released while waiting: weblogic/time/common/internal/TimeTable@0x1399c5070[fat lock]
                    at weblogic/time/common/internal/TimeEventGenerator.run(TimeEventGenerator.java:117)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "JMAPI event thread" id=19 idx=0x50 tid=26508 prio=5 alive, in native, daemon
                "weblogic.timers.TimerThread" id=20 idx=0x54 tid=26509 prio=9 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: weblogic/timers/internal/TimerThread@0x1399c2c08[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at weblogic/timers/internal/TimerThread$Thread.run(TimerThread.java:262)
                    ^-- Lock released while waiting: weblogic/timers/internal/TimerThread@0x1399c2c08[fat lock]
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" id=21 idx=0x58 tid=26510 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: weblogic/work/ExecuteThread@0x1399c3930[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at jrockit/vm/Locks.wait(Locks.java:1964)[inlined]
                    at java/lang/Object.wait(Object.java:485)[inlined]
                    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:157)[optimized]
                    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x1399c3930[fat lock]
                    at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "NM Reaper" id=24 idx=0x5c tid=26512 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/TaskQueue@0x1399c5938[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/util/TimerThread.mainLoop(Timer.java:509)
                    ^-- Lock released while waiting: java/util/TaskQueue@0x1399c5938[fat lock]
                    at java/util/TimerThread.run(Timer.java:462)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'" id=25 idx=0x60 tid=26514 prio=5 alive, blocked, native_blocked, daemon
                    -- Blocked trying to get lock: java/lang/String@0x13898d7f0[fat lock]
                    at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
                    at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1402)[optimized]
                    at jrockit/vm/Locks.lockFat(Locks.java:1503)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1045)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:996)[optimized]
                    at jrockit/vm/Locks.monitorEnter(Locks.java:2170)[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(JJJJJ)V(Native Method)
                    -- end of trace
                "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" id=26 idx=0x64 tid=26515 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@0x13898d7f0[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(JJJJJ)V(Native Method)
                    -- end of trace
                "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" id=27 idx=0x68 tid=26516 prio=5 alive, blocked, native_blocked, daemon
                    -- Blocked trying to get lock: java/lang/String@0x13898d7f0[fat lock]
                    at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
                    at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1402)[optimized]
                    at jrockit/vm/Locks.lockFat(Locks.java:1503)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1045)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:996)[optimized]
                    at jrockit/vm/Locks.monitorEnter(Locks.java:2170)[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(JJJJJ)V(Native Method)
                    -- end of trace
                "ExecuteThread: '3' for queue: 'weblogic.socket.Muxer'" id=28 idx=0x6c tid=26517 prio=5 alive, blocked, native_blocked, daemon
                    -- Blocked trying to get lock: java/lang/String@0x13898d7f0[fat lock]
                    at jrockit/vm/Threads.waitForUnblockSignal()V(Native Method)
                    at jrockit/vm/Locks.fatLockBlockOrSpin(Locks.java:1402)[inlined]
                    at jrockit/vm/Locks.fatLockReacquire(Locks.java:1640)[optimized]
                    at jrockit/vm/Locks.lockFat(Locks.java:1508)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStageHard(Locks.java:1045)[optimized]
                    at jrockit/vm/Locks.monitorEnterSecondStage(Locks.java:996)[optimized]
                    at jrockit/vm/Locks.monitorEnter(Locks.java:2170)[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(JJJJJ)V(Native Method)
                    -- end of trace
                "VDE Transaction Processor Thread" id=31 idx=0x70 tid=26559 prio=2 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: com/octetstring/vde/backend/standard/TransactionProcessor@0x1399c3ab8[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/lang/Object.wait(Object.java:485)
                    at com/octetstring/vde/backend/standard/TransactionProcessor.waitChange(TransactionProcessor.java:367)
                    ^-- Lock released while waiting: com/octetstring/vde/backend/standard/TransactionProcessor@0x1399c3ab8[fat lock]
                    at com/octetstring/vde/backend/standard/TransactionProcessor.run(TransactionProcessor.java:212)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "UCP-worker-thread-16" id=485 idx=0x74 tid=1649 prio=5 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x106f68908
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)[inlined]
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "DoSManager" id=34 idx=0x78 tid=26561 prio=6 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at com/octetstring/vde/DoSManager.run(DoSManager.java:433)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Timer-2" id=35 idx=0x7c tid=26562 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/TaskQueue@0x1399c5df8[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/util/TimerThread.mainLoop(Timer.java:509)
                    ^-- Lock released while waiting: java/util/TaskQueue@0x1399c5df8[fat lock]
                    at java/util/TimerThread.run(Timer.java:462)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "OracleTimeoutPollingThread" id=36 idx=0x80 tid=26585 prio=10 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/jdbc/driver/OracleTimeoutPollingThread.run(OracleTimeoutPollingThread.java:155)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Thread-14" id=37 idx=0x84 tid=26586 prio=5 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x1399c6018
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)[inlined]
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
                    at weblogic/utils/concurrent/JDK15ConcurrentBlockingQueue.take(JDK15ConcurrentBlockingQueue.java:89)
                    at weblogic/store/internal/PersistentStoreImpl.getOutstandingWork(PersistentStoreImpl.java:650)
                    at weblogic/store/internal/PersistentStoreImpl.run(PersistentStoreImpl.java:707)
                    at weblogic/store/internal/PersistentStoreImpl$2.run(PersistentStoreImpl.java:464)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "JPS FileChangeNotifier<clean-only>" id=38 idx=0x88 tid=26587 prio=5 alive, parked, native_blocked, daemon
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.parkNanos(LockSupport.java:198)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)[optimized]
                    at java/util/concurrent/DelayQueue.take(DelayQueue.java:164)[optimized]
                    at java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)[inlined]
                    at java/util/concurrent/ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "LogFlusher" id=39 idx=0x8c tid=26588 prio=5 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/core/ojdl/BufferedLogWriter$Flusher.run(BufferedLogWriter.java:409)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "LogFlusher" id=40 idx=0x90 tid=26589 prio=5 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/core/ojdl/BufferedLogWriter$Flusher.run(BufferedLogWriter.java:409)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "LogFlusher" id=41 idx=0x94 tid=26590 prio=5 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/core/ojdl/BufferedLogWriter$Flusher.run(BufferedLogWriter.java:409)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "[STANDBY] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'" id=265 idx=0x98 tid=28296 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: weblogic/work/ExecuteThread@0x106f29288[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at jrockit/vm/Locks.wait(Locks.java:1964)[inlined]
                    at java/lang/Object.wait(Object.java:485)[inlined]
                    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:157)[optimized]
                    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x106f29288[fat lock]
                    at weblogic/work/ExecuteThread.run(ExecuteThread.java:178)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Thread-71" id=266 idx=0x9c tid=28297 prio=10 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/wsm/policyaccess/impl/cache/PolicyCacheImpl$BackTracingSynchronizationThread.run(PolicyCacheImpl.java:759)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Thread-70" id=264 idx=0xa0 tid=28295 prio=10 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x106f3df50
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)
                    at sun/misc/Unsafe.park(ZJ)V(Native Method)
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
                    at oracle/mds/internal/notifications/EventDispatcherThread.run(EventDispatcherThread.java:54)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "oracle.dfw.impl.incident - ADR Executor (created: Fri Aug 30 01:12:40 GMT 2013)" id=45 idx=0xa4 tid=26601 prio=5 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x1399c6698
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)[inlined]
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@37a58fc8" id=394 idx=0xa8 tid=28767 prio=10 alive, in native, daemon
                    at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
                    at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)[inlined]
                    at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
                    at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
                    at oracle/net/nt/MetricsEnabledInputStream.read(TcpNTAdapter.java:564)[optimized]
                    at oracle/net/ns/Packet.receive(Packet.java:295)[inlined]
                    at oracle/net/ns/DataPacket.receive(DataPacket.java:94)[optimized]
                    at oracle/net/ns/NetInputStream.getNextPacket(NetInputStream.java:176)[optimized]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:121)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:96)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:81)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)[inlined]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1087)[optimized]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1062)[inlined]
                    at oracle/jdbc/driver/T4C8Oall.receive(T4C8Oall.java:625)[optimized]
                    at oracle/jdbc/driver/T4CCallableStatement.doOall8(T4CCallableStatement.java:201)[inlined]
                    at oracle/jdbc/driver/T4CCallableStatement.executeForRows(T4CCallableStatement.java:1036)[optimized]
                    at oracle/jdbc/driver/OracleStatement.doExecuteWithTimeout(OracleStatement.java:1379)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3568)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.execute(OraclePreparedStatement.java:3739)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x125a827f8[recursive]
                    at oracle/jdbc/driver/OracleCallableStatement.execute(OracleCallableStatement.java:8150)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x125a827f8[thin lock]
                    at oracle/jdbc/driver/OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1535)[optimized]
                    at weblogic/jdbc/wrapper/PreparedStatement.execute(PreparedStatement.java:99)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.readEvent(SAQBusinessEventBus.java:1232)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleSingleQueueEvent(SAQBusinessEventBus.java:687)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleQueueEvents(SAQBusinessEventBus.java:660)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.access$000(SAQBusinessEventBus.java:71)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus$1.run(SAQBusinessEventBus.java:319)
                    at oracle/integration/platform/blocks/executor/WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
                    at weblogic/work/j2ee/J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
                    at weblogic/work/DaemonWorkThread.run(DaemonWorkThread.java:30)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "oracle.dfw.incident.IncidentCreatorThread" id=47 idx=0xac tid=26603 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/util/ArrayList@0x1399c6780[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at java/lang/Object.wait(Object.java:485)
                    at oracle/dfw/impl/incident/DiagnosticsDataExtractorImpl$IncidentCreatorThread.run(DiagnosticsDataExtractorImpl.java:1597)
                    ^-- Lock released while waiting: java/util/ArrayList@0x1399c6780[fat lock]
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "oracle.dfw.incident.FloodController" id=49 idx=0xb4 tid=26606 prio=5 alive, waiting, native_blocked, daemon
                    -- Waiting for notification on: java/lang/Object@0x1399c6868[fat lock]
                    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
                    at java/lang/Object.wait(J)V(Native Method)
                    at oracle/dfw/impl/incident/FloodController.run(FloodController.java:136)
                    ^-- Lock released while waiting: java/lang/Object@0x1399c6868[fat lock]
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "UCP-worker-thread-16" id=487 idx=0xb8 tid=1681 prio=5 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x106f89660
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)[inlined]
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "Thread-72" id=267 idx=0xbc tid=28298 prio=10 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/wsm/policyaccess/impl/cache/PolicyCacheImpl$PolicyCacheRefreshThread.run(PolicyCacheImpl.java:915)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@37a58d77" id=393 idx=0xc0 tid=28766 prio=10 alive, in native, daemon
                    at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
                    at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)[inlined]
                    at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
                    at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
                    at oracle/net/nt/MetricsEnabledInputStream.read(TcpNTAdapter.java:564)[optimized]
                    at oracle/net/ns/Packet.receive(Packet.java:295)[inlined]
                    at oracle/net/ns/DataPacket.receive(DataPacket.java:94)[optimized]
                    at oracle/net/ns/NetInputStream.getNextPacket(NetInputStream.java:176)[optimized]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:121)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:96)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:81)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)[inlined]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1087)[optimized]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1062)[inlined]
                    at oracle/jdbc/driver/T4C8Oall.receive(T4C8Oall.java:625)[optimized]
                    at oracle/jdbc/driver/T4CCallableStatement.doOall8(T4CCallableStatement.java:201)[inlined]
                    at oracle/jdbc/driver/T4CCallableStatement.executeForRows(T4CCallableStatement.java:1036)[optimized]
                    at oracle/jdbc/driver/OracleStatement.doExecuteWithTimeout(OracleStatement.java:1379)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3568)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.execute(OraclePreparedStatement.java:3739)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x12e33e6b8[recursive]
                    at oracle/jdbc/driver/OracleCallableStatement.execute(OracleCallableStatement.java:8150)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x12e33e6b8[thin lock]
                    at oracle/jdbc/driver/OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1535)[optimized]
                    at weblogic/jdbc/wrapper/PreparedStatement.execute(PreparedStatement.java:99)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.readOAOODelivery(SAQBusinessEventBus.java:1302)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleSingleOAOODelivery(SAQBusinessEventBus.java:750)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleQueueEvents(SAQBusinessEventBus.java:669)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.access$000(SAQBusinessEventBus.java:71)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus$1.run(SAQBusinessEventBus.java:319)
                    at oracle/integration/platform/blocks/executor/WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
                    at weblogic/work/j2ee/J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
                    at weblogic/work/DaemonWorkThread.run(DaemonWorkThread.java:30)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@37a4ecb8" id=392 idx=0xc4 tid=28765 prio=10 alive, in native, daemon
                    at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
                    at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:32)[inlined]
                    at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)[inlined]
                    at java/net/SocketInputStream.read(SocketInputStream.java:129)[optimized]
                    at oracle/net/nt/MetricsEnabledInputStream.read(TcpNTAdapter.java:564)[optimized]
                    at oracle/net/ns/Packet.receive(Packet.java:295)[inlined]
                    at oracle/net/ns/DataPacket.receive(DataPacket.java:94)[optimized]
                    at oracle/net/ns/NetInputStream.getNextPacket(NetInputStream.java:176)[optimized]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:121)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:96)[inlined]
                    at oracle/net/ns/NetInputStream.read(NetInputStream.java:81)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)[optimized]
                    at oracle/jdbc/driver/T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)[inlined]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1087)[optimized]
                    at oracle/jdbc/driver/T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1062)[inlined]
                    at oracle/jdbc/driver/T4C8Oall.receive(T4C8Oall.java:625)[optimized]
                    at oracle/jdbc/driver/T4CCallableStatement.doOall8(T4CCallableStatement.java:201)[inlined]
                    at oracle/jdbc/driver/T4CCallableStatement.executeForRows(T4CCallableStatement.java:1036)[optimized]
                    at oracle/jdbc/driver/OracleStatement.doExecuteWithTimeout(OracleStatement.java:1379)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3568)[optimized]
                    at oracle/jdbc/driver/OraclePreparedStatement.execute(OraclePreparedStatement.java:3739)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x125a80ae8[recursive]
                    at oracle/jdbc/driver/OracleCallableStatement.execute(OracleCallableStatement.java:8150)[optimized]
                    ^-- Holding lock: oracle/jdbc/driver/T4CConnection@0x125a80ae8[thin lock]
                    at oracle/jdbc/driver/OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1535)[optimized]
                    at weblogic/jdbc/wrapper/PreparedStatement.execute(PreparedStatement.java:99)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.readEvent(SAQBusinessEventBus.java:1232)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleSingleQueueEvent(SAQBusinessEventBus.java:687)[optimized]
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.handleQueueEvents(SAQBusinessEventBus.java:660)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus.access$000(SAQBusinessEventBus.java:71)
                    at oracle/integration/platform/blocks/event/saq/SAQBusinessEventBus$1.run(SAQBusinessEventBus.java:319)
                    at oracle/integration/platform/blocks/executor/WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
                    at weblogic/work/j2ee/J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
                    at weblogic/work/DaemonWorkThread.run(DaemonWorkThread.java:30)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "UCP-worker-thread-16" id=488 idx=0xc8 tid=1682 prio=5 alive, parked, native_blocked, daemon
                    -- Parking to wait for: java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject@0x102a76870
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)[inlined]
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:158)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)[optimized]
                    at java/util/concurrent/ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                    at java/lang/Thread.run(Thread.java:619)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@37afc2f4" id=396 idx=0xcc tid=28769 prio=10 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/tip/mediator/common/listener/DBLocker.enqueueLockedMessages(DBLocker.java:213)[optimized]
                    at oracle/tip/mediator/common/listener/DBLocker.run(DBLocker.java:84)
                    at oracle/integration/platform/blocks/executor/WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
                    at weblogic/work/j2ee/J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
                    at weblogic/work/DaemonWorkThread.run(DaemonWorkThread.java:30)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "LogFlusher" id=56 idx=0xd0 tid=26614 prio=5 alive, sleeping, native_waiting, daemon
                    at java/lang/Thread.sleep(J)V(Native Method)
                    at oracle/core/ojdl/BufferedLogWriter$Flusher.run(BufferedLogWriter.java:409)
                    at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
                    -- end of trace
                "weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@37afb4b1" id=395 idx=0xd4 tid=28768 prio=10 alive, parked, native_blocked, daemon
                    at jrockit/vm/Locks.park0(J)V(Native Method)
                    at jrockit/vm/Locks.park(Locks.java:2221)
                    at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:592)[inlined]
                    at java/util/concurrent/locks/LockSupport.parkNanos(LockSupport.java:198)[inlined]
                    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)[optimized]
                    at java/util/concurrent/LinkedBlockingQueue.poll(LinkedBlockingQueue.java:424)[optimized]
                    at oracle/tip/mediator/common/listener/AbstractWorker.run(AbstractWorker.java:64)
                    at oracle/integration/platform/blocks/executor/WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
                    at weblogic/work/j2ee/J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
         

    You need to open a support case, and it's for the application, not WebLogic. You have threads deadlocked
    in application code.
    Circular (deadlocked) lock chains
                =================================
                Chain 5:
                "[STUCK] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'" id=577 idx=0x560 tid=5192 waiting for java/util/concurrent/locks/ReentrantLock$NonfairSync@0x3895ee610 held by:
                "[STUCK] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'" id=433 idx=0x278 tid=30215 waiting for java/util/concurrent/locks/ReentrantLock$NonfairSync@0x38a904880 held by:
                "[STUCK] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'" id=577 idx=0x560 tid=5192

  • Non-blocking SSLEngine example

    Since the example of using SSLEngine with non-blocking IO that comes with Java is quite limited, I have decided to release my own for anyone who wants to see how I solved the various problems that you must face. The example is designed to be a generic non-blocking server that supports SSL.
    This is only meant to be an example, as I wrote this mostly in order to learn how to use the SSLEngine, and therefore has certain limitations, and is not thouroughly tested.
    You can download the file at: http://members.aol.com/ben77/nio_server2.tar.gz
    Here is also the code for SecureIO, which is roughly analagous to the Java example's ChannelIOSecure:
    package nio_server2.internalio;
    import java.io.IOException;
    import java.nio.ByteBuffer;
    import java.nio.channels.*;
    import java.util.concurrent.*;
    import javax.net.ssl.*;
    import static javax.net.ssl.SSLEngineResult.HandshakeStatus.*;
    * Does IO based on a <code>SocketChannel</code> with all data encrypted using
    * SSL.
    * @author ben
    public class SecureIO extends InsecureIO {
          * SSLTasker is responsible for dealing with all long running tasks required
          * by the SSLEngine
          * @author ben
         private class SSLTasker implements Runnable {
               * @inheritDoc
              public void run() {
                   Runnable r;
                   while ((r = engine.getDelegatedTask()) != null) {
                        r.run();
                   if (inNet.position() > 0) {
                        regnow(); // we may already have read what is needed
                   try {
                        System.out.println(":" + engine.getHandshakeStatus());
                        switch (engine.getHandshakeStatus()) {
                             case NOT_HANDSHAKING:
                                  break;
                             case FINISHED:
                                  System.err.println("Detected FINISHED in tasker");
                                  Thread.dumpStack();
                                  break;
                             case NEED_TASK:
                                  System.err.println("Detected NEED_TASK in tasker");
                                  assert false;
                                  break;
                             case NEED_WRAP:
                                  rereg(SelectionKey.OP_WRITE);
                                  break;
                             case NEED_UNWRAP:
                                  rereg(SelectionKey.OP_READ);
                                  break;
                   } catch (IOException e) {
                        e.printStackTrace();
                        try {
                             shutdown();
                        } catch (IOException ex) {
                             ex.printStackTrace();
                   hsStatus = engine.getHandshakeStatus();
                   isTasking = false;
         private SSLEngine engine;
         private ByteBuffer inNet; // always cleared btwn calls
         private ByteBuffer outNet; // when hasRemaining, has data to write.
         private static final ByteBuffer BLANK = ByteBuffer.allocate(0);
         private boolean initialHandshakeDone = false;
         private volatile boolean isTasking = false;
         private boolean handshaking = true;
         private SSLEngineResult.HandshakeStatus hsStatus = NEED_UNWRAP;
         private boolean shutdownStarted;
         private static Executor executor = getDefaultExecutor();
         private SSLTasker tasker = new SSLTasker();
         private ByteBuffer temp;
          * @return the default <code>Executor</code>
         public static Executor getDefaultExecutor() {
              return new ThreadPoolExecutor(3, Integer.MAX_VALUE, 60L,
                        TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),
                        new DaemonThreadFactory());
         private static class DaemonThreadFactory implements ThreadFactory {
              private static ThreadFactory defaultFactory = Executors
                        .defaultThreadFactory();
               * Creates a thread using the default factory, but sets it to be daemon
               * before returning it
               * @param r
               *            the runnable to run
               * @return the new thread
              public Thread newThread(Runnable r) {
                   Thread t = defaultFactory.newThread(r);
                   t.setDaemon(true);
                   return t;
          * @return the executor currently being used for all long-running tasks
         public static Executor getExecutor() {
              return executor;
          * Changes the executor being used for all long-running tasks. Currently
          * running tasks will still use the old executor
          * @param executor
          *            the new Executor to use
         public static void setExecutor(Executor executor) {
              SecureIO.executor = executor;
          * Creates a new <code>SecureIO</code>
          * @param channel
          *            the channel to do IO on.
          * @param sslCtx
          *            the <code>SSLContext</code> to use
         public SecureIO(SocketChannel channel, SSLContext sslCtx) {
              super(channel);
              engine = sslCtx.createSSLEngine();
              engine.setUseClientMode(false);
              int size = engine.getSession().getPacketBufferSize();
              inNet = ByteBuffer.allocate(size);
              outNet = ByteBuffer.allocate(size);
              outNet.limit(0);
              temp = ByteBuffer.allocate(engine.getSession()
                        .getApplicationBufferSize());
         private void doTasks() throws IOException {
              rereg(0); // don't do anything until the task is done.
              isTasking = true;
              SecureIO.executor.execute(tasker);
          * Does all handshaking required by SSL.
          * @param dst
          *            the destination from an application data read
          * @return true if all needed SSL handshaking is currently complete.
          * @throws IOException
          *             if there are errors in handshaking.
         @Override
         public boolean doHandshake(ByteBuffer dst) throws IOException {
              if (!handshaking) {
                   return true;
              if (dst.remaining() < minBufferSize()) {
                   throw new IllegalArgumentException("Buffer has only "
                             + dst.remaining() + " left + minBufferSize is "
                             + minBufferSize());
              if (outNet.hasRemaining()) {
                   if (!flush()) {
                        return false;
                   switch (hsStatus) {
                        case FINISHED:
                             handshaking = false;
                             initialHandshakeDone = true;
                             rereg(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
                             return true;
                        case NEED_UNWRAP:
                             rereg(SelectionKey.OP_READ);
                             break;
                        case NEED_TASK:
                             doTasks();
                             return false;
                        case NOT_HANDSHAKING:
                             throw new RuntimeException(
                                       "NOT_HANDSHAKING encountered when handshaking");
              SSLEngineResult res;
              System.out.println(hsStatus + "1" + handshaking);
              switch (hsStatus) {
                   case NEED_UNWRAP:
                        int i;
                        do {
                             rereg(SelectionKey.OP_READ);
                             i = super.read(inNet);
                             if (i < 0) {
                                  engine.closeInbound();
                                  handshaking = false;
                                  shutdown();
                                  return true;
                             if (i == 0 && inNet.position() == 0) {
                                  return false;
                             inloop: do {
                                  inNet.flip();
                                  temp.clear();
                                  res = engine.unwrap(inNet, temp);
                                  inNet.compact();
                                  temp.flip();
                                  if (temp.hasRemaining()) {
                                       dst.put(temp);
                                  switch (res.getStatus()) {
                                       case OK:
                                            hsStatus = res.getHandshakeStatus();
                                            if (hsStatus == NEED_TASK) {
                                                 doTasks();
                                            // if (hsStatus == FINISHED) {
                                            // // if (!initialHandshakeDone) {
                                            // // throw new RuntimeException(hsStatus
                                            // // + " encountered when handshaking");
                                            // initialHandshakeDone = true;
                                            // handshaking=false;
                                            // key.interestOps(SelectionKey.OP_READ
                                            // | SelectionKey.OP_WRITE);
                                            // TODO check others?
                                            break;
                                       case BUFFER_UNDERFLOW:
                                            break inloop;
                                       case BUFFER_OVERFLOW:
                                       case CLOSED:
                                            throw new RuntimeException(res.getStatus()
                                                      + " encountered when handshaking");
                             } while (hsStatus == NEED_UNWRAP
                                       && dst.remaining() >= minBufferSize());
                        } while (hsStatus == NEED_UNWRAP
                                  && dst.remaining() >= minBufferSize());
                        if (inNet.position() > 0) {
                             System.err.println(inNet);
                        if (hsStatus != NEED_WRAP) {
                             break;
                        } // else fall through
                        rereg(SelectionKey.OP_WRITE);
                   case NEED_WRAP:
                        do {
                             outNet.clear();
                             res = engine.wrap(BLANK, outNet);
                             switch (res.getStatus()) {
                                  case OK:
                                       outNet.flip();
                                       hsStatus = res.getHandshakeStatus();
                                       if (hsStatus == NEED_TASK) {
                                            doTasks();
                                            return false;
                                       // TODO check others?
                                       break;
                                  case BUFFER_OVERFLOW:
                                       outNet.limit(0);
                                       int size = engine.getSession()
                                                 .getPacketBufferSize();
                                       if (outNet.capacity() < size) {
                                            outNet = ByteBuffer.allocate(size);
                                       } else { // shouldn't happen
                                            throw new RuntimeException(res.getStatus()
                                                      + " encountered when handshaking");
                                  case BUFFER_UNDERFLOW: // engine shouldn't care
                                  case CLOSED:
                                       throw new RuntimeException(res.getStatus()
                                                 + " encountered when handshaking");
                        } while (flush() && hsStatus == NEED_WRAP);
                        break;
                   case NEED_TASK:
                        doTasks();
                        return false;
                   case FINISHED:
                        break; // checked below
                   case NOT_HANDSHAKING:
                        System.err.println(hsStatus + " encountered when handshaking");
                        handshaking = false;
                        initialHandshakeDone = true;
                        rereg(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
              if (hsStatus == FINISHED) {
                   // if (!initialHandshakeDone) {
                   // throw new RuntimeException(hsStatus
                   // + " encountered when handshaking");
                   initialHandshakeDone = true;
                   handshaking = false;
                   rereg(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
              System.out.println(hsStatus + "2" + handshaking);
              return !handshaking;
          * Attempts to flush all buffered data to the channel.
          * @return true if all buffered data has been written.
          * @throws IOException
          *             if there are errors writing the data
         @Override
         public boolean flush() throws IOException {
              if (!outNet.hasRemaining()) {
                   return true;
              super.write(outNet);
              return !outNet.hasRemaining();
          * @return the largest amount of application data that could be read from
          *         the channel at once.
         @Override
         public int minBufferSize() {
              return engine.getSession().getApplicationBufferSize();
          * Begins or proceeds with sending an SSL shutdown message to the client.
          * @return true if all needed IO is complete
          * @throws IOException
          *             if there are errors sending the message.
         @Override
         public boolean shutdown() throws IOException {
              if (!shutdownStarted) {
                   shutdownStarted = true;
                   engine.closeOutbound();
              if (outNet.hasRemaining() && !flush()) {
                   return false;
              SSLEngineResult result;
              do {
                   outNet.clear();
                   result = engine.wrap(BLANK, outNet);
                   if (result.getStatus() != SSLEngineResult.Status.CLOSED) {
                        throw new IOException("Unexpected result in shutdown:"
                                  + result.getStatus());
                   outNet.flip();
                   if (outNet.hasRemaining() && !flush()) {
                        return false;
              } while (result.getHandshakeStatus() == NEED_WRAP);
              return !outNet.hasRemaining();
          * Reads all possible data into the <code>ByteBuffer</code>.
          * @param dst
          *            the buffer to read into.
          * @return the number of bytes read, or -1 if the channel or
          *         <code>SSLEngine</code> is closed
          * @throws IllegalStateException
          *             if the initial handshake isn't complete *
          * @throws IOException
          *             if there are errors.
          * @throws IllegalStateException
          *             if the initial handshake isn't complete
          * @throws IllegalArgumentException
          *             if the remaining space in dst is less than
          *             {@link SecureIO#minBufferSize()}
         @Override
         public int read(ByteBuffer dst) throws IOException {
              if (!initialHandshakeDone) {
                   throw new IllegalStateException("Initial handshake incomplete");
              if (dst.remaining() < minBufferSize()) {
                   throw new IllegalArgumentException("Buffer has only "
                             + dst.remaining() + " left + minBufferSize is "
                             + minBufferSize());
              int sPos = dst.position();
              int i;
              while ((i = super.read(inNet)) != 0
                        && dst.remaining() >= minBufferSize()) {
                   if (i < 0) {
                        engine.closeInbound();
                        shutdown();
                        return -1;
                   do {
                        inNet.flip();
                        temp.clear();
                        SSLEngineResult result = engine.unwrap(inNet, temp);
                        inNet.compact();
                        temp.flip();
                        if (temp.hasRemaining()) {
                             dst.put(temp);
                        switch (result.getStatus()) {
                             case BUFFER_UNDERFLOW:
                                  continue;
                             case BUFFER_OVERFLOW:
                                  throw new Error();
                             case CLOSED:
                                  return -1;
                             // throw new IOException("SSLEngine closed");
                             case OK:
                                  checkHandshake();
                                  break;
                   } while (inNet.position() > 0);
              return dst.position() - sPos;
          * Encrypts data and writes it to the channel.
          * @param src
          *            the data to write
          * @return the number of bytes written
          * @throws IOException
          *             if there are errors.
          * @throws IllegalStateException
          *             if the initial handshake isn't complete
         @Override
         public int write(ByteBuffer src) throws IOException {
              if (!initialHandshakeDone) {
                   throw new IllegalStateException("Initial handshake incomplete");
              if (!flush()) {
                   return 0;
              int written = 0;
              outer: while (src.hasRemaining()) {
                   outNet.clear(); // we flushed it
                   SSLEngineResult result = engine.wrap(src, outNet);
                   outNet.flip();
                   switch (result.getStatus()) {
                        case BUFFER_UNDERFLOW:
                             break outer; // not enough left to send (prob won't
                        // happen - padding)
                        case BUFFER_OVERFLOW:
                             if (!flush()) {
                                  break outer; // can't remake while still have
                                  // stuff to write
                             int size = engine.getSession().getPacketBufferSize();
                             if (outNet.capacity() < size) {
                                  outNet = ByteBuffer.allocate(size);
                             } else { // shouldn't happen
                                  throw new RuntimeException(hsStatus
                                            + " encountered when handshaking");
                             continue; // try again
                        case CLOSED:
                             throw new IOException("SSLEngine closed");
                        case OK:
                             checkHandshake();
                             break;
                   if (!flush()) {
                        break;
              return written;
         private boolean hasRemaining(ByteBuffer[] src) {
              for (ByteBuffer b : src) {
                   if (b.hasRemaining()) {
                        return true;
              return false;
          * Encrypts data and writes it to the channel.
          * @param src
          *            the data to write
          * @return the number of bytes written
          * @throws IOException
          *             if there are errors.
          * @throws IllegalStateException
          *             if the initial handshake isn't complete
         @Override
         public long write(ByteBuffer[] src) throws IOException {
              if (!initialHandshakeDone) {
                   throw new IllegalStateException("Initial handshake incomplete");
              if (!flush()) {
                   return 0;
              int written = 0;
              outer: while (hasRemaining(src)) {
                   outNet.clear(); // we flushed it
                   SSLEngineResult result = engine.wrap(src, outNet);
                   outNet.flip();
                   switch (result.getStatus()) {
                        case BUFFER_UNDERFLOW:
                             break outer; // not enough left to send (prob won't
                        // happen - padding)
                        case BUFFER_OVERFLOW:
                             if (!flush()) {
                                  break outer; // can't remake while still have
                                  // stuff to write
                             int size = engine.getSession().getPacketBufferSize();
                             if (outNet.capacity() < size) {
                                  outNet = ByteBuffer.allocate(size);
                             } else { // shouldn't happen
                                  throw new RuntimeException(hsStatus
                                            + " encountered when handshaking");
                             continue; // try again
                        case CLOSED:
                             throw new IOException("SSLEngine closed");
                        case OK:
                             checkHandshake();
                             break;
                   if (!flush()) {
                        break;
              return written;
         private void checkHandshake() throws IOException {
              // Thread.dumpStack();
              // System.out.println(engine.getHandshakeStatus());
              outer: while (true) {
                   switch (engine.getHandshakeStatus()) {
                        case NOT_HANDSHAKING:
                             initialHandshakeDone = true;
                             handshaking = false;
                             rereg(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
                             return;
                        case FINISHED:
                             // this shouldn't happen, I don't think. If it does, say
                             // where.
                             System.err.println("Detected FINISHED in checkHandshake");
                             Thread.dumpStack();
                             break outer;
                        case NEED_TASK:
                             if (isTasking) {
                                  while (isTasking) { // TODO: deal with by reg?
                                       Thread.yield();
                                       try {
                                            Thread.sleep(1);
                                       } catch (InterruptedException ex) {
                                            // TODO Auto-generated catch block
                                            ex.printStackTrace();
                                  break;
                             doTasks();
                             break;
                        case NEED_WRAP:
                             rereg(SelectionKey.OP_WRITE);
                             break outer;
                        case NEED_UNWRAP:
                             rereg(SelectionKey.OP_READ);
                             break outer;
              handshaking = true;
              hsStatus = engine.getHandshakeStatus();
          * @return true if the channel is open and no shutdown message has been
          *         recieved.
         @Override
         public boolean isOpen() {
              return super.isOpen() && !engine.isInboundDone();
    }

    That's the reason for checkHandshake(), it is called on every read and write and detects a new handshake and configures the setup properly. As far as the server requesting a new handshake, I did not put that in. It would be simple enough though, you would just need to call SSLEngine.beginHandshake() + then call checkHandshake().
    Also, my echo server example had a bug, I forgot to call bu.flip() before queueWrite(), so I fixed that, as well as adding an onConnect method that is called when a connection has been established. The new version should be up at the origional address shortly.

  • JVM threads BLOCKED

    Hi,
    One of our java application stopped responding. In the thread dump it is observed that JVM threads like "GC Daemon", "Low Memory Detector" etc are found to be in BLOCKED state. Also our application threads got blocked. I really wonder why JMV threads got blocked. Can anyone share your experience with such problems and how to overcome it. Environment details and Thread dump part can be found below
    OS: RHEL 5.4
    Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
    Thread 15910 "RMI Scheduler(0)": (state = BLOCKED)
         at sun.misc.Unsafe.park(Native Method)
         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
         at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
         at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)
         at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)
         at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
         at java.lang.Thread.run(Thread.java:662)
    Thread 15907 "GC Daemon": (state = BLOCKED)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000f041e790> (a sun.misc.GC$LatencyLock)
         at sun.misc.GC$Daemon.run(GC.java:100)
         - locked <0x00000000f041e790> (a sun.misc.GC$LatencyLock)
    Thread 15906 "RMI RenewClean-[10.36.107.139:49198]": (state = BLOCKED)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000f041e710> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         - locked <0x00000000f041e710> (a java.lang.ref.ReferenceQueue$Lock)
         at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:516)
         at java.lang.Thread.run(Thread.java:662)
    VM Thread 15809 "Low Memory Detector": (state = BLOCKED)
    VM Thread 15808 "C2 CompilerThread1": (state = BLOCKED)
    VM Thread 15807 "C2 CompilerThread0": (state = BLOCKED)
    Thread 15806 "Signal Dispatcher": (state = BLOCKED)
    Thread 15805 "Finalizer": (state = BLOCKED)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000f0075510> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         - locked <0x00000000f0075510> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    Thread 15804 "Reference Handler": (state = BLOCKED)
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000f0075540> (a java.lang.ref.Reference$Lock)
         at java.lang.Object.wait(Object.java:485)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
         - locked <0x00000000f0075540> (a java.lang.ref.Reference$Lock)
    Thread 15798 "main": (state = IN_NATIVE)

    What causes these threads get BLOCKED? Can application can influence these threads get BLOCKED? What I am supposed to do now?

  • How to add timeout for threads which are running  using ThreadPoolExecutor

    I am trying change my existing functionality with ThreadPoolExecutor. I was unable to achieve fully.
    Here is my issue.
    I was creating multiple threads for independent DB update operations. And was calling join with time value on the each thread, for any reason if the db update hangs so that thread should die.
    Now am trying use a nice ThreadPoolExecutor so that it can run and queue the threads nicely. But how do I create the timeout values for the threads which are in the ThreadPool. For any reason if the thread hangs then timeout will take care of killing the thread. When we use execute method submit the runnable task its not guaranteed that thread will run immediately. So when the executor will execute the submitted task is not know.
    Probably I might be wrong some where.
    Thanks.

    Future task = threadPoolExecutor.submit(...);
    //this will block until it finishes or times out.
    task.get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);

  • Using threadpoolExecutor

    Hi I want to use the threadpool provided in java. i.e Threadpoolexecutor.
    The requirement is:
    1. I need to have a corepool size(1)
    2. I need to have Maxpoolsize(40)
    3. I need to have a Queue without predefined capacity. I can use a LinkedBlockingQueue for this.
    But the problem is, if i construct a threadpool,
    ThreadPoolExecutor threadPool = new ThreadPoolExecutor(1,40,600, TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
    No new threads are created until the queue is full. I.e the no more than corePoolSize threads will ever be created. (And the value of the maximumPoolSize therefore doesn't have any effect.). But what i need to have is everytime a task is submitted, it should create a thread until it reaches MaxpoolSize() and then it should start Queing requests.
    Is there a way to do So.....

    JoachimSauer ,
    What you have made is both corepoolsize and maxpoolsizeequal, in which case its a fixedthreadpool.
    I suggest you to go through javadoc for correct explanation on how threadpoolexecutor works.
    Below attached is the code which exactly explains the problem.
    As you can see, the first task is created until it is completed and all other tasks wait on it.
    When you run the code, you will see that even though 50 tasks are pending, no new threads are created,
    since the first thread is blocked on a sleep, and the queue is not full. hence eventhough the maxpoolsize is 40,
    only one thread is created.
    package testThreadPool;
    public class sampleRunnable extends Thread{
         public void run()
              try {
                   System.out.println("Inside : " + this.getName());
                   Thread.sleep(Integer.MAX_VALUE);
                   System.out.println("Finished : " + this.getName());
              } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    package testThreadPool;
    import java.util.Vector;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.ThreadPoolExecutor;
    * @author hpke
    public class testSampleRunnable {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              ThreadPoolExecutor threadPool = new ThreadPoolExecutor(1,40,600, TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
              for ( int i=0;i <50; i++){
                   try {
                        Thread.sleep(1000);
                   } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   threadPool.execute(new sampleRunnable());
                   Vector<String> threadPoolInfo = new Vector();
                 threadPoolInfo.add("++ Thread Pool Info++");
                 threadPoolInfo.add("getPoolSize() : " + threadPool.getPoolSize());
                 threadPoolInfo.add("getActiveCount() : " + threadPool.getActiveCount());
                 threadPoolInfo.add("getCompletedTaskCount() : " + threadPool.getCompletedTaskCount());
                 threadPoolInfo.add("getCorePoolSize() : " + threadPool.getCorePoolSize());
                 threadPoolInfo.add("getMaximumPoolSize() : " + threadPool.getMaximumPoolSize());
                 threadPoolInfo.add("getLargestPoolSize() : " + threadPool.getLargestPoolSize());
                 threadPoolInfo.add("getTaskCount() : " + threadPool.getTaskCount());
                 threadPoolInfo.add("getKeepAliveTime() : " + threadPool.getKeepAliveTime(TimeUnit.SECONDS));
                String aa = new String();
                for ( int j=0;j< threadPoolInfo.size() ; j++)
                     aa += threadPoolInfo.elementAt(j) + "\n";
                System.out.println(aa);
    }

  • Data blocks in forms 6i, can not see the data

    i have built an application in forms with some data blocks. the blocks a connect to some tables in the db. i have built them connectd as "system". but when i run the applicatio as user x i can do select, insert, update, delete, but i can not se the records in the datablocks (they are empty), but i can do all transactios. why?

    First of all, developing from the System schema is not a good idea.
    Who owns the tables your form is connecting to? The table owner should create a public synonym for each table name, and also needs to grant user x access to the table.

  • To find total in blocked alv

    hi experts,
    i have created blocked ALV program.
    in the o/p , it displays list of recors for open items,then list of records for cleared items.
    now i want it  to display sum of both open and cleared items of particular column.
    in grid display it is displaying total for open and cleared items.
    but in blocked alv it is not displaying total for open and closed items separately.
    and also i need grand total of both.
    if any body knows please tell me..

    Hi Sridevi
    Refer this code as an example.
    This code calculates the occupied column from sflight table.
    TYPE-POOLS: slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         is_layout TYPE slis_layout_alv,
         it_events TYPE  slis_t_event ,
        it_sort TYPE  slis_t_sortinfo_alv .
    DATA: wa_fcat LIKE LINE OF it_fieldcat,
          wa_sort LIKE LINE OF it_sort.
    DATA: i_flight TYPE sflight_tab1.
    SELECT * FROM sflight
    INTO TABLE i_flight
    UP TO 10 ROWS.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_structure_name       = 'SFLIGHT'
      CHANGING
        ct_fieldcat            = it_fieldcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2.
    wa_fcat-do_sum = 'X'.
    MODIFY it_fieldcat FROM wa_fcat
         TRANSPORTING do_sum WHERE fieldname = 'SEATSOCC'.
    wa_sort-up = 'X'.
    wa_sort-fieldname = 'CARRID'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO it_sort.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLIGHT'
        it_events                        = it_events
        it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLGIHT'
        it_events                        = it_events
       it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks and Regards

Maybe you are looking for

  • Recent Windows 7 Update has killed windows

    Help, I run Windows 7 in Bootcamp, recent windows 7 update has killed windows, this is what happens. Choose to boot to windows - OK Hit logon screen - OK Logon - OK Windows loads, the desktop shows for about 5 seconds and then the screen goes blank.

  • HR Logical Database PERAS

    Hi, HR Payroll we have developed Income Tax report created PDF and send email to Indiviual Employee. Now I am facing one problem while accessing following Code Start of Selection Get peras End of Selection SUBMIT  rsconn01  WITH mode = c_int AND RETU

  • Reg : MB90 long item text

    Hi Floks, <i> In MB90  transaction print out form , i need to print long text in smartform .which table maintaining this text object . i requested to if any one can u send me related text object , text id to get details of long text in READ_TEXT func

  • How do I gift a book from ibooks?

    How do I gift a book from ibooks?

  • Session problem in LazyFetch

    Hi all, I have two entities: User and InfoUser in my website. User has much "InfoUser". @OneToMany(cascade = CascadeType.ALL, mappedBy = "user") private List<InfoUser> infos = new LinkedList(); // Code.. public List<InfoUser> getInfos(){       return