Reloading context through Code

2004-11-30 Thread Satish Plakote
hi
Is is possible to reload the tomcat Context through the Code. 

rgds
Satish

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Synchronization problem in beans with session scope

2004-11-29 Thread Satish Plakote
hi
i am working on a web application.It is basically an interface that was 
developed using jsp/beans . The user can create a file of
the data that is shown in the browser with a unique that is auto generate in 
the code. The File creation part is contained in the
bean which has a session scope.
I have declared  the method as synchronized. When the simultanoues requests 
come two different browsers end up having the same file
name..

How do i make sure that only one object creates a file and others wait for it ?


Rgds
satish


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



servlet instance problem

2004-11-23 Thread Satish Plakote
Hi
I am have a web application that does a lot of processing. I have a load on 
startup servlet that will get init information for me.
when 2 users submit the form.. i noticed that one instance of the servlet is 
running and the other request waits for some time for
processor and just dies off.. Servlets are suppose to be thread safe and 'n' 
number of intances can be created . why only one
instance running  at a given time.. My servlet is not a single instance servlet 
and i have not placed an restrictions of that sort..
can anyone help me with this ??

rgds
satish


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Printing to log files..

2004-11-23 Thread Satish Plakote
Hello Deepak,
i have certain process that are started by tomcat..And the only way for me to 
know that the process is going on is to put
system.out.print(),but then this also prints on my log files, is there any way 
other than this to print only on screen and not to
the log files ..?

rgds
satish


