Why servlet be called many times?
I call servlet in jsp by the following way,
/ReportServlet?reportCode='1234'.
Servlet execute normally at first,but I find it had been called again before first
servlet finished.
I want to know why it be called two times.
Yes,I used two frames in a signle page like this,
<%@page contentType="text/html;charset=gb2312 "%>
<%@page errorPage="/fxclear/common/fx_error.jsp"%>
<%@page session="true" import="cfets_fx2001.clearing.common.record.FxsReport"%>
<html>
<head>
<%
String reportCode = null; //要生成报表的report
code
try{
reportCode = request.getParameter("reportcode").trim();
}catch(NullPointerException e){
throw new Exception("发给jsp查询参数错误");
FxsReport report; //要生成报表的报表信息
String title; //报表标题
String dateFlag = cfets_fx2001.clearing.common.OurReport.getT0ORT1(reportCode);
try{
report = new FxsReport(reportCode);
title = report.reportName.trim();
}catch(Exception e){
title = "报表打印";
%>
<title>外汇资金清算系统--帐务子系统--<%=title%></title>
<script LANGUAGE="JavaScript">
//发生错误时执行
function sendErrMessage(msg)
middle.location.href="/fxclear/common/fx_clear_error.jsp?Message="+msg;
//在要生成pdf文件前执行
//重新在middle frame调用servlet,以获取刚生成的pdf文件
function beginGenFile()
middle.document.write("正在生成您要的文件,这需要一些时间,请稍侯...");
top.document.close();
//当pdf文件生成成功后执行
//重新在middle frame调用servlet,以获取刚生成的pdf文件
function endGenFile()
middle.location.href="/ReportServlet?reportCode=<%=reportCode%>&dateFlag=<%=dateFlag%>¬refresh=Y";
</script>
</head>
<!-- <script LANGUAGE="JavaScript">
self.moveTo(50,50);
</script>
-->
<frameset framespacing="0" border="0" rows="50,101%" frameborder="0">
<frame name="top" scrolling="no" noresize src="commonprinttitle.jsp?reportcode=<%=reportCode%>&dateFlag=<%=dateFlag%>"
>
<frame name="middle" src="/ReportServlet?reportCode=<%=reportCode%>&dateFlag=<%=dateFlag%>"
scrolling="auto" >
<noframes>
<body background="image/fx_cfets.gif" bgproperties="fixed">
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
And I want to use frames,how to sovle it?
Similar Messages
-
Why is the call history time on the printout different than the phone?
Why is the call history time on the printout different than the phone?
How much different is it? A minute or two??
Calls are triggered the minute you hit send, not answered. And the same when ending a call. So if off a minute or two for a call that is why. -
my creative cloud window is blank i have called many times to get ti fixed it works for a week then goes blank i need help
Chuck Palmer what steps have you utilized to resolve the issue previously? You mentioned you were in contact with our support team. Do you have a case number which I can reference to review the notes?
-
Bug: method beginning by "get" are called many times
Hi,
I have created a managed bean, and in this class, I have a method beginning by "get" like getchPasswordRendered.
I trace something with System.out.println in this method, and when I call it to set dynamically a composant property like rendered i have this trace many times.
It's called 2 times to set rendered property to FALSE, 5 times to set it to TRUE.
Can you explain to me why?
Thanks.Since you did not mention which UI technology you are takling about I'll assume faces.
In this case your method get called at different times in the jsf (or adf) life cycle. To investigate this further you can use a PhaseListener and print out a message in each phase and see in which phase your getter is called.
Timo -
Using tiles - servlet filter called multiple times
Hi I have an application in we have 7 filters defined.
Now in a jsp page, I have a loop that inserts a TILE. The loop iterates about 7000 times. Every time the tile insert is called, even my filters are called. So my 7 filters are called 7000 times. Now this makes my page rendering really slow.
setting flush="false" (in the tile insert) does not work
setting buffer="2700k" autoFlush="false" does not work.
I have to use tiles. I cant skip the filters. What do I do? Is there any way I can not call the filter when my tiles are inserted.Hi
Yes,you are right. In iAS6.0 SP4 When multiple requests arrive,and the Servlet's init() method has not returned yet for the first request, the application server calls init()multiple times. This problem is resolved in iAS 6.5.
There is no kregedit magic that will solve this problem.
Right now the workaround is any of the solution you proposed. Or use iAS6.5. I have tested it with fortune.
Please download it and check with your application.
you can find free download at http://developer.iplanet.com/appserver/testdrive/testdrive_65.html
Thanks -
Why asset is blocking many times ?
Hi Experts,
Asset is blocking Many times. Below is the Scenario :
(1) Created Asset - No Problem
(2) ME21N Purchase Order - No problem
(3) ML81N Service Entry Sheet - Blocking the Asset
(4) MIRO - Asset is Blocking
(5) Capitalization - Asset is Blocking.
Please guide me is there any setting for blocking.
How can i remove the blocking Option.
Customer don't want the Blocking Option (many times) .
Thanks in Advance.
Regards,
Veera.Hi
As per your issue
Your getting error while posting any transaction level. On That time only system will through the error because the asset is block in the AS05 for acquisition posting. as per this block system will through error while posting any transaction data
So that is why your not getting error why while creating PO as well as while creating asset
So First go As05 and remove check box for acquisition posting. and ask your user to post the transaction data.
If you want see change for asset you can in the as03 in the environment change document asset
Than the problem will resolve
I hope it will helps you.
Thanks and Regards
asuvamsi -
Why windowClosing is called two times?
Hi,
I'm saving my project in JFrame windowClosing event. But it is called two times...
How to prevent it?
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
saveCurrentProject();
Thanks,
Andr�Thanks, problem solved.
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
saveCurrentProject();
System.exit(0); // <-- new line
Andre -
Validator is called many times
I defined an validator for my inputdate. I use it in a popup window. If I get an error first time it works fine,
but if I close the popup, reopen it and get an error again my validator is called twice. if I repeat this sequence 10 times,
my validator is called 10 times and it prints the error 10 times. Since the validator method is called automatically I have no idea how to solve it.
<af:inputDate binding="#{model.guiEndDate}" label="#{bundle._END_DATE}" value="#{model.endDate}" id="id2" required="true"
validator="#{model.validateInputDate}"/>
public void validateInputDate(javax.faces.context.FacesContext facesContext, UIComponent uIComponent,
Object object) throws Exception {
Date start = (Date)getGuiStartDate().getValue();
RichInputDate inputDate = (RichInputDate)uIComponent;
Date end = (Date)object;
if (start != null && end != null && start.compareTo(end) >= 0) {
inputDate.setValid(false);
throw new Exception("start later than end date");
} else {
inputDate.setValid(true);
Studio Edition Version 11.1.2.0.0Hi,
Call following scripts when you are closing the popups
function clearMsgForComponent(evt){
AdfPage.PAGE.clearAllMessages();
evt.cancel();
<af:commandButton text="Close">
<af:clientListener method="clearMsgForComponent" type="click"/>
</af:commandButton> -
InitMethod() Before Phase method in View calling many times:
Hi Everyone,
i have dragged one table as read only table with single row selection checked.
One Go button is there in the page.
The code in the go button is taking the curretn selecting the current row and printing the values.
The code in the initMethod() is executing the VO.
The issue is when the page loads the initMethod() (Before phase in View) is calling multiple times even after the page loads.
Continuously its calling that method.
How to make it to call it only once when the page loads?
Any suggestions will be really useful.
Thanks.Hi Jabr,
Thanks for ur response.
i dont know that how to do that.
i have written initmethod()(in before phase) for showing the table values(executing VO) before the page loads such that we can see the table with valus when the pae is loaded.
Thanks. -
My iPhone doesn't tell me Who is calling several times and only gives me the number. What can I do to see the owners names?
if you have verizon as your provider
Dial *228 from your iPhone.
When prompted, select option 1.
When complete, you will hear a confirmation message.
Force the Contacts, Messages, and Phone applications to close using the following steps:
Ensure that you have recently opened the Contacts, Messages, and Phone applications.
From the Home screen, double-click the Home button to display the recently used apps.
Tap and hold the icon for the Contacts application until a red minus appears.
Tap the red minus to close the app.
Repeat the previous step for the Messages and Phone applications.
Tap the Home screen to return.
Turn iPhone off and then back on -
Hello Friends,
I am writing a particular code in a user exit of the FM IDOC_INPUT_MATMAS01 , the problem is that the user exit is called some 4 times in the program and my logic gets repeated 4 times . Is there any way to over come this ?
Comradely ,
K.SibiHi Sibi,
You can put a check based on sales/purchasing organization (VKORG) for which IDOCs are processed.
Or, you can put a validation check on
1) partner type & partner number,
2) message type,
3) idoc basic type & extension,
before executing your user exit code.
Also Check the link below:
Creating Idoc filter for MATMAS
Regards,
Nisha Vengal. -
Servlet Filters : how many times a filter get executed for each reques
<p>Hello I am fairly new to ServletFilters and I am experiencing a really annoying problem.</p> <p>I have filter that I want to check every request so if the user enters a uri I will check it and forward them somewhere but if I try to set a condition to check the uri and forward, it stops the filter from processing the rest of the images and they do not show up on the page. It looks like the filter is called for every image I load into memory too</p>here is the code :</p>
<pre>
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest)req;
HttpServletResponse response = (HttpServletResponse)resp;
HttpSession session = request.getSession(true);
boolean flag = true;
RedirectInfo currentRedirect = null;
String uri = request.getRequestURI();
//If it is a first request I let them go to the first page
if(uri.equals("/home.jsp") || uri.equals("/") || uri.equals("/home.do")){
RequestDispatcher rd2 = request.getRequestDispatcher("/home.jsp");
rd2.forward(request, response);
System.out.println("in the first condition all is good");
return;
}else{
//This is to stop the filter from being called twice
if(currentRedirect != null && currentRedirect.equals("null")){
RequestDispatcher rd3 = request.getRequestDispatcher("/home.jsp");
rd3.forward(request, response);
return;
currentRedirect = RedirectManager.searchByRedirect(request.getRequestURI(), taskUid);
if(currentRedirect != null){
//Here we send the client to the requested URI if it exists in the database
RequestDispatcher rd = request.getRequestDispatcher(currentRedirect.getRedirect());
rd.forward(request, response);
//This is to stop the filter from being called twice
currentRedirect.setRedirect("null");
System.out.println("in the redirect condition all is good");
return;
if(currentRedirect == null){
RequestDispatcher rd1 = request.getRequestDispatcher("/home.jsp");
rd1.forward(request, response);
return;
System.out.println("the URI is: "+request.getRequestURI());
chain.doFilter(request, response);
</pre>
<br>
Any help would be great @;)
<br>
Steven Nelson<p>Hello I am fairly new to ServletFilters and I am
experiencing a really annoying problem.</p> <p>I have
filter that I want to check every request so if the
user enters a uri I will check it and forward them
somewhere but if I try to set a condition to check the
uri and forward, it stops the filter from processing
the rest of the images and they do not show up on the
page. It looks like the filter is called for every
image I load into memory toodepends on the where the images resides. if they reside inside an director that the filter is mapped too, then upon every image the filter is called too. For every image inside a html document an new request is formed. -
A function in a subquery is call too many times.
Dear all,
I'm struggling to understand why a function in a subquery is called too many times.
Let me explain with an example:
create or replace function all_emp (v_deptno in number)
return varchar2
as
v_all_emp varchar2(2000);
begin
dbms_output.put_line ('function called');
for i in (select * from emp where deptno = v_deptno) loop
v_all_emp := v_all_emp || i.ename || '; ';
end loop;
return v_all_emp;
end;
-- running just the subquery, calls the function all_emp only 4 times (once for each row in table dept)
select
d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
from dept d;
-- running the whole query, using regexp to split the value of f_all_emp into separate fields, causes that function all_emp is called 28 times, thus 6 times for each row!!
select tmp.*,
regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
regexp_substr(f_all_emp,'[^;]*',1,11) emp6
from
(select
d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
from dept d) tmp
;I don't understand why Oracle is calling my function 28 times in this example, 4 times should be sufficient.
Is there a way to force that the subquery is materialized first?
Little background:
Above function / query is of course a simple example.
Actually I have pretty complex function, embedding in a subquery.
The subquery is already slow (2 min to run), but when I want to split the result of the funciton in multiple (approx 20) fields it's over an hour due to above described behaviour.Optimizer merges in-line view and query results in:
select d.deptno,
d.dname,
all_emp(d.deptno) f_all_emp
regexp_substr(all_emp(d.deptno),'[^;]*',1,1) emp1,
regexp_substr(all_emp(d.deptno),'[^;]*',1,3) emp2,
regexp_substr(all_emp(d.deptno),'[^;]*',1,5) emp3,
regexp_substr(all_emp(d.deptno),'[^;]*',1,7) emp4,
regexp_substr(all_emp(d.deptno),'[^;]*',1,9) emp5,
regexp_substr(all_emp(d.deptno),'[^;]*',1,11) emp6
from dept d
/That's why function is called 28 times. We can see it from explain plan:
SQL> explain plan for
2 select tmp.*,
3 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
4 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
5 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
6 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
7 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
8 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
9 from (
10 select d.deptno,
11 d.dname,
12 all_emp(d.deptno) f_all_emp
13 from dept d
14 ) tmp
15 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 3383998547
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 52 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| DEPT | 4 | 52 | 3 (0)| 00:00:01 |
8 rows selected.
SQL> If we use NO_MERGE hint:
SQL> select /*+ NO_MERGE(tmp) */
2 tmp.*,
3 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
4 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
5 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
6 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
7 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
8 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
9 from (
10 select d.deptno,
11 d.dname,
12 all_emp(d.deptno) f_all_emp
13 from dept d
14 ) tmp
15 /
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
10 ACCOUNTING CLARK; KIN CLARK KING MILLER
G; MILLER;
20 RESEARCH SMITH; JON SMITH JONES SCOTT ADAMS FORD
ES; SCOTT;
ADAMS; FO
RD;
30 SALES ALLEN; WAR ALLEN WARD MARTIN BLAKE TURNER JAMES
D; MARTIN;
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
BLAKE; TU
RNER; JAME
S;
40 OPERATIONS
function called
function called
function called
function called
function called
function called
SQL> explain plan for
2 select /*+ NO_MERGE(tmp) */
3 tmp.*,
4 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
5 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
6 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
7 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
8 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
9 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
10 from (
11 select d.deptno,
12 d.dname,
13 all_emp(d.deptno) f_all_emp
14 from dept d
15 ) tmp
16 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 2317111044
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 8096 | 3 (0)| 00:00:01 |
| 1 | VIEW | | 4 | 8096 | 3 (0)| 00:00:01 |
| 2 | TABLE ACCESS FULL| DEPT | 4 | 52 | 3 (0)| 00:00:01 |
9 rows selected.
SQL> Not sure why function is executed 6 and not 4 times. What we actually want is to materialize in-line view:
SQL> with tmp as (
2 select /*+ materialize */
3 d.deptno,
4 d.dname,
5 all_emp(d.deptno) f_all_emp
6 from dept d
7 )
8 select tmp.*,
9 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
10 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
11 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
12 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
13 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
14 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
15 from tmp
16 /
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
10 ACCOUNTING CLARK; KIN CLARK KING MILLER
G; MILLER;
20 RESEARCH SMITH; JON SMITH JONES SCOTT ADAMS FORD
ES; SCOTT;
ADAMS; FO
RD;
30 SALES ALLEN; WAR ALLEN WARD MARTIN BLAKE TURNER JAMES
D; MARTIN;
DEPTNO DNAME F_ALL_EMP EMP1 EMP2 EMP3 EMP4 EMP5 EMP6
BLAKE; TU
RNER; JAME
S;
40 OPERATIONS
function called
function called
function called
function called
SQL> explain plan for
2 with tmp as (
3 select /*+ materialize */
4 d.deptno,
5 d.dname,
6 all_emp(d.deptno) f_all_emp
7 from dept d
8 )
9 select tmp.*,
10 regexp_substr(f_all_emp,'[^;]*',1,1) emp1,
11 regexp_substr(f_all_emp,'[^;]*',1,3) emp2,
12 regexp_substr(f_all_emp,'[^;]*',1,5) emp3,
13 regexp_substr(f_all_emp,'[^;]*',1,7) emp4,
14 regexp_substr(f_all_emp,'[^;]*',1,9) emp5,
15 regexp_substr(f_all_emp,'[^;]*',1,11) emp6
16 from tmp
17 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 634594723
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 8096 | 5 (0)| 00:00:01 |
| 1 | TEMP TABLE TRANSFORMATION | | | | | |
| 2 | LOAD AS SELECT | | | | | |
| 3 | TABLE ACCESS FULL | DEPT | 4 | 52 | 3 (0)| 00:00:01 |
| 4 | VIEW | | 4 | 8096 | 2 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6603_20255AE | 4 | 52 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
12 rows selected.
SQL> However, hint MATERIALIZE is an undocumented hint.
SY. -
Problem adding listners(getting called multiple times)??
Hi
I got a small doubt,
If I have two radio buttons, if I implement item listeners on that two radio buttons ,
Depending on the value I get from the database I set it to be selected , but the question is why is the item listener called many times when I write
This code is written in one item listener --universal radio button.
Universalbtn.addItemListener(new ItemListener()
Public itemStateChange(){
//Some processing from the database
if(type=�P�)
Partialbtn.setSelected(true);
Else if (type=�S�)
Sparebtn.setSelected(true);
)Here�s the exact code �
objUniversalRadBtn.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent iE) {
arrStoreFamilyList=new ArrayList();
ArrayList arrResults=null;
arrStoreFamilyList.add(FLAG_RADIO_BTN);
try {
//calling the service, to store the values selected or entered in UI.
arrResults=(ArrayList)objController.doAction
("admininvmgmnt.service", arrStoreFamilyList);
catch(EnPVException enPV) {
logger.error("exception"+enPV);
if(arrResults.get(0).equals(BOOLEAN_VALUE)) {
objMessageUI=new MessageUI();
objMessageUI.infoMessage(INVENTORY_CYCLE_INPROGRESS);
if(strInvType.equals(INVENTORYTYPE_PARTIAL)) {
objPartialRadBtn.setSelected(true);
}else {
objSpareRadBtn.setSelected(true);
}else {
objAddedFamilyList.setEnabled(false);
objFamilyName.setEnabled(false);
objFamilyTxt.setEnabled(false);
objAddBtn.setEnabled(false);
objRemoveBtn.setEnabled(false);
objInvMgmtUI=null;
objSpareRadBtn.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent iE) {
arrStoreFamilyList=new ArrayList();
ArrayList arrResults=null;
arrStoreFamilyList.add(FLAG_RADIO_BTN);
try {
//calling the service, to store the values selected or entered in UI.
arrResults=(ArrayList)objController.doAction
("admininvmgmnt.service", arrStoreFamilyList);
catch(EnPVException enPV) {
logger.error("exception"+enPV);
if(arrResults.get(0).equals(BOOLEAN_VALUE)) {
objMessageUI=new MessageUI();
objMessageUI.infoMessage(INVENTORY_CYCLE_INPROGRESS);
System.out.println(strInvType);
if(strInvType.equals(INVENTORYTYPE_UNIVERSAL)) {
bFlag=false;
objUniversalRadBtn.setSelected(true);
}else if(strInvType.equals(INVENTORYTYPE_PARTIAL)) {
objPartialRadBtn.setSelected(true);
}else {
objAddedFamilyList.setEnabled(false);
objFamilyName.setEnabled(false);
objFamilyTxt.setEnabled(false);
objAddBtn.setEnabled(false);
objRemoveBtn.setEnabled(false);
objInvMgmtUI=null;
});Pls kindly , let me know why is this happening , as I had overcomed this problem many times and I changed my code when this happened with the textfields in some cases � (when I wrote focuslost events on textboxes , the same case happened �calling the other listener many times and then the cursor got focused in the textfield)
thnx & regards
NeelInside the Method itemStateChanged() dont use
objPartialRadBtn.setSelected() or objSpareRadBtn.setSelected()
If you still want to use then do
objPartialRadBtn.removeItemListener(...);
objPartialRadBtn.setSelected();
objPartialRadBtn.addItemListener(...); -
How many times can i call the start()
Hi All:
I would like to know how many time you can actually call the start(),
cuz my app is doing some really strange things,
here is a fragament of my code:
private void spawnThreads()
ListIterator it = _vWorker.listIterator();
while ( it.hasNext() ) {
ClientWorker client_worker = (ClientWorker) it.next();
client_worker.start();
ClientWorker is another Thread, and in the run() of the ClientWorker, I have
public void run() {
Runtime rt = Runtime.getRuntime();
try {
// Start the timer
Process child = rt.exec(_fileName);
// gobble any error or output streams
StreamGobbler errorGobbler = new
StreamGobbler(child.getErrorStream(), "ERROR");
StreamGobbler outputGobbler = new
StreamGobbler(child.getInputStream(), "OUTPUT");
errorGobbler.start();
outputGobbler.start();
child.waitFor();
} catch (IOException e) {
System.err.println("IOException starting process!");
} catch (InterruptedException e) {
System.err.println("Interrupted waiting for process!");
I have a couple of cmd files to execute, so This spawnThreads() will be called a couple of times,and the funny thing is , it will execute the first cmd files, and that is it, it won't execute the 2nd or the 3rd cmd files, it will start the thread, but then the run()won't actually gets invoked,,,so I am just wondering if anyone of you has encountered this problem, perhaps you could lend me some insight on this?
thanks,Yes, you can run the start() of a Thread more than once,
here is my Test App,
public static void main(String[] args) throws Exception {
Vector vec = new Vector();
for (int i=0;i<4;i++){
ClientThread ct = new ClientThread();
vec.add(ct);
ListIterator it = vec.listIterator();
while(it.hasNext()){
ClientThread ct = (ClientThread)it.next();
ct.start();
and as you have already guessed it the run() of ClientThread simply does system.out.println()
and here is the output
run started
run started
run started
run started
so..yeah..I don't really have any idea what is happening to my app and why it is not executing any cmd files after executing the very first cmd file
Maybe you are looking for
-
Help convince boss to upgrade from CS3 to CS5
I could use some help or ideas to help me convince the bosses that we should really upgrade to CS5. There would be at least 6 of us and that would be a chunk of change but I think it is needed. We would like to show our customers that we are knowledg
-
I've been asked how to set metadata on images with MacOS. The particular data that needs to be set is the author, title and subject; alas, there are at least three places this information can be set in an image - EXIF, XMP and IPTC all have these (or
-
Even when I type the exact name of the app, App Store can't find apps I know worked very recently. Example: Shoeboxed Business Card Reader If you search it in App Store you get absolutely no response. It's a product. They have a link to it on their w
-
Ok, I have all my music on an external hard drive, and a brand new version of itunes that is completely blank. I'm trying to transfer the music from my external hard drive into Itunes but am having trouble. I've gone to file - add to library - and th
-
Query for a simple caching mechanism
Suppose that I have a CONTRACT table with 50000 records. I want to get the last inserted 100 records and then the next 100 and so on... In other words, like using a file pointer I want to get the next n records and then the next n records... Because