I am using netbeans and when I create a new web application project I click the "Add" to add a server cause in a tutorial they are using tomcat and not glassfish.
I then choose Tomcat 6.0 from the list and the next page is displayed where I have to input
Server Location
Username
Password
I don't get this part.
What location do they mean? And what username and password?
With Server Location they probably mean the root directory of the Tomcat installation, sometimes also known as CATALINA_HOME.
There's a file in Tomcat's conf directory called tomcat-users.xml. The Tomcat documentation tells you to add a user ID and password to this file so you can administer Tomcat. So those would need to be entered in NetBeans then.
Carl's answer is right, but there is a wiki page with instruction on how to register an existing Tomcat installation with NetBeans that is a bit more complete.
Also, the IDE will add the values of user name and password to the tomcat-users.xml for you if the checkbox with the label 'Create user if it does not exist' is selected (and you have write access to the tomcat-users.xml file).
Related
I'm working with eclipse and I created a project, I put a test.html and test.jsp file in the root folder. In the URL of the Google Chrome I put this:
http://localhost:8080/project/test.html Error 404
http://localhost:8080/project/test.jsp Works (hello world!)
What is happening?
Double check if your test.html exists under this path:
"Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\project"
If exists, then it should be accessed normally, if not then you have to clean/build your application correctly or even try to restart eclipse.
Based on your follow-up comments about the custom Tomcat install and the project error message, it sounds like you either don't have Eclipse properly configured to use your Tomcat server, or you don't have your project associated with the Tomcat server you've set up, and so perhaps your changes arent being deployed properly. See if that issue has a quick fix suggestion (right click it) or go through your project settings and verify your selected server runtime. Sorry on phone can't give specific instructions.
I have a server where is running my web-application, located in the root folder (you can see it in the image, the path is /).
I reach that application by typing the IP and the Port (for example 111.222.333.444:1234).
Now I'm trying to deploy another web-application and reach it by typing 111.222.333.444:1234/prova/index.jsp (you can see it in the image, the path is /prova).
By using Tomcat Web Application Manager I uploaded a new war file called prova.war.
But, when I try to start it by clicking the start button, it doesn't start. In fact, when I click the start button, the Tomcat Web Application Manager I get the message:
FAIL - Application at context path /prova could not be started
.
If I use a ftp client, I can see that prova.war was correctly (I assume) unpacked.
Thank you.
Please check the log file. I.e you can check catalina.out file may be there are some issues while deploying the your new application (i.e prova)
I have downloaded a jsp/servlet project and want to run it in Tomcat. I have deployed the project in
Tomcat-> webapp
Now on hitting the url in the browser i am getting a 404 error,please tell me what are the steps to run this project?/
To deploy a web application in Tomcat without an IDE just copy the project into Tomcat's webapps folder. Then logon to Tomcat's main page with http:\localhost:8080 with a username and password. This is what you should do normally. Please elaborate on your issue.
You are getting 404, it means your server is up and running, but your url is in correct. Please try the below url pattern :
If your war name is HelloWorldJspExample.war
and jsp file name which you are trying to access is loginPage.jsp
then your url should be
http://localhost:8080/HelloWorldJspExample/loginPage.jsp
Refer this question execute-servlet-program
Hope this will do.
If You are copied a .war file into tomcat->webapps the please hit the
localhost:8080
if you see the home page of tamcat then goto manager and enter username and password and start your application.
if u cant see the tomcat home page please start the tomcat first goto tomcat->bin and click startup.bat file.
and for tomcat username and password please check the tomcat->conf->tomcat-users.xml file for username and password.
Yesterday when I launched my java project, it opened a web browser and went to http://localhost:8080/ showing my application's login page. Today, after accepting the latest updates (bangs head against keyboard) it no longer loads my app and is loading the Glassfish index page...
GlassFish Server 3.1.2
Your server is now running
I've verified the context path of my app is correct and I'm really not sure what areas of netbeans other than project settings that I should take a look at.
from the comments above the problem is when you run project from netbeans
the url opens on
http://localhost:8080/
if thats the problem how i understands it then go to context.xml and make sure
there is path attribure like this
"just look at the path only"
<Context antiJARLocking="true" path="/account_2">
etc...
but as you said you already checked it "context path" but can you tell me which one
because there is context path in project properties in netbeans under RUN node
and there is also "specify relative url context path" option
netbeans-->projects---go to your project---> then right click then properties then go to run node under relative url put /account/login.html this should make it work
I have a .war file of a Java Web Application. Now I want to upload it to my ftp server so that I can execute it.
What steps I should perform to run it?
The context path of the webapp is /mywebapp
Edit
Actually, my ftp server name is ftp://bilgin.ath.cx/ and I have uploaded my TestWebApp.war file to this dir: ftp://bilgin.ath.cx/web
Then what should be the URL to access the index.html page of the webapplication
#2 Edit
Tomcat is listening on 8082
Apache access Tomcat with jk connector.
As others pointed out, the most straightforward way to deploy a WAR is to copy it to the webapps of the Tomcat install. Another option would be to use the manager application if it is installed (this is not always the case), if it's properly configured (i.e. if you have the credentials of a user assigned to the appropriate group) and if it you can access it over an insecure network like Internet (but this is very unlikely and you didn't mention any VPN access). So this leaves you with the webappdirectory.
Now, if Tomcat is installed and running on bilgin.ath.cx (as this is the machine where you uploaded the files), I noticed that Apache is listening to port 80 on that machien so I would bet that Tomcat is not directly exposed and that requests have to go through Apache. In that case, I think that deploying a new webapp and making it visible to the Internet will involve the edit of Apache configuration files (mod_jk?, mod_proxy?). You should either give us more details or discuss this with your hosting provider.
Update: As expected, the bilgin.ath.cx is using Apache Tomcat + Apache HTTPD + mod_jk. The configuration usually involves two files: the worker.properties file to configure the workers and the httpd.conf for Apache. Now, without seeing the current configuration, it's not easy to give a definitive answer but, basically, you may have to add a JkMount directive in Apache httpd.conf for your new webapp1. Refer to the mod_jk documentation, it has a simple configuration example. Note that modifying httpd.conf will require access to (obviously) and proper rights and that you'll have to restart Apache after the modifications.
1 I don't think you'll need to define a new worker if you are deploying to an already used Tomcat instance, especially if this sounds like Chinese for you :)
copy the .war file in the webapps folder
upload the file using the manager application - http://host:port/manager. You will have to setup some users beforehand.
(not recommended, but working) - manually extract the .war file as a .zip archive and place the extracted files in webapps/webappname
Sometimes administrators configure tomcat so that war files are deployed outside the tomcat folder. Even in that case:
After you have it deployed (check the /logs dir for any problems), it should be accessible via: http://host:port/yourwebappname/. So in your case, one of those:
http://bilgin.ath.cx/TestWebApp/
http://bilgin.ath.cx:8080/TestWebApp/
If you don't manage by doing the above and googling - turn to your support. There might be an alternative port, or there might be something wrong with the application (and therefore in the logs)
The tomcat manual says:
Copy the web application archive file into directory $CATALINA_HOME/webapps/. When Tomcat is started, it will automatically expand the web application archive file into its unpacked form, and execute the application that way.
Note that you can deploy remotely using HTTP.
http://localhost:8080/manager/deploy
Upload the web application archive
(WAR) file that is specified as the
request data in this HTTP PUT request,
install it into the appBase directory
of our corresponding virtual host, and
start it using the war file name
without the .war extension as the
path. The application can later be
undeployed (and the corresponding
application directory removed) by use
of the /undeploy. To deploy the ROOT
web application (the application with
a context path of "/"), name the war
ROOT.war.
and if you're using Ant you can do this using Tomcat Ant tasks (perhaps following a successful build).
To determine which path you then hit on your browser, you need to know the port Tomcat is running on, the context and your servlet path. See here for more details.
Log in :URL = "localhost:8080/"
Enter username and pass word
Click Manager App
Scroll Down and find "WAR file to deploy"
Chose file and click deploy
Done
Go to Webapp folder of you Apache tomcat you will see a folder name matching with your war file name.
Type link in your url address bar:: localhost:8080/HelloWorld/HelloWorld.html and press enter
Done