thread « Development « Java Enterprise Q&A





1. How do I create a thread dump of a Java Web Start application    stackoverflow.com

Is it possible to get a thread dump of a Java Web Start application? And if so, how? It would be nice if there were a simple solution, which would enable a ...

2. Why spawning threads in J2EE container is discouraged?    stackoverflow.com

One of the first things I've learned about J2EE development is that I shouldn't spawn my own threads inside a J2EE container. But when I come to think about it, I ...

3. Thread safety in Java web application data access class    stackoverflow.com

A hobby project of mine is a Java web application. It's a simple web page with a form. The user fills out the form, submits, and is presented with ...

4. Threading in J2EE webapps    stackoverflow.com

I am curious about how the following concepts typically execute inside a J2EE container, is one instance created per request, or does one instance serve all requests?

  • Servlets
  • Tags
I want to know this ...

5. Creating threads within the cluster    stackoverflow.com

I wish to know is there any way that I can create the threads on other nodes without starting the process on the nodes. For example :- lets say I have cluster ...

6. Thread Safety Of Custom Sequential CGDataProvider    stackoverflow.com

When creating a custom sequential CGDataProvder to render a custom image format you specify the CGDataProviderSequentialCallbacks that should be used. While doing some optimization work to improve the speed of my ...

7. Java - Thread Synchronization in a web app    stackoverflow.com

I have a web app where I load components lazily. There is a lot of

static Bla bla;
...    
if(bla == null) 
    bla = ...

8. is it possible my threads are not being killed when the server is killed    stackoverflow.com

A quartz scheduler is being used in an Application I am working on. A process that runs using the quartz scheduler spawns new threads. I was wondering if it ...

9. Help with Java thread dump of partially hanged j2ee server    stackoverflow.com

Our J2ee server (which will remain nameless for embarrassment reasons) slows down drastically from time to time. I have managed to create a thread dump. And trying to analyze it. One ...





10. How to fire off a asych thread in a web application, and gaurantee only 1 thread fires?    stackoverflow.com

I want to cache a object in memory. Regenerating the object when the cache expires is fairly expensive, so I want to do the following: When the cache is "about" to ...

11. J2EE specification and multi threading    stackoverflow.com

I am writing a J2EE application using Struts and Spring. In one of the operations there is heavy database processing, and hence performance issues. What I want to know ...

12. Start and Stop Thread from WebApp    stackoverflow.com

I write to understand if and how I could do the following thing. I have a WebApp for management, in which I should add a button (or something similar) to start and ...

13. How to stop threads when undeploying a JEE application?    stackoverflow.com

I undeploy my JEE app that uses an asynchronous logger that logs in its own thread from the Drools rules engine. I use it to log decisions the rules engine makes ...

14. We use IBM MQ6.1. Can we send messages to Queue using multi threading?    stackoverflow.com

We use IBM MQ6.1. And use IBM API to send Messages to Queue. As we need to send huge number of messages, was wondering if we can use multithreading and send messages ...

15. java call function from multiple threads not declared as thread safe    stackoverflow.com

There is a JDK function that, although the javadocs does not declare it as thread-safe, from looking at the code in Google, it seems that I could get the result I ...

16. Thread deadlock in J2EE application    stackoverflow.com

I am a newbie to J2EE. I wonder if there are some common deadlock cases in J2EE application layer, resulting from using Java synchronization primitive - synchronized keyword. If yes, could ...





17. Thread Local recommendations in heavy back-end mid-tier server application    stackoverflow.com

Is it recommended to use ThreadLocal to store a Thread Context? I am building a backend server application where there are typical services that I need to run. Note: We are not building ...

18. Hung Threads java.lang.ClassLoader.findBootstrapClass    stackoverflow.com

My J2EE application is performing slow. We took the Thead Dumps during that situation and found that following thread was Runnable in multiple dumps and has taken locks on some monitors ...

19. JavaEE: build and flush response in threads    stackoverflow.com

I am trying to write a threaded Java EE servlet.
Each thread will do some processing and write its results in a single HTTP chunk (using HTTP Transfer-encoding: chunked).
Each chunk will be ...

20. How to configure apache http client v3.0 for web application (multithreading)    stackoverflow.com

I use apache http client (version 3.0 because we have java 1.4 and cannot change it) in web application. I have component (class) that is used for POST requests to the ...

