Unable to start Tomcat using runtime class in windows 98
hi,
I am using a runtime class which calls a batch file, that calls statup.bat for starting tomcat.
This works perfectly in windows NT,2k. But on win 98, the tomcat window opens and closes within no sometime.
In my class i call the first batch file starter.bat using
Runtime.getRuntime().exec("%COMSPEC% /c start e:/starter.bat");
(I tried with command.com also...)
Starter.bat has the line
call E:\jakarta-tomcat4.1\bin\startup.bat.
Is there anyother way to start the tomcat process and keep it running on windows 98. Anyone with anyclues pls help.
Thanks in advance.
This is the Runtime class i am using... Sometimes tomcat gets closed and sometimes just hangs... (putting it in for better understanding..)
public class Starter {
public static void main(String[] args) {
String com = "%COMSPEC% /c start
C:\\PACS\\SFAApp\\tomcat\\startup.bat";
try {
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec (com);//Starting tomcat
try
pr.waitFor();
catch (Exception e)
e.printStackTrace();
catch (IOException ie) {
System.out.println("IOException caught" + ie);
ie.printStackTrace();
Similar Messages
-
Executing a command using Runtime Class
How to execute a command on a differnet machine with different ipaddress using Runtime Class
My code is
String[] cmd = new String[3];
cmd[0] = "192.1...../c:/WINNT/system32/cmd.exe" ;
cmd[1] = "/C" ;
cmd[2] = args[0];
Runtime rt = Runtime.getRuntime();
System.out.println("Execing " + cmd[0] + " " + cmd[1]
+ " " + cmd[2]);
Process proc = rt.exec(cmd);
// any error???
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
This is not WorkingI have same issue. Actually when I use cmd.exe /c set in java code and if I run the java code in DOS propmt, it retrieves all latest user Environment variable values. But if I run the code in windows batch file, it is not retrieveing the latest user environment values until I reboot my computer, Do you know how to get user environment value with out rebooting machine??????
-
FTP using Runtime class ...Please Help ??
Hi,
I am trying to ftp a file programatically.
I am trying to use Runtime class but facing problems
in it.This is what I am trying to do :
Runtime rr = Runtime.getRuntime();
String[] cmds = new String[2];
cmds[0]="username=rahmed";
cmds[1]="password=prpas";
try{
Process p = rr.exec("ftp 192.168.1.18",cmds);
rr.exec("put vv.txt");
This does not work ??
Is there any way to make it work ? Or is there any
other way to ftp a file programatically ??
Thanks in adavance..
Regards
RaisUnder Linux/Unix at least, it is good to use the switches -n and -i with the ftp client acually meant for intercative usage.
-i Turns off interactive prompting during multiple file transfers.
-n Restrains ftp from attempting ``auto-login'' upon initial connection.
I do "user <myuser> <mypassword>" then from the script.
I am happily using ftp this way from shell-scripts in my projects.
scp is however better than ftp: it does not send plain text passwords over the net, it support key-based login, its encrypts the data. -
Execute an external program using Runtime class
How to execute an external java program using Runtime class?
I have used ,
Process p=Runtime.getRuntime().exec("c:/j2sdk1.4.0/bin/helloworld.java ");
But it throws a runtime IOException error:2 or error:123.
Help me with the code. Thanks in advance.Create Runtime Object and attach to system process.Try this code
import java.io.*;
public class ExecuteExternalApp {
public static void main(String args[]) {
try {
Runtime rt = Runtime.getRuntime();
//Process pr = rt.exec("cmd /c dir");
Process pr = rt.exec("c:\\ yamessenger.exe"); //give a valid exe file
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String val=null;
while((val=input.readLine()) != null) {
System.out.println(val);
int exit = pr.waitFor();
System.out.println("Exited with error code "+exit);
} catch(Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}Edited by: anishtomas on Feb 3, 2009 9:34 PM
Edited by: anishtomas on Feb 3, 2009 9:37 PM -
Starting Tomcat using jsvc and jpda
This is mostly just a message for anyone else looking for an answer to how to start Tomcat as a daemon with webapp remote debugging enabled.
There is a real lack of information on how jsvc works when starting Tomcat under *nix. I'm using Solaris 10, but this should be very similar on most Linux systems.
There is a simple shell script called tomcat in /etc/init.d that starts the cat as a daemon. The change needed to use remote debugging from Eclipse is to enable jpda. This is done by setting the CATALINA_OPTS to include the jpda settings.
Here's the modified line in the script:
CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000" If it worked you will see a line like "Listening for transport dt_socket at address: 8000" in your catalina.out. And now Eclipse can do remote debugging on port 8000.
If you use the catalina.sh script to start the cat all you need is
./catalina.sh jpda startsince it defaults to these settings, that's where I found them.
And of course there are dukes for suggestions.You can look at this URL
http://www.java-tips.org/content/view/119/40/
Response Code 404 is recieved when the path of servlet is not correct.
Servlet classes needs to be placed in right directroy under tomcat server.
URL typed in browser for accessing web applciation should be correct.
Below URL explains the Runtime.exec method
http://www.java-tips.org/content/view/120/40/ -
Hi,
i would like to run a an external java program from within another java program,
here is the structure of my called parogram
c:/temp/jetty
/lib/*.jar
start.jar
my caller program have to invoke the start.jar, but this jar uses the lib folder
so my code construct a java command with the -cp options giving all the jar, and finally use th runtime class to call start.jar
here is the code :
String command = "java -cp D:/temp/jetty/lib/jetty-6.1.0.jar;D:/temp/jetty/lib/etc/another.jar -jar D:/temp/jetty/lib/jetty-6.1.0/start.jar"
Runtime runtime = Runtime.getRuntime();
runtime.exec(command);
it doesnt work, (classnot found error!!!) evenif i include in the cp option all the jar,
my question is how to force the runtime to start the execution at c:/temp/jetty ??
can anyone helpTry this for ideas
package testing;
import java.io.IOException;
public class Test
public static void main(String[] args) throws IOException
Runtime.getRuntime().exec("java -jar AnotherJar.jar");
}and
package testing;
import javax.swing.JOptionPane;
public class Another
public static void main(String[] args)
JOptionPane.showMessageDialog(null, "Another .jar running", "Blaa blaa", JOptionPane.INFORMATION_MESSAGE);
}Then compile both, create manifests for both, create the jars (name the .jar corresponding to class Another as AnotherJar.jar), put the jars in the same directory and run the .jar that corrsponds to class Test.
edit
And obviously, in your case, you need to add the line
Class-Path: lib/*.jar
to the manifest of the program that needs the jar in directory lib.
Message was edited by:
duckbill -
Hi,
I am using windows xp with jdk 1.3 installed on it. I have downloaded tomcat "jakarta-tomcat-3.3.2.zip" and set all the invironment variable CALALINA_HOME , JAVA_HOME and CLASSPATH. But when i start tomcat it gives me the error like below:
=================================================
2006-02-07 17:23:42 - AutoDeploy: Expanding C:\Tomcat3\webapps\admin.war
2006-02-07 17:23:43 - AutoDeploy: Expanding C:\Tomcat3\webapps\examples.war
2006-02-07 17:23:44 - AutoDeploy: Expanding C:\Tomcat3\webapps\ROOT.war
ERROR reading C:\Tomcat3\conf\server.xml
At Line 241 /Server/ContextManager/CoyoteConnector/ port=8080 maxThreads=150 min
SpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 c
onnectionTimeout=20000 disableUploadTimeout=true
sun.misc.InvalidJarIndexException: Invalid index!
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:594)
at sun.misc.URLClassPath.getResource(URLClassPath.java:134)
at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:553)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at org.apache.tomcat.util.xml.ObjectCreate.start(XmlMapper.java:795)
at org.apache.tomcat.util.xml.XmlMapper.matchStart(XmlMapper.java:516)
at org.apache.tomcat.util.xml.XmlMapper.startElement(XmlMapper.java:114)
=================================================
Please suggest what should i do. I cant upgrade JDK because some other application uses 1.3 those are not compatible with higher versions.
Regards.i have tomcat cat and jdk is installed at my computer and path and home is set let me show youenvrionment variables are->
class path c: \tomcat\tomcat_1\common\lib\servlet-api
include :c:\program files\java\jdk1.5.0_07. but for the execution i go to
console i came to catalina home directory like
c\toamcat\tomcat_1\bin>startup.bat
but gives error like the system cannot the find spatch specified. so anyone help me in fixing this out -
BCP data into a file using Runtime class
Hi,
I have a problem in using the Runtime class.
I am trying to bcp a table's data into a file.I am working on a Unix environment.
My bcp is not getting completed fully.The total records to be bcped is 1 million,but only one lakh records is getting bcped and then it hangs up..But if i issue the bcp command from my telnet session it is bcping it to the file without any problem.Can anyone help me out on how to overcome this..
Is there anything specific with Runtime class..I am pasting the code that i tried out below.
String l_s_bcpQuery="bcp mubstage.dbo.HousingUnitSampleMarket out /dun/d3nmb0/mariaps/subracheckprototype -c -t~ -Umariaps -Prykwz5ba -SD3NMB_MUB";
try{
Runtime time=Runtime.getRuntime();
Process p=time.exec(l_s_bcpQuery);
p.waitFor();
System.out.println("The exit value is:"+p.exitValue());
}catch(Exception ioe){
ioe.printStackTrace();
System.out.println("IOException"+ioe.getMessage());you might need to capture the stout & sterr from the process. see http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Process.html, or many other similar questions on this forum.
try this:
try{
Runtime time=Runtime.getRuntime();
Process p=time.exec(l_s_bcpQuery);
BufferedReader stout = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader sterr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String out = stout.readLine();
String err = sterr.readLine();
while((out != null)||(err != null))
if(out != null)
System.out.println(out);
if(err != null)
System.err.println(err);
out = stout.readLine();
err = sterr.readLine();
int exit_value = p.waitFor();
System.out.println("The exit value is:"+ exit_value);
}catch(Exception ioe){
ioe.printStackTrace();
System.out.println("IOException"+ioe.getMessage());
} -
hi,
i want to develop simple application using servlets.i ve installed apache tomcat4.1 version.i ve compiled my servlet program successfully.but when i am trying to start tomcat server,it is showing some error.i ve set the callspath too.
the error is:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
Using CATALINA_BASE: ..
Using CATALINA_HOME: ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME: c:\jdk1.5.0_05;
The system cannot find the file -Dsun.io.useCanonCaches=false.
please resolve my problem..
thanks in advance..Using JAVA_HOME: c:\jdk1.5.0_05;There shouldn't be a semi-colon in the JAVA_HOME
-
Using Runtime class for output
Hello,
I am using Runtime.getRuntime().exec("msxml3.dll,load myfile.xml");
where "load" is the method. I get an error message as "IOException CreateMethod" error=2.
Can some one help me out?
Thanks
MathewHallo Mathew,
The part of the error message CreateMethod error=2 almost certainly comes from Windows. I suspect that you could be feeding the wrong parameters to msxml3.dll. Have you tried the "msxml3.dll,load myfile.xml" from a command line prompt? Another possibility is that, when you call exec(), you do not get a command prompt. Instead the program starts the exe (or in this case a dll) as a separate process. Sometimes it helps to embed such commands as follows:
Runtime.getRuntime().exec ("cmd /K msxml3.dll,load myfile.xml");(when it all works, replace the /K with a /C, to get rid of the window) -
Unable to start Tomcat Application
Hi
I am usin Tomcat 5,i am copying my web application in webapps Directory but i am Unable to start it,getting error
FAIL - Application at context path /members could not be started
i am also not getting TITLE of Application from Context File,please help me out
IN Manager panel,there are 3 fields to deploy
Context Path (optional):
XML Configuration file URL:
WAR or Directory URL
i can understand Context field which means virtual Directory but i dont understand what XML configuratin\on and Directory URL means Here
pls reply meHi
I am usin Tomcat 5,i am copying my web application in webapps Directory but i am Unable to start it,getting error
FAIL - Application at context path /members could not be started
i am also not getting TITLE of Application from Context File,please help me out
IN Manager panel,there are 3 fields to deploy
Context Path (optional):
XML Configuration file URL:
WAR or Directory URL
i can understand Context field which means virtual Directory but i dont understand what XML configuratin\on and Directory URL means Here
pls reply me -
Unable to start tomcat from Windows 98
I just downloaded and installed tomcat on my Windows 98 machine. But when I click on start Tomcat, a DOS window opens and closes imeediately - the server does not seem to have started. I tried pasting this in a new DOS Window:
D:\jdk1.2.2\bin\java.exe -jar -Duser.dir="D:\Tomcat" "D:\Tomcat\bin\bootstrap.jar" start
But then I get the following error:
Bootstrap: Class loader creation threw exception
java.lang.IllegalMonitorStateException: current thread not owner
I have jdk 1.2.2 installed on my machine and JAVA_HOME pointing to this. Can anyone tell me what the problem is?
Thanks in Advance
JayIt's not TOMCAT_HOME, it's CATALINA_HOME
Add
set CATALINA_HOME=full_path_to_tomcat_installation
to AUTOEXEC.bat, or type it at command line before typing startup in TOMCAT_HOME/bin (however if you do this you will lose this variable when you close the command line). Putting it in autoexec is best solution. Reboot.
Probably a good idea to add
set JAVA_HOME=full_path_to_java_installation
in autoexec.bat as well.
hth
steve -
Unable to start apps using adstrtal.sh APPS/APPS
Hi,
I upgraded oracle apps 11.5.10 to CU2. Now unable to start applications.
I am getting below erros.
[oracle@linux1 ~]$ /u01/apps/viscomn/admin/scripts/VIS_linux1/adstrtal.sh APPS/APPS
You are running adstrtal.sh version 115.14
/u01/apps/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
Check logfile /u01/apps/viscomn/admin/log/VIS_linux1/12261049.log for details
[oracle@linux1 ~]$ uname -a
Linux linux1.lwcky.com 2.6.18-128.el5 #1 SMP Wed Jan 21 07:58:05 EST 2009 i686 athlon i386 GNU/Linux
[oracle@linux1 ~]$ uname -m
i686
[oracle@linux1 ~]$ ldd /u01/apps/viscomn/util/java/1.4/j2sdk1.4.2_04/bin/java
linux-gate.so.1 => (0x00142000)
/lib/libcwait.so (0x005fc000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00110000)
libdl.so.2 => /lib/libdl.so.2 (0x00b74000)
libc.so.6 => /lib/libc.so.6 (0x00143000)
/lib/ld-linux.so.2 (0x00614000)
before upgrade every thing working great. Not sure whats going on?
Any ideas?
Thanks,Okay guys, I figure out. adstrtal.sh script calling /u01/apps/visappl/ad/11.5.0/bin/adgetlnxver.sh script and we need to comment LD_ASSUME_KERNEL in adgetlnxver.sh.
After that everything started successfully.
Thanks. -
Unable to start Oracle Soa suite 10g on Windows 7
I am able install oracle soa suite 10g on Windows7 platform. But I am unable to start Oracle Soa Suite 10g. Wenever I am starting the SOA suite a new window is popping up the default color scheme of windows 7 is getting changed, but after that this window is disappearing without showing any error. From the task manager console I can see that a javaw process is getting started, but this opmn process is not getting started.
System configuration -
OS : Windows7
RAM: 2 GB
SOA Suite installation : Default (Including JDK and DataBase configuration).
If you have any resolution to this strange problem please let me know. Thanks in advance.I would be surprised if the amount of RAM in your machine is a limiting factor...
These blog posts contain useful info when running SOA Suite with resources on the low end of the spectrum. You could also use the [BPM AMI on Amazon EC2|http://www.deltalounge.net/wpress/2010/06/soa-suite-11gr1-ps2-notes-and-blogs/] ...
hth -
Unable to start extract for Mysql DB on windows
Hi,
I have installed Mysql database on windows machine, also installed GoldenGate
and i have edited the my.cnf (C:\Program Files\MySQL\MySQL Server 5.5) file with below entries,
log-bin="C:\Program Files\MySQL\MySQL Server 5.5\test-bin.log"
max_binlog_size=4096
binlog_format=row
and restarted the mysql service then add the mgr prm and created extract process.
while trying to connect the mysql db from ggsci getting below error message
GGSCI (PC) 29> dblogin sourcedb test, userid root
Password:
2012-12-04 15:05:04 WARNING OGG-00769 MySQL Login failed: . SQL error (2003).
Can't connect to MySQL server on 'localhost' (10061).
ERROR: Failed to connect to MySQL database engine for HOST localhost, DATABASE t
est, USER root, PORT 3306.
also Unable to start the extract process
edit params exta
extract exta
dboptions host localhost, connectionport 3306
sourcedb test, userid root, password *****
exttrail E:\ogg_mysql\dirdat\ea
table test.*;
tried with exact hostname and localhost also but no luck.
but i can able to connect the mysql through command prompt
C:\Users\>mysql -u root test -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.28-log MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Edited by: 899920 on Dec 4, 2012 1:44 AMHi ...
Please check if the mysql_home variable is ok:
MYSQL_HOME=<MySQL bin location>
To locate the configuration file, Extract checks the MYSQL_HOME environment variable: If MYSQL_HOME is set, Extract uses the configuration file in the specified directory. If MYSQL_HOME is not set, Extract queries the information_schema.global_variables table to determine the MySQL installation directory.
More details: http://docs.oracle.com/cd/E35209_01/doc.1121/e27289.pdf
Try it and put here your experiences.
Maybe you are looking for
-
Mac 10.9.5 trying to launch Illustrator CS6 for first time and won't launch, prompts for Java 6 even though I have Java 8 installed! Apple says Java 6 is very insecure and not to use it. I have the latest Java installed. Why won't Illustrator launc
-
Dynamic action for a text fiel in a tabular form
for a text field of a, wizzard generated, tabular form i created a dynamic action when lost focus. using a jquery selector to bind the da to the item in every row when the event fires some jscript and pl/sql code is executed. this all works like char
-
HT3386 how do I set up a mla format for a research paper?
how do I set up a format in MLA style for an English essay paper?
-
Try'n to move emails to another provider, not having much luck
fios isn't avail where I live, and DSL is painfully slow here. So need to export emails and contacts to new provider, there has to be an easier way that forwarding 1 email at a time. try'd using the other email providers tool to import emails and con
-
Question: Once I upgrade to Windows 8, if I need to send my PC back to HP for hardware repair, what operating system will be running on my system? Answer: For most repairs, the PC will be returned with the Windows 8 operating system intact. However,