Workin with threads

Hello all!
I am writing a project that works with nlp(natural language parser),I am using the stanford parser.
I create a thread pool that takes sentances and run the parser with them.
when I create one thread its all works fine but when I create more I get errors.
the "test" procedure is findings words that have some connections.
If I do an synchronized its supposed to work like one thread but still I get errors.
My problem is that I have errors on this code:
public synchronized String test(String s,LexicalizedParser lp ){
    if (s.isEmpty()) return "";
    if (s.length()>80) return "";
    System.out.println(s);
    String[] sent = s.split(" ");
Tree parse = (Tree) lp.apply(Arrays.asList(sent));
TreebankLanguagePack tlp = new PennTreebankLanguagePack();
GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
GrammaticalStructure gs = gsf.newGrammaticalStructure(parse);
Collection tdl = gs.typedDependenciesCollapsed();
List list = new ArrayList(tdl);
//for (int i=0;i<list.size();i++)
//System.out.println(list.get(1).toString());
//remove scops and numbers like sbj(screen-4,good-6)->screen good
Pattern p = Pattern.compile(".*\\((.*?)\\-\\d+,(.*?)\\-\\d+\\).*");
       if (list.size()>2){
    // Split input with the pattern
        Matcher m = p.matcher(list.get(1).toString());
        //check if the result have more than  1 groups
       if (m.find()&& m.groupCount()>1){
           if (m.groupCount()>1)
               System.out.println(list);
return  m.group(1)+m.group(2);
        return "";
}the errors are:
at blogsOpinions.ThreadPoolTest$1.run(ThreadPoolTest.java:50)
at blogsOpinions.ThreadPool$PooledThread.run(ThreadPoolTest.java:196)
Recovering using fall through strategy: will construct an (X ...) tree.
Exception in thread "PooledThread-6" java.lang.ClassCastException: java.lang.String cannot be cast to edu.stanford.nlp.ling.HasWord
at edu.stanford.nlp.parser.lexparser.LexicalizedParser.apply(LexicalizedParser.java:289)
java.lang.NullPointerException
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:25)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:33)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:33)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:33)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:33)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTreeHelper(Debinarizer.java:33)
at edu.stanford.nlp.parser.lexparser.Debinarizer.transformTree(Debinarizer.java:46)
thanks!

The full exptions are:
Task 205: start
Task 206: start
Task 207: start
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at edu.stanford.nlp.parser.lexparser.ExhaustivePCFGParser.initializeChart(ExhaustivePCFGParser.java:1236)
        at edu.stanford.nlp.parser.lexparser.ExhaustivePCFGParser.parse(ExhaustivePCFGParser.java:388)
        at edu.stanford.nlp.parser.lexparser.LexicalizedParser.parse(LexicalizedParser.java:372)
Task 208: start
Task 210: start
Task 211: startthe code that have this is
    // Positional Access Operations
     * Returns the element at the specified position in this list.
     * @param  index index of the element to return
     * @return the element at the specified position in this list
     * @throws IndexOutOfBoundsException {@inheritDoc}
    public E get(int index) {
     RangeCheck(index);
     return (E) elementData[index];
    }and
     * Checks if the given index is in range.  If not, throws an appropriate
     * runtime exception.  This method does *not* check if the index is
     * negative: It is always used immediately prior to an array access,
     * which throws an ArrayIndexOutOfBoundsException if index is negative.
    private void RangeCheck(int index) {
     if (index >= size)
         throw new IndexOutOfBoundsException(
          "Index: "+index+", Size: "+size);
    }in this
Tree parse = (Tree) lp.apply(s);
Task 217: start
Task 218: start
        at edu.stanford.nlp.parser.lexparser.LexicalizedParser.apply(LexicalizedParser.java:276)
        at blogsOpinions.ParserText.test(ParserText.java:174)
        at blogsOpinions.ParserText.insertDb(ParserText.java:67)
        at blogsOpinions.ParserText.<init>(ParserText.java:47)
        at blogsOpinions.ThreadPoolTest$1.run(ThreadPoolTest.java:50)