21. Catch Exception out side the Thread    stackoverflow.com

I need to catch exception out side the Thread which is occurred while Thread is running.
I have tried to throw new exception but though it shows me error that "unreported ...

22. DWR: Using reverse ajax from a non web thread?    stackoverflow.com

I'm using DWR and want to send an update to the web interface using reverse ajax. I get it to work when the call comes from the web interface using this ...

23. Long living threads in J2ee    stackoverflow.com

I need to code a Java system with these characteristics. -When the system starts up, it needs to create some objects that need to live forever while the system is running. ...

24. Draw on Screen From A thread    stackoverflow.com

Need to be able to draw on the screen from a thread other than main. Cannot use UIkit since it's not thread safe. Would Quartz 2D work in a ...

25. What does "Lock released while waiting:" mean in a Java thread dump?    stackoverflow.com

In this thread dump:

INFO   | jvm 3    | 2011/06/08 13:36:12 | "ExecuteThread: '38' for queue: 'default'" id=55 idx=0x78 tid=5316 prio=5 alive, in native, waiting, daemon
INFO  ...

26. WAS threads are getting hung    stackoverflow.com

I am facing an issue that WAS threads are getting hung. Configurations: OS: AIX, WAS: 6.1.0.31 com.ibm.websphere.threadmonitor.interval: 180 seconds com.ibm.websphere.threadmonitor.threshold: 10 minutes com.ibm.websphere.threadmonitor.false.alarm.threshold: 100 Above settings are for hung detection. Is there any way that I can ...

27. Java threads problem    stackoverflow.com

