Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!

Ritesh Srivastava

Greenhorn
+ Follow
since Jul 06, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ritesh Srivastava

It is just a selling strategy. I have bought 3 vouchers (at 4500/- each) some time back.
Ok...........I found something related to this.

Execute Queue. We can configure an execute thread. But I could not understand the relationship between the following parameters.

Thread Count -- Threads Minimum -- Threads Maximum.

How are they related? If Threads Increase default value is 0 then what is the importance of Threads Minimum and Threads Maximum?
13 years ago
Web applications can be deployed in exploded format. And your structure seems all right to me.

Sometimes by putting the source in applications folder is not enough. you have to deploy using Weblogic Admin console.

you can do this by going to url http://localhost:7001/console
Then go to mydomain -> Deployments -> Web Application Modules on the left pane. And then deploy your PMO folder there in applications folder.

Hope this helps.
13 years ago
Hi,

In Tomcat we can specify the attributes of Connector in conf/server.xml like maxThreads, minSpareThreads,maxSpareThreads to control the Thread Pool.

How we can do this in Weblogic?
13 years ago
Hi,

I have created a jar file which is going to use a propeties file.
The jar file is placed in C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\myApplication\WEB-INF\lib

There is a class in the jar which is trying to load the properties file and then access its values.

I have put the properties file in WEB-INF\classes as well as the root of the folder which is later converted to a jar.

How can I load the properties file? I tried different ways like using Thread.currentThread().getContextClassLoader().getResourceAsStream and some other wasy.

Thanks,
Ritesh
13 years ago
Hi,

I am trying to run the comet sample given along with tomcat. The sample is not working correctly most of the time. I am using NIO connectors and Tomcat version is 6.0.10.
I have some doubts also:

1) In the ChatServer example, a thread (using a Runnable MessageSender) is sending responses the clients. Is it possible to write multiple times to the same response. Because when we do writer.flush() then that response is sent to the client.

2) The READ event is never invoked in my example. whenever I send a request only BEGIN event is getting called. I thought, for the first time only BEGIN event should get called, and for further requests by the same client, READ event should get called.

3) I am getting exception at the line where the thread which is trying to write to response stream is calling the flush method.
The code (from tomcat example) is:

for (int i = 0; i < connections.size(); i++) {
try {
PrintWriter writer = connections.get(i).getWriter();
String toBeFlushed = "";
for (int j = 0; j < pendingMessages.length; j++) {
// FIXME: Add HTML filtering
writer.println(pendingMessages[j] + "<br/>");
}
writer.flush();
} catch (IOException e) {
log("IOExeption sending message", e);
}
}

And the error message I am getting is:

Exception in thread "MessageSender[/CometTestApp]" java.lang.NullPointerException
at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:607)
at org.apache.coyote.http11.InternalNioOutputBuffer.commit(InternalNioOutputBuffer.java:600)
at org.apache.coyote.http11.Http11NioProcessor.action(Http11NioProcessor.java:1010)
at org.apache.coyote.Response.action(Response.java:183)
at org.apache.coyote.Response.sendHeaders(Response.java:379)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
at org.apache.catalina.connector.CoyoteWriter.flush(CoyoteWriter.java:95)
at com.headstrong.test.ChatServlet$MessageSender.run(ChatServlet.java:276)
at java.lang.Thread.run(Thread.java:595)
13 years ago
I have a jsp page which is required to send some messages to a servlet. But the user is is not going to get response immediately.
We need to have a system on the web server which will send responses to only those browsers which are connected(logged in) to the server.

This is not a typical request-response model of a web server. The responses which needs to be sent to different users will be stored in a database (an asynchronous system). A separate thread on the server will pick the responses and send it to different users who are logged in.

The problem is, how a server is going to recognize which browsers are connected and what is the protocol through which the server is going to send response?
13 years ago
JSP
class Employee implements Cloneable
{
public Employee clone() throws CloneNotSupportedException
{
return (Employee) super.clone(); // Line 1
}
. . .
}

Here Employee class is extending Object class so when we call super.clone in Line 1 then it should give object of Object class . How come this line does not throws a ClassCastException? How is "downcasting" allowed although super.clone() here will return an object of type Object?
I need to understand Line 1 only.
[ March 22, 2007: Message edited by: Ritesh Srivastava ]
13 years ago
Don't know about Jcron but have used Quartz for scheduling which is very well documented.
Thanks for the reply. Yes I too agree that database should not be doing formatting. But I am still wondering which approach would be faster.
I have a String which needs be sent to a stored procedure. Then this string is inserted in the database through the stored procedure. But the string needs to be formatted (say date formatting).

This formatting can be done either in the java program which later calls the stored procedure or in the stored procedure itself. Which way gives better performance?
Since Error also extends from Throwable, they can be catched........just like exceptions.
Class is loaded before it can be used for creating instance of this class.

Class is loaded only for once. Following are the situations when class will be loaded:
-Class can be loaded programmatically using Class.forName("My ClassName");
-When we say MyClass m = new MyClass(); for the first time.
-When we access static variables or instance for the first time like MyClass.getStaticVar1();

Correct me if I m wrong
Also note compilation fails(at line 4/5) when the value of variables s1 or c1 is changed to 128 even though these variables are declared final.