-Original Message-
From: deepak shripat mane [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 24, 2004 9:34 AM
To: Tomcat Users List
Subject: Re: Printing to log files..


  
Hello Satish
for printing screen u can used

out.println("")

so u can print value on then screen


Deepak


On Wed, 24 Nov 2004 Satish Plakote wrote :
>Hello,
>I wanted to know how to Print a Statement on Screeen with out being Writtent 
>to TomCat Log Files???
>
>Ex :- Usinf System.out.println will be also writtent to the Log File [Is 
> there any way to prevent this ]
>
>rgds
>satish
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Printing to log files..

2004-11-23 Thread Satish Plakote
Hello,
I wanted to know how to Print a Statement on Screeen with out being Writtent to 
TomCat Log Files???
   
   Ex :- Usinf System.out.println will be also writtent to the Log File [Is 
there any way to prevent this ]

rgds
satish

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problem with simultaneous query submissionS

2004-11-23 Thread Satish Plakote
here is my dopost method


 // Code starts here

   public void doPost(HttpServletRequest req,HttpServletResponse res) 
throws IOException, ServletException
{
System.out.println("Inside doPost");

String  strQueryFlag =req.getParameter("new");

if(Integer.parseInt(strQueryFlag.toString())==NEW_QUERY)
{
   System.out.println("New Search ..."+strQueryString);
   Query query = null;
   session.removeAttribute("BookObjects");
   ArrayList arLstBookDetails = new ArrayList(1);

   try {
 // Code to get data from Database or file
 } catch (Exception e) {
e.printStackTrace();
  }
   try{
   searchlog.println("--Creating  objects--"+" "+session.getId()+" 
"+queryString);
   StringBuffer strDesc  = null;
   StringBuffer strBookID= null;
   StringBuffer strItemName  = null;
   StringBuffer strItemCode  = null;
   StringBuffer strPrice = null;
   StringBuffer strPageID= null;
   StringBuffer strBookName  = null;
   StringBuffer strUrl   = null;
   StringBuffer strImage = null;
   for (// access data one by one from structure )
 {
try{
 // for each element
strDesc  = // get the data and store it
strBookID= // get the data and store it
strItemName  = // get the data and store it
strItemCode  = // get the data and store it
strPrice = // get the data and store it
strPageID= // get the data and store it
strBookName  = // get the data and store it
strUrl   = // get the data and store it
strImage = // get the data and store it
strPageID= // get the data and store it

if(hBookFromLucene.containsKey(strBookID.toString()))
{
BookDetails 
BKDetails=(BookDetails)hBookFromLucene.get(strBookID.toString());

BKDetails.addPageDetails(strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
}
else
{
BookDetails BKDetails= new 
BookDetails(strBookName,strBookID);

BKDetails.addPageDetails(strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
hBookFromLucene.put(strBookID.toString(),BKDetails);
   // adding objects to arraylist
   arLstBookDetails.add(BKDetails);
 }
  // one  more structure to store all objects

m_objallBookDetails.addBook(strBookName,strBookID,strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
}catch(Exception e)
{
System.out.print("SearchDataBean: createBookObjects 
1 "+e.getMessage());
e.printStackTrace();
}
} // end of for
strBookName  =  strBookID  =  strPageID = strPrice = 
strItemName = strDesc = strImage = strUrl = null;
}

searchlog.println("Putting data for session "+session.getId()+" 
"+arLstBookDetails.size());

// These twostructures together can store 10 
data individually in session.
session.setAttribute("BookObjects",arLstBookDetails);
session.setAttribute("AllBookObj",m_objallBookDetails);
searchlog.println(" --- Completed--- "+arLstBookDetails.size());

}catch(Exception e)
{
System.out.println("SeachDataBean:getResultData: ");
e.printStackTrace();
}
}

 // Code ends here



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem with simultaneous query submissions

2004-11-22 Thread Satish Plakote
here is my dopost method


 // Code starts here

   public void doPost(HttpServletRequest req,HttpServletResponse res) 
throws IOException, ServletException
{
System.out.println("Inside doPost");

String  strQueryFlag =req.getParameter("new");

if(Integer.parseInt(strQueryFlag.toString())==NEW_QUERY)
{
   System.out.println("New Search ..."+strQueryString);
   Query query = null;
   session.removeAttribute("BookObjects");
   ArrayList arLstBookDetails = new ArrayList(1);

   try {
 // Code to get data from Database or file
 } catch (Exception e) {
e.printStackTrace();
  }
   try{
   searchlog.println("--Creating  objects--"+" "+session.getId()+" 
"+queryString);
   StringBuffer strDesc  = null;
   StringBuffer strBookID= null;
   StringBuffer strItemName  = null;
   StringBuffer strItemCode  = null;
   StringBuffer strPrice = null;
   StringBuffer strPageID= null;
   StringBuffer strBookName  = null;
   StringBuffer strUrl   = null;
   StringBuffer strImage = null;
   for (// access data one by one from structure )
 {
try{
 // for each element
strDesc  = // get the data and store it
strBookID= // get the data and store it
strItemName  = // get the data and store it
strItemCode  = // get the data and store it
strPrice = // get the data and store it
strPageID= // get the data and store it
strBookName  = // get the data and store it
strUrl   = // get the data and store it
strImage = // get the data and store it
strPageID= // get the data and store it

if(hBookFromLucene.containsKey(strBookID.toString()))
{
BookDetails 
BKDetails=(BookDetails)hBookFromLucene.get(strBookID.toString());

BKDetails.addPageDetails(strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
}
else
{
BookDetails BKDetails= new 
BookDetails(strBookName,strBookID);

BKDetails.addPageDetails(strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
hBookFromLucene.put(strBookID.toString(),BKDetails);
   // adding objects to arraylist
   arLstBookDetails.add(BKDetails);
 }
  // one  more structure to store all objects

m_objallBookDetails.addBook(strBookName,strBookID,strPageID,strPrice,strItemName,strDesc,strItemCode,strImage,strUrl);
}catch(Exception e)
{
System.out.print("SearchDataBean: createBookObjects 
1 "+e.getMessage());
e.printStackTrace();
}
} // end of for
strBookName  =  strBookID  =  strPageID = strPrice = 
strItemName = strDesc = strImage = strUrl = null;
}

searchlog.println("Putting data for session "+session.getId()+" 
"+arLstBookDetails.size());

// These twostructures together can store 10 
data individually in session.
session.setAttribute("BookObjects",arLstBookDetails);
session.setAttribute("AllBookObj",m_objallBookDetails);
searchlog.println(" --- Completed--- "+arLstBookDetails.size());

}catch(Exception e)
{
System.out.println("SeachDataBean:getResultData: ");
e.printStackTrace();
}
}

 // Code ends here

The reason i am storing the data is session is the the user is given a lot of 
filtering options and i don't want to go back to my
data source retrieve data and show.. all the filtering has to be done from 
objects in memory so thatit takes the minimum possible
time.

is the huge amount of  data that i am storing that causes the problem ???

rgds
satish

-Original Message-
From: QM [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 23, 2004 7:36 AM
To: Tomcat Users List
Subject: Re: problem with simultaneous query submissions



Please post a *new* message when writing to the list.  Replying to an
old (unrelated) message conf

problem with simultaneous query submissions

2004-11-22 Thread Satish Plakote

hi,
i am developing a search  engine for my small database.

I have written a servlet that takes the input from user , queries the database 
and creates objects of the information that is
recieved. These objects (approximatley 10 )  are stored in the  ArrayList 
which put in the session.using session.putAttribute()

While testing i noticed that if i open two browsers,with two different session 
ID, if submitted simultaneoulsy , one browser stops
execution. i.e one instance of the servlet stops.. where as the other one 
proceeds fine..This happens for n broswers..
There is no problem with database connection as i have tested it.

My servlet is only extending the HttpServlet.And my arraylist is not a class 
instance variable.each instance of the servlet is
expected to keep its own copy..

I am not able to figure out what is the problem..

Pls help..
rgds
satish


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Too many BackGround Java Threads

2004-11-19 Thread Satish Plakote

Hi,
I am running a web-application on tomcat 5.0 . Using blackDown jdk.1.4.2_06.
After running some user interactions , the tomcat becomes slow..
When i do a check on the back ground threads i see many jvm threads running ..

27288 pts/0S  0:34 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27289 pts/0S  0:01 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27290 pts/0S  0:01 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27291 pts/0S  0:06 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27292 pts/0S  0:00 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27293 pts/0S  0:00 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27294 pts/0S  0:00 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27295 pts/0S  0:00 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27296 pts/0S  0:00 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27297 pts/0S  0:03 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27298 pts/0S  0:18 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -
27302 pts/0S  0:01 /usr/local/j2sdk1.4.2_06/bin/java -Xms700m -Xmx800m 
-XX:+UseConcMarkSweepGC -

restarting tomcat is the only option left.
not able to quite understand where the problem is ??


rgds
Satish

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]