Task 220: start
Task 221: startthe exceptions are full and not cut
thanks

Similar Messages

  • Problem with Thread and InputStream

    Hi,
    I am having a problem with threads and InputStreams. I have a class which
    extends Thread. I have created and started four instances of this class. But
    only one instance finishes its' work. When I check the state of other three
    threads their state remains Runnable.
    What I want to do is to open four InputStreams which are running in four
    threads, which reads from the same url.
    This is what I have written in my thread class's run method,
    public void run()
         URL url = new URL("http://localhost/test/myFile.exe");
    URLConnection conn = url.openConnection();
    InputStream istream = conn.getInputStream();
    System.out.println("input stream taken");
    If I close the input stream at the end of the run method, then other threads
    also works fine. But I do not want to close it becuase I have to read data
    from it later.
    The file(myFile.exe) I am trying to read is about 35 MB in size.
    When I try to read a file which is about 10 KB all the threads work well.
    Plz teach me how to solve this problem.
    I am using JDK 1.5 and Win XP home edition.
    Thanks in advance,
    Chamal.

    I dunno if we should be doing such things as this code does, but it works fine for me. All threads get completed.
    public class ThreadURL implements Runnable
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        public void run()
            try
                URL url = new URL("http://localhost:7777/java/install/");
                URLConnection conn = url.openConnection();
                InputStream istream = conn.getInputStream();
                System.out.println("input stream taken by "+Thread.currentThread().getName());
                istream.close();
                System.out.println("input stream closed by "+Thread.currentThread().getName());
            catch (MalformedURLException e)
                System.out.println(e);
                //TODO Handle exception.
            catch (IOException e)
                System.out.println(e);
                //TODO Handle exception.
        public static void main(String[] args)
            ThreadURL u = new ThreadURL();
            Thread t = new Thread(u,"1");
            Thread t1 = new Thread(u,"2");
            Thread t2 = new Thread(u,"3");
            Thread t3 = new Thread(u,"4");
            t.start();
            t1.start();
            t2.start();
            t3.start();
    }And this is the o/p i got
    input stream taken by 2
    input stream closed by 2
    input stream taken by 4
    input stream closed by 4
    input stream taken by 3
    input stream closed by 3
    input stream taken by 1
    input stream closed by 1
    can u paste your whole code ?
    ram.

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Question  about dynamic class loading with thread built in

    Hi ,
    I am trying to load a class with a thread built in from the network.
    I write my network classloader, convert the class to a byte array and transmit over the network using socket. This step seems fine but when I tried to load the class at the receiver, some exception happens,"
    the reported exception is that :
    Exception in thread "Thread-2" java.lang.NoClassDefFoundError: SampleProject/Application$1
    my class name is "SampleProject . Application", the $1 I think it may refers to the thread built in the "Application".
    Could any one give me some hint for how to dynamic load such class file with thread built in over the network?
    Thank you!
    Best Regards,
    Song Guo

    Exception in thread "Thread-2"
    java.lang.NoClassDefFoundError:
    SampleProject/Application$1That means that the receiving end can't find an anonymous inner class which you have in the Application class. (The anonymous clas is given the synthetic name 1). Check your bin/classes folder you will have a class there with the name Application$1.class
    Kaj

  • GD causing program to die with threading

    I've been working on a fractal generator for the past few days and decided to add multithreading support tonight—just one problem, this code works perfectly without threads, and not all with threads:
    Works:
    thread_options_t *toptions = (thread_options_t*)malloc(sizeof(thread_options_t));
    toptions->ioptions = ioptions;
    toptions->foptions = foptions;
    init_gd(&toptions->ioptions);
    fractal_main_loop(toptions->foptions, toptions->ioptions);
    save_set(toptions->ioptions);
    Doesn't work:
    thread_options_t *toptions = (thread_options_t*)malloc(sizeof(thread_options_t));
    toptions->ioptions = ioptions;
    toptions->foptions = foptions;
    pthread_t threadid;
    pthread_create(&threadid, NULL, spawn_fractal_generator, (thread_options_t*)toptions);
    Where spawn_fractal_generator is this function:
    void *spawn_fractal_generator(void* arg)
    thread_options_t *toptions = (thread_options_t*)arg;
    init_gd(&toptions->ioptions);
    fractal_main_loop(toptions->foptions, toptions->ioptions);
    save_set(toptions->ioptions);
    pthread_exit(0);
    I've found that it's the init_gd() call which is failing, init_gd() is this:
    void init_gd(image_options_t *ioptions)
    ioptions->gd.im = gdImageCreateTrueColor(ioptions->image.width, ioptions->image.height);
    Putting printfs before and after the call to gdImageCreateTrueColor() shows that the program just dies somewhere in that call: but with no error message and with a return code of 0.
    Last edited by Barrucadu (2010-02-10 21:10:36)

    I noticed something similar after some update or other on one machine using threads in python. Could it be a glibc problem?

  • Design issue with threads ...

    Hello,
    I need your thoughts in how to proper use java threads in solving this issue:
    * I have an application that query a database for a list of users, and for each row retrieved from the database as a result the application should process that user and send him an email.
    Now the procdural approach for looping each user and send him an email at a time is not convinient as the number of users is big (20,000 users or more) so I thought of why not to use threads to send say every 300 user at a time (i.e, creating 300 threads), but the problem is that I cannot really figure how to manage those threads, to make sure that there are 300 threads are running all the time, and what if a thread was taking more time that the others ... etc.
    So, is this approach is the right one, and can you guide more more for how to control the threads this way, if not what do you suggest?
    Your guidance is highly appreciated,
    tamer

    I'm not sure that threads will help your cause. But they could. Let me explain:
    Threads have several purposes. Two instantly spring to mind:
    1. to make things faster.
    2. to (make it seem like you) do two (or more things) at once.
    First #2. This is often a usability issue. For example, a web server has to server multiple clients at the "same time". This is often done with threads - it gives the illusion that many concurrent users are supported. In reality the CPU/JVM is swapping beween the different requests. More CPUs allow for "realer" concurrency. Speed is only a by-product here.
    Now #1: Make things faster. Threading works well for speed when the tasks being done differ.
    For example, consider human multithreading: ask me to whistle for 5 seconds, and 5 seconds later I'll be done. Then ask me to scratch my head with both hands for 5 seconds, and 5 seconds later I'll be done. Total: 10 seconds. Ask me to do both at the same time. Result: 5 seconds later I'll have scratched my head and whistled for 5 seconds. 50% time saving.
    However, ask me to touch type for 5 seconds, and scratch my head for 5 seconds, it'll take 10 seconds or more. If you ask me to do one, then the other, I can spend 5 seconds at one then the other - total 10 seconds. Ask me to do both concurrently, and I'll take more than 10 seconds, as I'll be moving my hands back and forth from the keyboard to my head, and vice-versa.
    I have a feeling that running multiple threads in your case would be like asking you to scratch your head and scratch your head all at the same time. But this may not strictly hold true for several reasons:
    1. your DB should scale, i.e. handle two simultaneous requests faster than two concurrent requests. However, this will probably not be true of 300 simultaneous requests being faster than 300 concurrent (or 50 * 6-concurrent requests).
    2. if you are in a multi-CPU environment then some concurrentcy improvements would be expected (more hands for head scratching).
    3. your application does two things: reads a DB and sends a mail. While sending one mail, you should be albe to concurrently read the next record. i.e. concurrency is supported here, as you don't have resource contention here.
    So, you will probably get some benefit from threads. Adding too many will only slow you down, as there'll be too much time spend task switching, as you'll suffer resource contenion on the DB/mail server.
    I suggest that you run your program with several configurations, i.e. number of threads, and see what one gives the best results. For fast results, I'd suggests trying the following number of threads:
    1, 2, 4, 8, 16, 32, 64, 128, 256, ...
    when things start to slow down, you know where to search for your optimum thread number. You could also do with profiling your application if speed is a very pressing issue.
    Finally, one clarification: this is not OO. You could do multi-threading in a procedural environment.
    Good luck.
    if you are running on a multi-CPU environment, then the DB

  • Working with threads

    hello all.
    I find some program that will help me in my work.
    but know i don't know how to change it that it will fit my project. i just want to work with thread pool. i find some code that can do this.
    mu problem is that i don't know how to change the task and the run functions in that program because they are interface. and when i do change them I get all the code errors.
    can you give me an example how can i change this code to do some, like that the task will print something or do something else.
    the code is:
    thanks alot!
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package work2;
    import java.util.ArrayList;
    import java.util.List;
    * @author vitaly87
    public class ThreadPool {
    /** Simple thread pool. A task is executed by obtaining a thread from
    * the pool
      /** The thread pool contains instances of {@link ThreadPool.Task}.
      public interface Task {
        /** Performs the task.
         * @throws Throwable The task failed, and the worker thread won't be used again.
        void run() throws Throwable{}
        /** A task, which may be interrupted, if the pool is shutting down.
        public interface InterruptableTask extends Task {
            /** Interrupts the task.
             * @throws Throwable Shutting down the task failed.
            void shutdown() throws Throwable;
        private class Poolable {
            private boolean shuttingDown;
            private Task task;
            private Thread thread;
            Poolable(ThreadGroup pGroup, int pNum) {
                thread = new Thread(pGroup, pGroup.getName() + "-" + pNum){
                    public void run() {
                        while (!isShuttingDown()) {
                            final Task t = getTask();
                            if (t == null) {
                                try {
                                    synchronized (this) {
                                        if (!isShuttingDown()  &&  getTask() == null) {
                                            wait();
                                } catch (InterruptedException e) {
                                    // Do nothing
                            } else {
                                try {
                                    t.run();
                                    resetTask();
                                    repool(Poolable.this);
                                } catch (Throwable e) {
                                    discard(Poolable.this);
                                    resetTask();
                thread.start();
            synchronized void shutdown() {
                shuttingDown = true;
                final Task t = getTask();
                if (t != null  &&  t instanceof InterruptableTask) {
                    try {
                        ((InterruptableTask) t).shutdown();
                    } catch (Throwable th) {
                        // Ignore me
                task = null;
                synchronized (thread) {
                    thread.notify();
            private synchronized boolean isShuttingDown() { return shuttingDown; }
            String getName() { return thread.getName(); }
            private synchronized Task getTask() {
                return task;
            private synchronized void resetTask() {
                task = null;
            synchronized void start(Task pTask) {
                task = pTask;
                synchronized (thread) {
                    thread.notify();
      private final ThreadGroup threadGroup;
      private final int maxSize;
      private final List waitingThreads = new ArrayList();
      private final List runningThreads = new ArrayList();
      private final List waitingTasks = new ArrayList();
      private int num;
      /** Creates a new instance.
       * @param pMaxSize Maximum number of concurrent threads.
       * @param pName Thread group name.
      public ThreadPool(int pMaxSize, String pName) {
        maxSize = pMaxSize;
        threadGroup = new ThreadGroup(pName);
      synchronized void discard(Poolable pPoolable) {
        pPoolable.shutdown();
            runningThreads.remove(pPoolable);
            waitingThreads.remove(pPoolable);
      synchronized void repool(Poolable pPoolable) {
            if (runningThreads.remove(pPoolable)) {
                if (maxSize != 0  &&  runningThreads.size() + waitingThreads.size() >= maxSize) {
                    discard(pPoolable);
                } else {
                    waitingThreads.add(pPoolable);
                    if (waitingTasks.size() > 0) {
                        Task task = (Task) waitingTasks.remove(waitingTasks.size() - 1);
                        startTask(task);
            } else {
                discard(pPoolable);
      /** Starts a task immediately.
       * @param pTask The task being started.
       * @return True, if the task could be started immediately. False, if
       * the maxmimum number of concurrent tasks was exceeded. If so, you
       * might consider to use the {@link #addTask(ThreadPool.Task)} method instead.
      public synchronized boolean startTask(Task pTask) {
        if (maxSize != 0  &&  runningThreads.size() >= maxSize) {
          return false;
            Poolable poolable;
        if (waitingThreads.size() > 0) {
            poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1);
        } else {
                poolable = new Poolable(threadGroup, num++);
        runningThreads.add(poolable);
            poolable.start(pTask);
        return true;
      /** Adds a task for immediate or deferred execution.
       * @param pTask The task being added.
       * @return True, if the task was started immediately. False, if
       * the task will be executed later.
      public synchronized boolean addTask(Task pTask) {
        if (startTask(pTask)) {
          return true;
        waitingTasks.add(pTask);
        return false;
      /** Closes the pool.
      public synchronized void shutdown() {
            while (!waitingThreads.isEmpty()) {
                Poolable poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1);
                poolable.shutdown();
            while (!runningThreads.isEmpty()) {
                Poolable poolable = (Poolable) runningThreads.remove(runningThreads.size()-1);
                poolable.shutdown();
      /** Returns the maximum number of concurrent threads.
       * @return Maximum number of threads.
      public int getMaxThreads() { return maxSize; }
      /** Returns the number of threads, which have actually been created,
         * as opposed to the number of currently running threads.
        public synchronized int getNumThreads() { return num; }
    }

    Sounds like you should read up on the [java tutorials |http://java.sun.com/docs/books/tutorial/essential/concurrency/] on threading.
    I found some car parts that will help me drive. And no, I don't know how to put them together to make a car. But I want to drive on the highway! I found some car parts that can do this.

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

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

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

  • Problems with Threads after upgrade to 817 on Tru64.

    Hewwo.
    I am wondering if you can help me with the following error and, perhaps, tell me how to relink the executables for Oracle. I cannot figure out where -laio_raw has been set. I've poured through the env*.mk files, and looked through the stuff in ~/install/utl directory, but I cannot find out how to respond to the error message below and remake the Oracle apps correctly. Surprisingly, svrmgrl works fine.
    dstyo404:orafs2 50> sqlplus system/manager
    Internal AIO consistency error: Cannot use libaio_raw with threads.
    Either relink without -pthread or link -laio, not -laio_raw.
    Aborting...
    exception system: exiting due to multiple internal errors:
    exception dispatch or unwind stuck in infinite loop
    exception dispatch or unwind stuck in infinite loop
    Thank you for your time.

    To answer my own question, there is a file in $ORACLE_HOME/lib/ called "sysliblist". In order to relink the executables without aio_raw, it must be deleted from this list; and, in it's place, put "-laio". This will solve the above errors with sqlplus, exp, etc.
    Hmph.
    null

  • Help with Threads

    I need help with threads. How can I break this code into teo threads without chaning the data objects at all? Producer will produce string line by line and consumer will take the line and search for the word. Help me please.
    Thank you
    public class WordFinder
    * Main program opens the file given by the user as an argument and
    * searches for the word given by the user. If the word is found,
    * the line number on which the word occurs is displayed.
    * @param args[0] Word to search for
    * @param args[1] Name of file to search
    public static void main(String[] args) throws IOException
    // To keep track of how long the program runs we'll set the startTime
    // variable to the current time in milliseconds and use that at
    // the end of the program to find out how long we ran.
    long startTime = System.currentTimeMillis();
    String wordToFind;
    String currentLine;
    int lineCount = 0; // Keep track of line numbers
    BufferedReader inputFile = null; // Needed to get compiler to quit
    // complaining about uninitialized
    // variables.
    // Make sure we have 2 arguments passed to us
    if (args.length < 2)
    // Nope. Show user how to run and then exit with an error (1)
    System.out.println("usage: java WordFinder <word> <file pathname>");
    System.exit(1);
    // So far, so good. Now try to open the file the user gave us as
    // a parameter. We'll use a BufferedReader object to read the file
    // so we can read one line at a time from the input. If opening the
    // file fails, print an error message and exit with an error (1).
    try
    inputFile = new BufferedReader(new FileReader(args[1]));
    catch (FileNotFoundException e)
    System.out.println(args[1] + ": File not found or is not readable");
    System.exit(1);
    // Set the wordToFind variable to refer to args[0]. We don't
    // really need to do this, but it makes our code more readable
    wordToFind = args[0];
    // We're going to read the file one line at a time. For each
    // line, we'll create a StringTokenizer object to break the line
    // into distinct words, checking each word to see if it's the same
    // as the given search word.
    // Read first line from the file
    currentLine = inputFile.readLine();
    while (currentLine != null) // Repeat until we reach EOF
    // Have a valid input line, increment the counter
    lineCount++;
    // Create a StringTokenizer object over the current line
    StringTokenizer tokens = new StringTokenizer(currentLine);
    // Check each word in the string by accessing each token
    while (tokens.hasMoreTokens())
    // See if the next word is the one we're looking for and
    // advance the token iterator to the next token
    if (wordToFind.equals(tokens.nextToken()))
    // Yes, display the current line number
    System.out.println(wordToFind + " found on line " + lineCount);
    // Read next line from the file
    currentLine = inputFile.readLine();
    } // while
    // Done with the input file
    inputFile.close();
    // Display the running time of this program in milliseconds by
    // subtracting the start time from the current time
    System.out.println((System.currentTimeMillis() - startTime) + " milliseconds");
    } // main
    } // WordFinder

    You may create Queue object. (I guess that you're already know QUEUE)
    Then ... use producer thread to load input file into queue. (Enqueue)
    Consumer ... dequeue
    Queue can be empty because of
    - Input file was read to EOF and Consumer had produced all queue.
    or
    - Cunsumer works too fast... So the queue is empty.
    So, you may have to use ... wait() in Consumer in case of the queue is empty.
    And use notify() in Producer to wake up consumer ...
    Is this right ?

  • Any Nokia phones with Threaded Text messaging?

    I'm looking for a Nokia phone with threaded text messaging.
    Rather like the Palm Centro or Iphone:
    Anyone know of a basic model that can do it?
    I'm currently lusting after the Nokia 3720 Classic and would love if it could organise messages in a more useful way, and banish my thoughts of bulkier handsets. I've loved my Nokia 6030 for a few years but its disintergrating now. 

    s60 phones are usually the smartphone family the E and N series all run on s60. 
    6700 new navigator, the 6220c also runs on s60, 5800xm runs on the new gen for touch screens s60
    the lower modesl 1xxxxx,2xxxxx,3xxxx, 5xxxx,6xxx (the 6 family is divided and can either run on s40 or s60 depending on the phone) series usually run on s40 platform.  for every phone you can look up specs and it will tell you which platform or operating system the phone runs on 
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • Help with Thread dump analisys

    We have problems with our application which runs on bea8.1 sp1.
    Problem is that bea runs out from Threads (StuckThreads).
    thread dums look same for all threads but i can's see what is wrong.
    Here are dumps from first and last threads :
    "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x7f3628
    nid=0xd runnable [a6280000..a6281994
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c3197aa0> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '24' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x6dd548
    nid=0x24 runnable [a3d80000..a3d819
    94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c30c5010> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Rob Woollen <[email protected]> wrote:
    Can you post the full thread dump?
    It looks like you have some code making an RMI call over the network.
    Is it calling another server, or perhaps a loopback call into the same
    server. The latter (opening a socket to your own process) is a good
    way
    to get a deadlock.
    -- Rob
    dara wrote:
    We have problems with our application which runs on bea8.1 sp1.
    Problem is that bea runs out from Threads (StuckThreads).
    thread dums look same for all threads but i can's see what is wrong.
    Here are dumps from first and last threads :
    "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon prio=5tid=0x7f3628
    nid=0xd runnable [a6280000..a6281994
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c3197aa0> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '24' for queue: 'weblogic.kernel.Default'" daemon prio=5tid=0x6dd548
    nid=0x24 runnable [a3d80000..a3d819
    94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <c30c5010> (a java.io.BufferedInputStream)
    at java.io.DataInputStream.readByte(DataInputStream.java:276)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
    at com.hutchison3g.core.product.homebase.services.HomebaseFactoryImpl_Stub.getIdentity(Unknown
    Source)
    at com.hutchison3g.core.product.homebase.client.HomebaseClient.getIdentity(HomebaseClient.java:207)
    at com.hutchison3g.core.product.homebase.client.util.HomebaseProxy.getIdentity(HomebaseProxy.java:78)
    at com.hutchison3g.core.product.homebase.client.util.UserUtil.getIdentity(UserUtil.java:132)
    at com.hutchison3g.core.product.homebase.servlets.TalonUniServlet.doGet(TalonUniServlet.java:181)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at com.hutchison3g.core.product.homebase.client.servlet.core.HomebaseCommonServlet.service(HomebaseCommonServlet.
    java:72)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Thanks Rob,
    sorry for delay but I was on vacation.
    You are right about RMI, our app. consist from FE (front end) and BE (back end),
    comunication between them is RMI.
    We had some problems with BE but now we have new version and it looks ok.
    Anyway thanks for help, if I will have again some problems then it will be
    Help with thread analisys 2 ;-)

  • Pause a game with threads

    Hi All;
    I have been programming a j2me game. I have 2 core threads. One of them is for clock, another is for game logic. I want to make a pause state in the game. When the player presses the related key, I want to wait these two threads. When the user presses the resume key, I want the threads to notify. But I have a illegalMonitorState exception.
    How I can success this pause-resume logic with threads?
    I am waiting for your replies...

    You could need a thread thread, which just listens for pause/restart .... from that thread you can set wait condition for clock or game thread .....
    You can add trace line in the code ... then you will find out that you are syn the game thread or click thread to whom you have syn ... and pausing it .. that is the reason why you are getting IllegalMonitorStateException

  • EOF Exception with Thread interrupts ?

    EOF file Exception for RandomAccess.readFully() call. All the parameters are valid.
    Is it possible/Any one seen to get EOF exception If another Thread interrupt the thread
    which is doing I/O(READ).
    I am running on SUN jdk131/Solaris8?
    Thanks
    -suresht

    Hint if working with threads on reading data from files just synchronize the methods, like
    public synchronized readData(...){...}
    if you do not do that a thread is reading and when it breaks down it will locks the method(in your case the file will not been closed and if a file is not closed it cannot be opened by another thread/method/object/whatever)

  • Touchsmart 520-1030 touchscreen not workin with windows 8

    my touchscreen is not workin on my touchsmart 520-1030 after resetting windows 8

    Hello onecoray.  I understand you're having some issues with your touchscreen.
    Try the solutions offered in this thread and let me know the result.
    Have a great day!
    Please click the white star under my name to give me Kudos as a way to say "Thanks!"
    Click the "Accept as Solution" button if I resolve your issue.

Maybe you are looking for

  • Service Order Creation Error

    Hi, I am creating Service Order from SD Order using Requirement class for the Sales of Services. Service Order will be used for Service Execution. The Problem is when I used Service Product (DIEN) quantity more than one, system stops to create Servic

  • Mail address lookup in shared hosting with multiple address lists setup

    Hi, we have an Exchange 2013 environment for hosting purposes. One client uses two seperate company names (and domain names). These companies are seperated in Exchange and use seperate address lists. This client uses mail between the two domains. Let

  • Klipsch Promedia 2.1 speakers and iMac 10.9

    Has anyone had any success hooking up these Klipsch Promedia 2.1 speakers to an iMac? Is there a driver I need to get from Klipsch? I hooked them up but all I could get was the iMac speakers to work. Went through 'Preferences' and changed the Apple s

  • How do I make the red-green-yellow icons and the text in window title bars larger?

    The title text is a little too small to just see - I have to concentrate on it to read it - and I can't tell the red-green-yellow icons apart without staring at them. Yes, my sight is quite poor; I'm already sitting as close as I can.

  • Where does Safari save pix it uses for Cover Flow?

    I am scrolling through Cover Flow in Safari 4.0 and I wanted to know where it saves the pictures I see in the previews. Is it saved in a Jpeg somewhere that I can access and view or some other format that I can't? Thanks.