After last update (I can't find nothing criminal in it) my appication starts hang on after 1-2 hours of work. I profiled my app: everything was ok, but after some time ...

28. How to handle long worker threads in enterprise environments    stackoverflow.com

Colleague of mine contacted me asking if it is possible to stop HTTP workers if the request takes to long. I have to admit, I found the question quite odd, and ...

29. Getting thread from Container?    stackoverflow.com

On most of applications servers, J2EE Ejb specification forbids creating threads "by hand", since these resources should be managed by the server. But is there any way to get threads from ...

30. java one thread slow    stackoverflow.com

I have a J2EE java application which processes SOAP requests. In our production environment (HPUX,OC4J,Java 5) we have about 20 threads running for this process, and we sometimes see 1 ...

31. Thread.sleep Issues in Web Browser    stackoverflow.com

Basically, I have written a JApplet and I now need to set a constant frame rate. I implemented a very simple segment of code that calls Thread.sleep:

long sleep = (long) (20e6 ...

32. Why Threads, Sockets are not allowed within a j2ee component?    stackoverflow.com

Possible Duplicate:
Why spawning threads in J2EE container is discouraged?
While reading a java specification document, came across the following statement "In this version of the ...

33. multiple threads spawning in my Java application    stackoverflow.com

The Java application that we have implemented for our customer creates up to 5-6 threads per phone call (when people call in to a customer care line). The problem here is ...

34. How get objects from a server thread that is running?    stackoverflow.com

I have this structure in my program:

class Node0
  private Server server;
  ...
  public void init(){
      server.waitConnections();
  ...

class Server
  socket = ss.accept(); ...

35. Not all java threads start    stackoverflow.com

I have huge amount of records in oracle database that some operations souhld be done for them. The application gets 4 parameters as input. They are "Range from", "Range to", "Thread counts" ...

36. How to stop an infinite thread in an application server    stackoverflow.com

i have a JSF web application deployed under glassfish in which i have two buttons.The first start a infinite thread and the second stop it.My problem is that i can not ...

37. How to avoid concurrency exceptions when creating an XML-RPC service that needs to share global data across threads    stackoverflow.com

I'm creating an XML-RPC server in Java using the Redstone XML-RPC library. The server is responsible for kicking off commands on the system and then shooting back the response. ...

38. Full-duplex server socket implementaion, seperate read and write thread?    stackoverflow.com

I want to read and write(randomly from server to client) on same server socket (java application). My client to server write and read work fine in a loop. At server with ...

39. Background threads    stackoverflow.com

I am using Websphere Application Server to create a typical web application where UI is JSPs, there is a Controller and a session EJB and a Database. I implemented a notification ...

40. How i can read a file using multithreading    stackoverflow.com

I have a zipped CSV file. I have some quartz job schedular which reads the file. But sometimes the user can click and read the file also. Is it possible that if ...

41. Testing J2EE application for 1000 threads(users)    jmeter.512774.n5.nabble.com

Hi, I am using jmeter version 2.1.1 to test my J2ee (jdk 1.5.02) application. I want to know that does Jmeter support testing for 1000 Threads (Users)? In my J2EE application there are five screens. In first screen I am setting some values in session variable and these values retrieving on 3rd, 4'Th and 5'Th screen. When I test ...

42. j2ee question really    coderanch.com

43. Threads and connection pool    coderanch.com

hi all: According to my understanding of Threads and Connection pool, I have this theory, which I don't know if it is correct or not. Assuming a single proccessor machine, only one thread can be excuted at a time. Threads alternate, but only one thread can be excuted at one time. For simplicity, consider a web application with one servlet. Inside ...

44. typical threading issues in a j2ee application    coderanch.com

Originally posted by Ali Pope: Currently in a J2EE solution you would not bother to do threading management - and let the container provide this for you. ./pope Thats exactly i was referring to. The fact that we are discouraged by specs to use threads eliminates many threading related issues faced. The app server takes on the resposiblity of creating a ...

45. Thread safe J2ee applcaition    coderanch.com

I went thr that chapter the book says Whats happening in our examples with atomic variables is that there is no free lunch: the code avoids synchronization, but it pays a potential penalty in the amount of work it performs. You can think of this as optimistic synchronization (to modify a term from database management): the code grabs the value of ...

46. Curious to know how thread pooling works in j2ee    coderanch.com

Iam curious to know how thread pooling works in j2ee and in general. I have a Logger utitlity, that extracts the current logger context by using the thread id. This allows utility classes to log, without having to pass them any Logger objects. When I was testing this on a MDB, I discovered that a pooled MDB instance, can be associated ...

47. Usage of Threads in Web applications    coderanch.com

It looks like you're following safe practices well. Unless the delegate could give the same Book instance to two servlets at the same time, which is probably not the case. The container uses threads like crazy, but application developers rarely do in servlets. You'll see conversations here about running a thread that does some action periodically, like an hourly database update ...

48. Running multi-threaded java program from WebApplication    coderanch.com

Hi Friends, I have a multi-threaded java program which I have developed using java.util.concurrent.ThreadPoolExecutor (Lets say class A). There is one more class which implements the Runnable (Lets say class B). Class A checks for the records in the DataBase and if records found then it creates an object of Class B and assigns one row data of records to class ...

50. Threads in web container/web application    coderanch.com

Good day to all, I am a junior developer for a financial institution. Recently, I have been asked to create an add-on module to an exsisting web application. This module's purpose would be to check information in a database at regular intervals. The module would verify the information and verify if the information has expired (there is an expiry date field). ...

51. Undeploying web application does not stop the running process    coderanch.com

Hello Everyone, Could you please help me in figuring out the following problem. "I am running a web application, which will constantly monitor a ftp folder and whenever a new file comes on that folder, the application will download it. I have scheduled a thread to run every 15 mins to do this task. The problem, when I undeploy my web ...

52. Thread in JEE    coderanch.com

I developed a JEE application,in spring and hibernate .All my business logic are simple POJO.While I design I never worried about Mutlthreading.I deployed my application in Tomcat. As per my understanding servlet are multithreaded so many request comes to access the same servlet then it will be mutithreaded. In my application , to get a value from database 3 objects in ...

53. JEE and Threading    coderanch.com

Long time reader and first time poster... Certified Prog, Dev and Arch Pt I. The query is as follows --> Running within a JBoss 4x AS a MDB receives a message that is delegated for processing to other peer Session:Stateless EJB(s). According to the specification the participation of a Thread within a synch call through this environment will be unpredictable therefore, ...

54. Freeing resources (threads) in web app    coderanch.com

Hi, I have a web application which runs several threads. These threads are initialized in a class which is instantiated by a servlet and then put into servlet session when a user logs on the system. When the user logs out I want to stop these threads. I can do this by getting the class instance from the session and calling ...

55. Web Application w/ Massive Users, need Threads?    coderanch.com

Of course you have to use mulitple threads to manage the concurrency... but one important point can be seen in the article below... Many internet browsers allocate a thread for each applet on a page, using that thread for all calls to the applet's major methods. Some browsers allocate multiple threads or a thread group for each applet. Multiple threads share ...

56. Threading Issues and Web applications    coderanch.com

1)Session Object handling. ** Remember that although a given session is tied to a browser by the unique ID, the browser may make multiple requests "at the same time" so you can NOT rely on thread-safe handling of session objects. 2)Database handling. ** Use a DB connection pool, don't keep DB connections as session objects or instance objects. 3)Using non synchronized ...

58. Thread clean up in Web application    coderanch.com

We have a web application that we like to occasionally restart without restarting the whole application server. This application creates a thread to handle some processing. Is there a good way to stop this thread when stopping the application? I was thinking of maybe using a ServletContextListener to aid in stopping the thread. I would just call something like this done() ...

59. Concurrency with Application scope (Web App) objects    coderanch.com

I have a situation where all users need (only read, no write) to have access to the same information. My solution is to add the needed info to a bean and stuff it into the application scope, this way I don't need to stuff the bean into each request or session. However I also need to refresh this information at regular ...

60. Possible threading problem in web application    coderanch.com

Hi, so far I was lucky enough not to encounter threading problems, now I got hit with a broad sword. I try to fix a bug in a web application that makes usage of a third-party library for opening database connections. These connections come from a container-supplied connection pool, the connections are supposed to be closed at the end of their ...

61. Webapps thread basic questions    coderanch.com

I thank you very much for the patience and your time to answer the basic questions I have regarding the threads in web applications.. Please let me know if you need any more information to clarify my doubts. 1.) Based on my knowledge each http request creates its own thread. Is that correct? 2) Do we say a web application is ...

