Creating threads in Weblogic

For a variety of reasons I need to write my own messaging bridge between Weblogic and MQ. The reasons have been validated by BEA, so I'm not completely off my rocker :)
I can either write this as a standalone java application that acts as a client to weblogic's JMS server, or as a deployed webapp (using the ServletContextListener method to start/stop it). Either way the app will <shudder>create one thread per queue</shudder> and listen on that queue until a message arrives.
The pros of a deployed application (cost-free clustering, management, can use a webapp to manage the threads/queues, etc) leads me in that direction, but creating threads in a J2EE server dubious at best.
Ideally this webapp runs in its own execute queue, and the holy grail is to have the threads run in that execute queue. However, there doesn't seem to be any supported way to create threads from an execute queue.
Has anyone done anything like this? Any suggestions on how to spawn and manage the threads properly? Should it be deployed or stand-alone?
cheers
mike

Hello,
The webapp route sounds better to me than a standalone java app, you will get things up and running a lot more quickly and get all the goodies associated with webapps.
You don't explicity create threads from the queue for example in the way you get connections from a connection pool. Once you have created and configuered your execute queue you just add a few init parameters to your web.xml deployment descriptor:
<servlet>
<servlet-name>MainServlet</servlet-name>
<jsp-file>/myapplication/critical.jsp</jsp-file>
<init-param>
<param-name>wl-dispatch-policy</param-name>
<param-value>CriticalAppQueue</param-value>
</init-param>
</servlet>
see:
http://e-docs.bea.com/wls/docs81/perform/AppTuning.html#1105201
for complete instructions.
cheers
Hussein Badakhchani
www.orbism.com

