Madan, Gopal

Ranch Hand
+ Follow
since Aug 13, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Madan, Gopal

I am trying to run the chapter14 webapp examples where it uses the AddressBean class. I am getting the following exception, ( and then some cuz of this ) which i quote. Can somebody explain what's happening.

org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /address.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 4.1\work\Standalone\localhost\chapter14\ '.' expected
import AddressBean;

I need to recant my suggestions in the previous post.
It then worked because my file was in the root drive (d:\). I realized and tested out that when you create a File instance the argument must be a path to the file you want to create File instance upon. So in your case it should be as follows:
File f = new File ("d:\\whateverdir\\whateversubfolder\\bart.gif");
I am using W2K hence the above file path.
I think your best bet for portablity and all is to use the getRequestDispatcher() and/or getNamedDispatcher() methods of ServletContext object.
I tried this with a jpg (image/jpg - mime type).
The file was directly under the Web application DocumentRoot. I also got the same error. Only thing i changed is used a forward slash just before the image file name. So I guess in your case you would use

File f = new File ("/bart.gif")

When you set the Environment variables in a Shell (MSDOS Prompt), it's valid only inside that shell. Your weblogic.Admin and so commands works fine only inside that shell.
Hence, if you open another cmd window, unless you do the setwlsenv.cmd again, you're going to have problems.
To avoid this, you can go to "My Computer" -> Properties and set the environment variables (almost to everything needed ), so that these variables are available system wide.
Then every cmd shell you open, will be fine with all the env. variables
[ January 07, 2003: Message edited by: Madan, Gopal ]
19 years ago
I am using WLS7. In one physical machine I have an Administration server with 3 other ManagedServers.
I think I did all the required steps to enable nodemanager work with ManagedServers. When i click the "start the server link" inside admin console, it fails with the following exception.

[Could not execute command start for server mymanser1 via the Node Manager
- reason: [SecureCommandInvoker: Could not create a socket to the NodeManager running on host '' to execute command 'online mymanser1',
reason: Connection refused: connect. Ensure that the NodeManager on host '' is configured to listen on port '5555' and that it is actively listening].]

Any suggestions/Help is deeply appreciated.
19 years ago
I created a test domain ( mydomain ) and a Administrative server ( myserver ) in it. Now, I have all the correct folders/files under D:\bea\user_projects.
My question is how to elegantly delete the server and then wipeout the domain - besides deleting the folders/files under D:\bea\user_projects - manually?
Thanks for any suggestions/input.
19 years ago
Assuming everything is installed fine, there are couple of things you can do for HelloWorldServlet under chapter01 webapp to work.
1. You can enable the default "invoker" servlet to kick-in ( which is what you tried to use ).
2. Create a servlet-mapping element in your chapter01\WEB-INF\web.xml file.
For the first option, uncomment the servlet-mapping element for the "invoker" servlet, in the file $CATALINA_HOME\conf\web.xml. This is commented out, by default in tomcat 4.1.12, which i assume is the case with your version, too. Then the URL you used should work.
For the second option, add the following servlet-mapping to your chapter01\WEB-INF\web.xml file.

Then your HelloWorldServlet can be access via HelloWorldServlet
Change the url-pattern and the port #, as you wish.
Hope this helps
When you installed Tomcat, it would have prompted you for an Administrator LoginID & Password. Your inputs are stored in a file called tomcat-users.xml under %CATALINA_HOME%\conf. In case you forgot your adminstrator userid/password, you can always open this ascii file and see it.
if you just type http://localhost ort/manager, you will be first prompted for the ID/password. Then it response will be blank or FAIL - unknown command.
The correct syntax to use the manager webapplication is


One of the commands you can use is list.
You can find more about manager webapp in your tomcat documentation..usually %CATALINA-HOME%\docs\tomcat\manager-howto.html.
Hope this helped to solve your issue
19 years ago
You put your war files in ..\webapps folder.
Since you said you did that, you should be able to access your web application.(even though you may not see the exploded directory structure under ..\webapps folder).
Second, if unpacking is not happening is your concern, then there is an attribute called unpackWARs for the Host element in the server.xml file. It takes boolean values. Make sure it is set to true for whatever Service element you're interested in.
FYI, if the war was packed properly, you should be able to access your web application, without exploded directory structure.
Check to see whether your CLASSPATH environment variable includes the period . to include the current directory.
I am not sure whether these things matter with the latest JDKs
Hope this helped
19 years ago
If your Unidentifiable tomcat is working why don't you create a servlet and get the info you need.
I just ran the following servlet and it worked fine.

Hope this was helpful
[ October 31, 2002: Message edited by: Madan, Gopal ]
19 years ago
Try this link.
Click around all the links in this site. It contains lot of information about servlets/Jsp/tomcat.
You can also download source code for both the new and old books. Also, the old book is available for free in pdf format.
Good luck
[ October 31, 2002: Message edited by: Madan, Gopal ]
19 years ago
I also run the same thing from jwsdp_1_0_01, along with standalone tomcat 4.0.1
while your server is running, did you try this URL
If the output from this URL says that the ROOT webapp is running, then you should be able to acces your servlets.
Do post back whether your ROOT app was running or not.
19 years ago
I think you answered your own said that you're looking for a default web application and you don't want do define each servlet in web.xml.
First there is a default web application - ROOT under webapps folder in tomcat. Any servlet class files you dump under \webapps\ROOT\WEB-INF\classes can be referred to, just as you said /servlet/HelloWorldServlet for example. If it's a package'd servlet class you refer to it as /servlet/packagename.HelloWorldServlet.
Point being , for the default ROOT web application all you need is a / in your URI (URL) leading to your servlet via the invoker servlet.
You don't need to have any servlet element(s) in your web.xml. It's completely optional, unless you want to create alias, parameters etc.
Hope this helped
19 years ago
You can host the file web-app_2_3.dtd in your local web server...the one that comes with tomcat.
Get the file from web app DTD and save it locally under \Apache Tomcat 4.0\webapps\ROOT\dtd OR any other web app you prefer. ( for the ROOT to work you should uncomment a line in server.xml if it's not already done).
Anyway, henceforth, refer to this DTD file thru' "http://localhost:8080/dtd/web-app_2_3.dtd"
whereever it was originally referring to "" in your web.xml
Problem solved...and u don't need an internet connection.
Point being you're validating your web.xml against the local DTD instead of the one in site ( assuming they both are identical
Hope this helped
19 years ago