62. J2EE and threads    coderanch.com

63. Threads in Web/Application Server    coderanch.com

Hi William, Sounds like a great way to create mysterious bugs and unexplained freeze-ups. . I was under the intention that only improper termination and resource lock ups in threads should be prime reasons not to create threads in web/application servers. Is there something that is really awful about creating threads? because as far I have browsed the forum sites, I ...

64. Creating Threads in a Web Based Application    coderanch.com

Hi Experts say that creating Threads in a web based Application is not at all good , as its the responsibility of the Container to manage all this stuff. But please tell me what if my requirement is such that i need to make the current Thread sleep for some seconds . Thanks in advance.

65. Howto use global a map in a web application?    coderanch.com

Hi, I want to create a simple cache, for holding lots of user data objects. From time to time all data is being discarded and again being populated by a single update thread. Also single entries can be update, modified, inserted by (LDAP) notification events. The map is being read by many threads. Some threads only look up single entries while ...

66. Are static methods thread safe in a web app?    coderanch.com

Hello, Static methods would be accessing static data and static data is shared across all the instances of that class. Shared data is never thread-safe. From thread safety perspective it depends on how you are modifying and accessing that data. If you have only read-only operation on that shared data (e.g. getXXX) then you will not run into threading issues for ...

67. Parallelism/ExecutorService in J2EE environment    coderanch.com

I have to develop one process that will process fast. Below is my requirement and my thoughts This process executes 10 different queries. To have the performance better I will create ThreadPool using ExecutorService executorService = Executors.newFixedThreadPool(10); assign independent queries as task and attach with ExecutorService. Then submit the task. I will do it within a stateless session bean. Please let ...

68. Thread and Web Applications    coderanch.com

69. I am having a compile tile error. please help.Exception in thread "main" java.lang.Ar    java-forums.org

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package londondm2; import java.util.*; import java.io.*; /** * * @author NicholiL */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { String[] names = {"Elena", "Demetris", "Katarina", "Phil", "Matteo", "Alexis", "Emmauel", "Amir", ...

70. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j    forums.oracle.com

It looks like you have it close to what you want, but may have been tripped up by the relative paths required. As you state, you either specify the classpath entries on the command line when running the application with the Java launcher or you can use the Class-Path entry in the Manifest to specify a classpath for an executable JAR. ...

71. Threading in JEE    forums.oracle.com

If your application server (read the documentation) doesn't provide a threadpool for you, you can always bind your own to jndi and use that (if you want to share it amongst all the applications). At least JBoss seems to provide an MBean for threadpools: [http://community.jboss.org/wiki/ConfigBasicThreadPool] Amazing how much you can find from google. Why aren't you using google? It's great for ...