Similar Messages

  • Unable to create thread from startup class

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

  • Stuck thread in weblogic

    Hello All,
    We are getting stuck thread in weblogic under high load.
    following is the thread dump from weblogic 10
    "[STANDBY] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'" id=83 idx=0x134 tid=5376 prio=5 alive, in native, waiting, daemon
    -- Waiting for notification on: weblogic/work/ExecuteThread@0x06DEC880[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:474)
    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:156)
    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x06DEC880[fat lock]
    at weblogic/work/ExecuteThread.run(ExecuteThread.java:177)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "[STANDBY] ExecuteThread: '14' for queue: 'weblogic.kernel.Default (self-tuning)'" id=84 idx=0x138 tid=1688 prio=5 alive, in native, waiting, daemon
    -- Waiting for notification on: weblogic/work/ExecuteThread@0x06E50070[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:474)
    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:156)
    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x06E50070[fat lock]
    at weblogic/work/ExecuteThread.run(ExecuteThread.java:177)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "[STUCK] ExecuteThread: '15' for queue: 'weblogic.kernel.Default (self-tuning)'" id=85 idx=0x13c tid=3984 prio=1 alive, daemon
    at jrockit/vm/Allocator.allocArray(Allocator.java:392)
    at java/lang/AbstractStringBuilder.<init>(AbstractStringBuilder.java:44)
    at java/lang/StringBuffer.<init>(StringBuffer.java:80)
    at com/vignette/exolab/castor/jdo/oql/ParseTreeWalker.addWhereClause(ParseTreeWalker.java:994)
    at com/vignette/exolab/castor/jdo/oql/ParseTreeWalker.createQueryExpression(ParseTreeWalker.java:816)
    at com/vignette/exolab/castor/jdo/oql/ParseTreeWalker.<init>(ParseTreeWalker.java:139)
    at com/vignette/exolab/castor/jdo/engine/OQLQueryImpl.create(OQLQueryImpl.java:274)
    at com/vignette/exolab/castor/jdo/engine/DatabaseImpl.getOQLQuery(DatabaseImpl.java:502)
    at com/vignette/as/server/persist/dao/JDODAOPersistor.findByQuery(JDODAOPersistor.java:395)
    at com/vignette/as/server/persist/dao/JDODAOPersistor.findByIds(JDODAOPersistor.java:360)
    at com/vignette/as/server/persist/ExtensibleApplicationObjectPersistor.findByIdsHelper(ExtensibleApplicationObjectPersistor.java:159)
    at com/vignette/as/server/persist/ExtensibleApplicationObjectPersistor.findByIds(ExtensibleApplicationObjectPersistor.java:90)
    at com/vignette/as/server/logic/channel/ChannelOpsLogic.findById(ChannelOpsLogic.java:194)
    at com/vignette/as/server/logic/channel/ChannelOpsLogicGen.findById(ChannelOpsLogicGen.java:1553)
    at com/vignette/as/client/javabean/Channel.findById(Channel.java:247)
    at com/vignette/as/server/logic/channel/ChannelOpsLogic.getSubchannels(ChannelOpsLogic.java:563)
    at com/vignette/as/server/logic/channel/ChannelOpsLogicGen.getSubchannels(ChannelOpsLogicGen.java:3237)
    at com/vignette/as/client/javabean/ChannelBase.getSubchannels(ChannelBase.java:480)
    at com/vignette/as/client/javabean/ChannelBase.getAllSubchannels(ChannelBase.java:375)
    at com/astrazeneca/portal/dpm/ChannelWrapper.getSubchannels(ChannelWrapper.java:203)
    at jsp_servlet/_jsp/_grid/__xmlgeneration.subChannelRec(__xmlgeneration.java:97)
    at jsp_servlet/_jsp/_grid/__xmlgeneration.subChannelRec(__xmlgeneration.java:146)
    at jsp_servlet/_jsp/_grid/__xmlgeneration._jspService(__xmlgeneration.java:430)
    at weblogic/servlet/jsp/JspBase.service(JspBase.java:34)
    at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
    at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
    at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)
    at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic/security/service/SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Unknown Source)
    at weblogic/servlet/internal/WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
    at weblogic/servlet/internal/WebAppServletContext.execute(WebAppServletContext.java:2046)
    at weblogic/servlet/internal/ServletRequestImpl.run(ServletRequestImpl.java:1366)
    at weblogic/work/ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic/work/ExecuteThread.run(ExecuteThread.java:172)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "[STANDBY] ExecuteThread: '16' for queue: 'weblogic.kernel.Default (self-tuning)'" id=86 idx=0x140 tid=1192 prio=5 alive, in native, waiting, daemon
    -- Waiting for notification on: weblogic/work/ExecuteThread@0x06E50AF0[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:474)
    at weblogic/work/ExecuteThread.waitForRequest(ExecuteThread.java:156)
    ^-- Lock released while waiting: weblogic/work/ExecuteThread@0x06E50AF0[fat lock]
    at weblogic/work/ExecuteThread.run(ExecuteThread.java:177)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "VAP Topic Consumer Thread - 0" id=87 idx=0x144 tid=6040 prio=5 alive, in native, parked, daemon
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2416)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:118)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com/epicentric/topic/internal/MessageQueue.remove(MessageQueue.java:67)
    at com/epicentric/topic/internal/Consumer.run(Consumer.java:72)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "VAP Topic Consumer Thread - 1" id=88 idx=0x148 tid=4752 prio=5 alive, in native, parked, daemon
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2416)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:118)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com/epicentric/topic/internal/MessageQueue.remove(MessageQueue.java:67)
    at com/epicentric/topic/internal/Consumer.run(Consumer.java:72)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "VAP Topic Consumer Thread - 2" id=89 idx=0x14c tid=4504 prio=5 alive, in native, parked, daemon
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2416)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:118)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com/epicentric/topic/internal/MessageQueue.remove(MessageQueue.java:67)
    at com/epicentric/topic/internal/Consumer.run(Consumer.java:72)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "VAP Topic Consumer Thread - 3" id=90 idx=0x150 tid=5572 prio=5 alive, in native, parked, daemon
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2416)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:118)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com/epicentric/topic/internal/MessageQueue.remove(MessageQueue.java:67)
    at com/epicentric/topic/internal/Consumer.run(Consumer.java:72)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "VAP Topic Consumer Thread - 4" id=91 idx=0x154 tid=4340 prio=5 alive, in native, parked, daemon
    at jrockit/vm/Locks.park0(J)V(Native Method)
    at jrockit/vm/Locks.park(Locks.java:2416)
    at sun/misc/Unsafe.park(ZJ)V(Native Method)
    at java/util/concurrent/locks/LockSupport.park(LockSupport.java:118)
    at java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1767)
    at java/util/concurrent/LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
    at com/epicentric/topic/internal/MessageQueue.remove(MessageQueue.java:67)
    at com/epicentric/topic/internal/Consumer.run(Consumer.java:72)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "CS_Local_Monitor_0" id=92 idx=0x158 tid=3864 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/vignette/config/client/cachefile/ConfigSpaceLocal$Monitor.run(ConfigSpaceLocal.java:1364)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-41" id=93 idx=0x15c tid=4884 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x0A899918[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x0A899918[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-42" id=94 idx=0x160 tid=4968 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x06BE2238[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x06BE2238[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "TaskScheduler thread" id=98 idx=0x164 tid=1580 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/task/TaskScheduler.sleepUntilRuntime(TaskScheduler.java:226)
    at com/epicentric/task/TaskScheduler.run(TaskScheduler.java:83)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "TaskQueue Lease Manager" id=100 idx=0x168 tid=3908 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/task/internal/LeaseManager.waitForNextExecutionTime(LeaseManager.java:69)
    at com/epicentric/task/internal/LeaseManager.run(LeaseManager.java:52)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread System Expiration and Ostracizing Thread" id=101 idx=0x16c tid=4200 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/threadpool/standard/StandardThreadPool$ExpirationThread.run(StandardThreadPool.java:238)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Task Executor" id=102 idx=0x170 tid=3592 prio=1 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/task/internal/TaskExecutor.waitForNextExecutionTime(TaskExecutor.java:205)
    at com/epicentric/task/internal/TaskExecutor.run(TaskExecutor.java:186)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Task Metric Gatherer" id=103 idx=0x174 tid=5988 prio=1 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/task/internal/TaskExecutor$1.run(TaskExecutor.java:142)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "CS_Local_Monitor_0" id=142 idx=0x178 tid=5196 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/vignette/config/client/cachefile/ConfigSpaceLocal$Monitor.run(ConfigSpaceLocal.java:1364)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-54" id=130 idx=0x17c tid=648 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x0AD3C798[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x0AD3C798[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Timer-10" id=113 idx=0x180 tid=1092 prio=5 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/TaskQueue@0x00B22F40[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@0x00B22F40[fat lock]
    at java/util/TimerThread.run(Timer.java:462)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "JNDI Monitor" id=116 idx=0x184 tid=1856 prio=5 alive, in native, waiting, daemon
    -- Waiting for notification on: com/epicentric/jndi/Monitor@0x00B12D60[fat lock]
    at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method)
    at java/lang/Object.wait(J)V(Native Method)
    at com/epicentric/jndi/Monitor.run(Monitor.java:100)
    ^-- Lock released while waiting: com/epicentric/jndi/Monitor@0x00B12D60[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-47" id=117 idx=0x188 tid=816 prio=5 alive, in native, daemon
    at jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native Method)
                    at jrockit/net/SocketNativeIO.socketRead(SocketNativeIO.java:31)
                    at java/net/SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I(SocketInputStream.java)
                    at java/net/SocketInputStream.read(SocketInputStream.java:129)
                    at java/io/BufferedInputStream.fill(BufferedInputStream.java:218)
                    at java/io/BufferedInputStream.read1(BufferedInputStream.java:256)
                    at java/io/BufferedInputStream.read(BufferedInputStream.java:313)
                    ^-- Holding lock: java/io/BufferedInputStream@0x00B3EA48[thin lock]
    at com/sun/jndi/ldap/Connection.run(Connection.java:784)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "TaskScheduler thread" id=119 idx=0x18c tid=4520 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/epicentric/task/TaskScheduler.run(TaskScheduler.java:94)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "OracleTimeoutPollingThread" id=124 idx=0x190 tid=2628 prio=10 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at oracle/jdbc/driver/OracleTimeoutPollingThread.run(OracleTimeoutPollingThread.java:158)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-55" id=131 idx=0x194 tid=5700 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x0973F378[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x0973F378[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-56" id=132 idx=0x198 tid=5596 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at org/apache/commons/pool/impl/GenericObjectPool$Evictor.run(GenericObjectPool.java:1122)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "CacheSyncThread" id=133 idx=0x19c tid=708 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/vignette/as/server/caching/CacheSynchronization.run(CacheSynchronization.java:135)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-58" id=135 idx=0x1a0 tid=5652 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at org/apache/commons/pool/impl/GenericObjectPool$Evictor.run(GenericObjectPool.java:1122)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-61" id=143 idx=0x1a4 tid=4196 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x0BEF1160[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x0BEF1160[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-62" id=144 idx=0x1a8 tid=5456 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x0D650770[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x0D650770[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-63" id=145 idx=0x1ac tid=1056 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at org/apache/commons/pool/impl/GenericObjectPool$Evictor.run(GenericObjectPool.java:1122)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "CacheSyncThread" id=146 idx=0x1b0 tid=3496 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/vignette/as/server/caching/CacheSynchronization.run(CacheSynchronization.java:135)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-64" id=147 idx=0x1b4 tid=4132 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at org/apache/commons/pool/impl/GenericObjectPool$Evictor.run(GenericObjectPool.java:1122)
    at java/lang/Thread.run(Thread.java:595)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "CS_Local_Monitor_0" id=221 idx=0x1b8 tid=6104 prio=5 alive, in native, sleeping, native_waiting, daemon
    at java/lang/Thread.sleep(J)V(Native Method)
    at com/vignette/config/client/cachefile/ConfigSpaceLocal$Monitor.run(ConfigSpaceLocal.java:1364)
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-84" id=222 idx=0x1bc tid=3500 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x1673EAD8[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x1673EAD8[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "Thread-85" id=223 idx=0x1c0 tid=5492 prio=1 alive, in native, waiting, daemon
    -- Waiting for notification on: java/util/ArrayList@0x1932F128[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:474)
    at com/vignette/logging/LocaleAppender$Dispatcher.run(LocaleAppender.java:393)
    ^-- Lock released while waiting: java/util/ArrayList@0x1932F128[fat lock]
    at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
    -- end of trace
    "[STANDBY] ExecuteThread: '17' for queue

    Hi,
    We are facing a similar stuck thread problem with the following stack trace...
    Any help on this is much appreciated.
    Thanks,
    Sen
    Thread-86 "[STUCK] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'" <alive, in native, suspended, waiting, priority=1, DAEMON> {
    -- Waiting for notification on: netscape.ldap.LDAPSearchListener@2accce6[fat lock]
    java.lang.Object.wait(Object.java:???)
    java.lang.Object.wait(Object.java:485)
    netscape.ldap.LDAPMessageQueue.waitForMessage(LDAPMessageQueue.java:198)
    netscape.ldap.LDAPMessageQueue.waitFirstMessage(LDAPMessageQueue.java:100)
    netscape.ldap.LDAPConnection.sendRequest(LDAPConnection.java:1782)
    ^-- Holding lock: netscape.ldap.LDAPConnection@138555c[thin lock]
    netscape.ldap.LDAPConnection.search(LDAPConnection.java:2500)
    weblogic.security.providers.authentication.LDAPAtnDelegate.getDNForUser(LDAPAtnDelegate.java:3317)
    weblogic.security.providers.authentication.LDAPAtnDelegate.listMemberGroups(LDAPAtnDelegate.java:2091)
    weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.addAllGroups(LDAPAtnLoginModuleImpl.java:419)
    weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.addGroups(LDAPAtnLoginModuleImpl.java:411)
    weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:136)
    com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:110)
    com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:101)
    sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:???)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:27)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    javax.security.auth.login.LoginContext.invoke(LoginContext.java:720)
    javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
    javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
    javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
    javax.security.auth.login.LoginContext.login(LoginContext.java:566)
    com.bea.common.security.internal.service.JAASLoginServiceImpl.login(JAASLoginServiceImpl.java:77)
    sun.reflect.GeneratedMethodAccessor2726.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    com.bea.common.security.internal.utils.Delegator$ProxyInvocationHandler.invoke(Delegator.java:57)
    $Proxy17.login(Unknown Source)
    weblogic.security.service.internal.WLSJAASLoginServiceImpl$ServiceImpl.login(Unknown Source)
    com.bea.common.security.internal.service.JAASAuthenticationServiceImpl.authenticate(JAASAuthenticationServiceImpl.java:74)
    sun.reflect.GeneratedMethodAccessor2727.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    com.bea.common.security.internal.utils.Delegator$ProxyInvocationHandler.invoke(Delegator.java:57)
    $Proxy37.authenticate(Unknown Source)
    weblogic.security.service.WLSJAASAuthenticationServiceWrapper.authenticate(Unknown Source)
    weblogic.security.service.PrincipalAuthenticator.authenticate(Unknown Source)
    weblogic.servlet.security.internal.SecurityModule.checkAuthenticate(SecurityModule.java:213)
    weblogic.servlet.security.ServletAuthentication.login(ServletAuthentication.java:391)
    weblogic.servlet.security.ServletAuthentication.weak(ServletAuthentication.java:371)
    com.bea.p13n.security.Authentication.login(Authentication.java:118)
    com.ppluk.moneyout.portal.auth.LoginServlet.doGet(LoginServlet.java:40)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:700)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:224)
    weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:108)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:198)
    weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:41)
    com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:50)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:41)
    com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:241)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:41)
    com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:61)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:41)
    weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:25)
    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:41)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3468)
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:308)
    weblogic.security.service.SecurityManager.runAs(Unknown Source)
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2116)
    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2038)
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1372)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:165)
    }

  • Stuck Threads on weblogic 10.3.2 Holding lock HttpURLConnection

    We are having issue with STUCK THREADS on weblogic 10.3.2. Basically my application makes a lot of web service calls over HTTPS and once in a while I see few STUCK THREADS and most of the time they clear but sometimes I have to bounce my server to clean.
    I have a thread dump, according to this its holding lock at weblogic.net.http.HttpURLConnection.getInputStream
    Any help to resolve this problem is highly appreciated.
    ThreadDump:
    <May 24, 2011 9:59:08 AM EDT> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "604" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@b607d75", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    Thread-75 "[STUCK] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'" <alive, in native, suspended, priority=1, DAEMON> {
    jrockit.net.SocketNativeIO.readBytesPinned(SocketNativeIO.java:???)
    jrockit.net.SocketNativeIO.socketRead(SocketNativeIO.java:31)
    java.net.SocketInputStream.socketRead0(SocketInputStream.java:???)
    java.net.SocketInputStream.read(SocketInputStream.java:107)
    weblogic.utils.io.ChunkedInputStream.read(ChunkedInputStream.java:149)
    java.io.InputStream.read(InputStream.java:85)
    com.certicom.tls.record.ReadHandler.readFragment(Unknown Source)
    com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
    com.certicom.tls.record.ReadHandler.read(Unknown Source)
    ^-- Holding lock: com.certicom.tls.record.ReadHandler@bec563c[thin lock]
    com.certicom.io.InputSSLIOStreamWrapper.read(Unknown Source)
    java.io.BufferedInputStream.fill(BufferedInputStream.java:189)
    java.io.BufferedInputStream.read(BufferedInputStream.java:236)
    ^-- Holding lock: java.io.BufferedInputStream@bec5d9f[thin lock]
    weblogic.net.http.MessageHeader.isHTTP(MessageHeader.java:214)
    weblogic.net.http.MessageHeader.parseHeader(MessageHeader.java:141)
    weblogic.net.http.HttpClient.parseHTTP(HttpClient.java:452)
    ^-- Holding lock: weblogic.net.http.HttpsClient@bec5202[thin lock]
    weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:328)
    weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
    ^-- Holding lock: weblogic.net.http.SOAPHttpsURLConnection@bd3b209[thin lock]
    weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:939)
    com.sun.xml.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:213)
    com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:116)
    com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:101)
    com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:580)
    com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:553)
    com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:535)
    com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:433)
    ^-- Holding lock: com.sun.xml.ws.api.pipe.Fiber@bd3afa8[thin lock]
    com.sun.xml.ws.client.Stub.process(Stub.java:238)
    com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
    com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:102)
    com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
    com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:116)
    $Proxy107.jobSubmit(Unknown Source)
    com.somejob.invokeService(JobOperation.java:53)
    com.somejobws.operations.ticket.execute(ticket.java:30)
    com.somejobutil.Somehelper.process(Somehelper.java:174)
    com.somejobutil.Somehelper.processJob(Somehelper.java:147)
    com.somejobutil.Somehelper.processMDB(Somehelper.java:91)
    com.somejobejb.ProcessMDB.onMessage(ProcessMDB.java:28)
    sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:102)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:86)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:102)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:151)
    $Proxy67.onMessage(Unknown Source)
    weblogic.ejb.container.internal.MDListener.execute(MDListener.java:403)
    weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:352)
    weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:264)
    weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4564)
    weblogic.jms.client.JMSSession.execute(JMSSession.java:4060)
    weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3746)
    weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5096)
    weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:165)
    }

    Yes, we have the same problem, stuck thread on weblogic.net.http.HttpsURLConnection.getResponseCode() (actually implemented by weblogic.net.http.SOAPHttpsURLConnection which also appears to be deprecated ???)
    When we use the class javax.net.ssl.HttpsURLConnection the getResponseCode() method works perfectly well, so it looks like the weblogic implementation is to blame.
    This is becoming rather urgent now because we're looking to migrate from OC4J to Weblogic and this issue has therefore become a blocker.

  • Ant task for creating a new weblogic domain in weblogic 10.3

    Hi,
    Can anybody help me in writing an ant task in build.xml for creating a new weblogic domain in weblogic 10.3, like as in <target name="new-domain">
         <echo message=""/>
         <echo message="Attempting to create new domain:"/>
         <delete dir="C:\bea\user_projects\domains" />
         <mkdir dir="C:\bea\user_projects\domains"/>
         <wlserver dir="C:\bea\user_projects\domains" domainname="mydomain"
         host="127.0.0.1" port="7001"
         generateConfig="true" servername="AdminServer" username="weblogic"
         password="weblogic" action="start"/>
         </target>
    Please suggest me adding something to the above in order to create the domain successfully.

    Hi,
    Can anybody help me in writing an ant task in build.xml for creating a new weblogic domain in weblogic 10.3, like as in <target name="new-domain">
         <echo message=""/>
         <echo message="Attempting to create new domain:"/>
         <delete dir="C:\bea\user_projects\domains" />
         <mkdir dir="C:\bea\user_projects\domains"/>
         <wlserver dir="C:\bea\user_projects\domains" domainname="mydomain"
         host="127.0.0.1" port="7001"
         generateConfig="true" servername="AdminServer" username="weblogic"
         password="weblogic" action="start"/>
         </target>
    Please suggest me adding something to the above in order to create the domain successfully.

  • Error Code -17400; Unable to create thread

    Running TestStand 4.0.  Test sequence calls many sequences that run as new executions and runs fine for up to about 8 units testing simultaneously.  After that, I get a run-time error code -17400; Unable to create thread.  There are no other details available.  The steps that generate the error are able to create the new executions initially, but eventually fail once about 22 executions are running.  I am monitoring memory resources and there does not appear to be any issues.  Any troubleshooting suggestions?  Thanks.

    My test sequence has several test groups, each of which contain loops that create new threads (tests) for 48 UUTs.  Thus the number of running threads does get very high.  I was running into problems with Windows XP GDI Object resources once the number of threads reached about 200.  I then modified my program into smaller test groups to keep the number of threads at any time to less than 150.  GDI resources are no longer an issue, but the error -17400 unable to create thread happens after the first test group has completed and the second test group is just trying to run.  Note that the second test group runs fine if I skip the first test group, so the sequence itself should be okay.  I thought it might be a memory issue (even though there are no apparent memory issues seen in Windows Task Manager), so I set the "Unload after step executes" property for each of the new executions created.  That did not resolve the issue. 
    I am trying to create a simple sequence to duplicate the error without using any of the actual test sequences that require test hardware, but have not been successful thus far.
    Thanks for your replies and suggestions!

  • Spawning Threads in WebLogic - forbidden in 5.1.  what about 6.x?

              Is spawning threads in 6.x permitted?
              http://websupport.beasys.com/websupport/clearexp_cgi/solution.htm?probdesc.objid=268519040
              

    I do not think it is forbidden, but certainly not recommended. In 5.1 using user
              threads was causing all sorts of problems ranging from memory leaks (caused by
              threadlocal implementation) to mysterious exceptions when ivoking EJBs etc.
              Threadlocal was fixed in 6, but still, you can never tell what will break if you
              try to invoke WebLogic services (EJBs etc) from user threads.
              You can use this trick to borrow threads from WebLogic execute threads pool:
              http://dima.dhs.org/misc/AsyncServlet.jsp
              Mike Reiche <[email protected]> wrote:
              > Is spawning threads in 6.x permitted?
              > http://websupport.beasys.com/websupport/clearexp_cgi/solution.htm?probdesc.objid=268519040
              Dimitri
              

  • Create Thread on Photoshop Plug-in

    Dear All,
    Right now, I am developing a demo Photoshop plug-in software to understand the way to implement Photoshop plug-in. However, I meet a issues that I can not create a Thread on Photoshop plug-in by CreateThread() API. I implement as below:
    Main function:
    CreateThread( NULL, 0, Test1Thread, NULL, 0, NULL);
    Thread function:
    DWORD WINAPI Test1Thread(LPVOID pParam)
    /*Do something*/
    return 0;
    When I compile and load plug-in on Photoshop, it show an error message like this:
    The instruction at "0x09fd100a" referenced memory at "0x09fd100a". The memory could not be "read"
    Click on OK to terminate the program
    Click on CANCEL to debug the program
    Can you give me some suggestions that I can create a Thread by CreateThread() API on Photoshop plug-in or not? And how can I create Thread?
    I am looking forward your answer.
    Thanks for your help,
    Hieu Nguyen.
    PS: I am developing on Window OS and Visual C++ development tool.

    Thanks Aandi Inston and Marcus Phillips for your answer.
    In thread I just use Named Pipe inter-process communication mechanism to send signal to the other application. So I do not use any Photoshop API.
    However, it is strange that I can not put my Thread in begin of PluginMain function:
    DLLExport SPAPI SPErr PluginMain
    ( char* caller, char* selector, void* message)
    SPErr error = kSPNoError;
    SPMessageData *basicMessage = NULL;
    SPPluginRef plugInRef = NULL;
    SPErr err = 0;
    basicMessage = (SPMessageData *) message;
    sSPBasic = basicMessage->basic;
    gPlugInRef = basicMessage->self;
    MyThread();/*CAN NOT RUN THE THREAD!!!!*/
    I must change my Thread function to position after checking caller parameter
    Please show me the reason why?
    Thanks,

  • Why are there 2 methods to create thread ?

    Hi,
    To create threads, there are two methods
    1) Inherit the THREAD super-class
    2) Implement the interface RUNNABLE.
    The reason for providing two methods is that, the user can only one level of "implementation inheritance". That is the reason, which comes immediately to mind. But is there another reason(s)? If yes, than what is the reason??
    Any help would be welcome
    Thanks in advance

    I was one of those authors. We all read some other
    author who said the same dumb thing LOL, been there, done that, you have my sympathy :-)
    Could you explain your use of the words "policy" and
    "mechanism"? I completely agree with your conclusion,
    but don't really understand your argument.This is one of the things that I've taken from my experiences with the X Window System (tm, I think). "Mechanism, not policy" was one of the mantras that would be repeated by every author. As I understood it, the idea was that the X protocol, Xlib, and even Xt prescribed the mechanism for a program's interaction with windows on a client screen, but did not prescribe how those windows would interact with the user. That was the "policy" to be implemented by the toolkit and application layers (thus the different appearance of Motif, OpenLook, Xaw, &c, even though they used the same underlying code up through the toolkit).
    I like the mantra, and as I've come to understand OO programming, I try to apply it as a way to identify what could/should be abstracted and what needs to remain concrete. If something abstracts a basic service that can be used in multiple ways -- like threads -- I consider that mechanism. If something is closely tied to the way my application works, I consider that policy. The former are implemented with interfaces and abstract classes, and do not contain application-specific code; the latter are implemented with instantiable classes.

  • Creating Threads in Java Stored procedures

    Can I create threads inside Java Stored procedures?
    or is there a restriction?
    Thanks
    Kal

    Can I create threads inside Java Stored procedures?
    or is there a restriction?
    Thanks
    Kal Hi Kal,
    I don't mean to be rude, but have you tried it? Personally, I
    haven't tried it (since I didn't have the need).
    You don't say what version of Oracle DBMS you are using, but I
    am using 8.1.7.3 on Solaris 7, and according to Oracle's
    "Oracle 8i Java Developer's Guide", there is no restriction
    (of-course, that depends on what you call a "restriction" :-)
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83728/03writ11.htm#1003094
    Hope this helps.
    Good Luck,
    Avi.

  • Listeners, load a class on startup and creating threads in infinite loop

    This is an identical post to the one I made in the jsp forum. I do this as I know, being a regular here, that there are equally good people(in j2ee web application development) in both these forum, but many of them stick to their particular forums of choice - jsp / servlets.
    I was wondering if there is any means by which I could launch my own class when tomcat starts (in the same jvm).
    1. I need one or more Thread/TimerTask because the requirement is such that the application would have continous data drops (in the form of logs) which has to be picked up, parsed and pushed into a db. Another part of the application reads the data from the db on requests (http) and displays it over the web. The thread has to poll for arrival of new logs and then hand it over to a framework for parsing and inserting the parsed data to a db.
    2. I know that I can possibly use a servlet with a load-on-startup value greater than 1 and code my requirement into the init method. However, using a servlet for a functionality different from servicing http requests has me worried. (valid ?), not to mention the fact that Iam very uneasy about creating threads from within Servlets.
    3. I googled hard and found that I could probably use a tomcat specific context lifecycle listener.
    4. I could also possibly use the servlet api - the ServletContextListener.
    5. I have rejected #2 and settled on either #3 or #4 - the ServletContextListener or Tomcat specific Lifecycle Listener, though the later, as I said binds me to Tomcat (which is ok for me). Are there any other specific (dis)advantages of using either especially when I have to create threads from within them (on context startup)? Other than memory leaks, killing the thread objects & associated resources on context shutdown, is there anything else that I need to watch out for while using threads.
    6. I wonder is there is there a plain startup hook available in tomcat (rather than listeners) - from where I can launch a class that starts a thread in the same jvm as tomcat's ?
    Thanks In Advance,
    Ram.

    Anybody ? Sorry for bumping up.
    Thanks,
    Ram.

  • Creating Threads in EJBs

    Hi,
    I know that you are not allowed to create threads inside EJBs. However, can an EJB call some java networking code that creates threads for its purpose?
    In other words, how far does this prohibition on threads go? You can't even call some code that creates threads inside an EJB or is it that you just can't create threads inside the EJB class itself?
    Thanks,
    Y.

    I know that you are not allowed to create threads
    inside EJBs. However, can an EJB call some java
    networking code that creates threads for its
    purpose?Although the specs don't allow you, they don't completely rule out the possibility.
    In other words, how far does this prohibition on
    threads go? You can't even call some code that
    creates threads inside an EJB or is it that you just
    can't create threads inside the EJB class itself?
    http://www.theserverside.com/discussions/thread.tss?thread_id=31118This discussion should throw some light.

  • Creating threads in init for servlet (advanced)

    Hello
    we have a servlet ..in servlets init method we are creating new threads by calling the Timer class like this
    BGMSchedul = new Timer(true);
    BGM = new BackManager();
    BGMSchedul.scheduleAtFixedRate(BGM, 10000, 30000); //every 30 secondsProblem is that during our stress testing on IBM WSAD we've noticed errors like J2CA0075W: An active transaction should be present
    Upon researching this issue further i found this link http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21231761
    which i think suggests that the servlet shouldnt be creating threads which make J2C connections. Our thread is making the DB connection.
    does nay one have experince with this sort of problem? is it a bad programming construct to create threds in a servlet? if so..where should we be creating our threads? we want this thread to run every 30 seconds and this is a web appliction.
    I'd appreciate any help

    I've created a POJO class that implements servletcontextlistener and took out the time thread from servlet and placed it in pojo's contextInitialized method. however, i still get the same warning.

  • Receiving Error message Can't create threads

    I am using Adobe 6.0 and all of a sudden, when I try to convert any document to a PDF I get the error, "An Error Occured While Creating Threads". This then crashes 6.0.
    Any ideas on how I can fix this? I have tried reinstalling several times.
    I am running Office 2003 with Windows XP.
    Thanks.

    You are in the wrong forum...this is for Reader...you need to post in the Acrobat forum.

  • Problem creating threads

    Hi,
    I'm trying to make a LabView application that creates threads, which set and
    unset digital lines. For some reason I can't include attachments to my posts,
    but I'll try to explain what I have done so far.
    I have a one VI that runs forever in a while loop and sets a digital line to 1 or 0
    every 500 ms. This VI is defined to be reentrant. From this VI I would like to have
    numerous of instances with different digital lines. This VI is supposed to be the
    base from the threads. The digital port is the only thing that is different in each
    thread.
    I use another VI to create these threads with Invoke Method. First this VI uses
    Open VI Reference. Then I use Invoke Method to get the type descriptor of the
    control I want to change in the VI. Next I call Invoke Method to set the digital port
    to be used with parameters gotten from the previous Invoke Method. And finally
    I call Invoke Method: Run VI.
    I get an error that states "Memory or data structure corrupt". The source is in the
    set value.
    Hopefully this makes at least some sense and someone can give me some tips
    on how to do this.
    Thanks.
    P.S. I'm trying add files to my posts from the "Browse..." button that is located at
    the bottom of this message writing page, but for some reason the attachments
    does not show. Am I doing something wrong?

    Thank you LV_Pro and altenbach for your replies.
    I will try to explain this matter more clearly. First of all I'm using the evaluation
    version of LabView 8.2 on Windows 2000. I also have LV 6.2 which I have tried
    this, but we're propably  going to use a 8.x version, so 8.2 will be my main
    environment now.
    I need to make a DLL that will be called from another  application. In the library
    the functions/VIs should run in threads for parallel execution and the application
    using the DLL can't wait for the execution to end. I'm trying to make the functions
    inside the library as general purpose as possible, because those same functions
    are needed for different things.
    If there's some other way to create threads in LabView, please let me know, since
    this is the only way I know, and it's not even working.
    Hope this explains it better. If not let me know and I will draw a diagram or something.
    Thanks.
    Attachments:
    BlinkerThreadRunner.vi ‏15 KB
    DOutBlinkerThread.vi ‏11 KB

Maybe you are looking for

  • Floating point rounding error

    I've been working on an egyptian fraction program and for some reason I cant seem to figure out a way to fix this rounding error. An egyptian fraction is a fraction that can be expressed as a sum of fractions eg. 3/4 = 1/2 + 1/4. For some reason on c

  • Bursting Delivery

    Hi, I am trying to burst a report based on the data source from a report in OBIEE. The data source contains invoice data and I am trying to generate and email a batch of invoices to customers. I have selected the data source and set up an invoice tem

  • Excluded objects

    I was analyzing memory leaks in my application using DevPartner, i get to see columns called "Profiled Objects", and "Excluded Objects". What are these excluded objects?

  • Sync of iPhone Calendar over WebDAV?

    My question is: do you think that Apple might offer a possibility to sync the iPhone Calendar directly to a .ics-file hosted on a WebDAV server in future versions of the firmware? We use this method to have a group calendar for users of Windows (via

  • X240 DO NOT HAVE Internal Battery, keypad backlit. 3 Cell External Battery only last for 2 hours!

    Why does Lenovo dont tell about this missing features?? I bought the unit a day before I left the country, and then to my surprise it does not have the internal battery that Lenovo is boasting about. Fn+Spacebar doesnt work in lighting up the keypad