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
Related
This is a pretty strage and hassle problem i have here.
I created a Dynamic Web Project in Eclipse and created an HTML file named "inicio.html".
I put this into my web.xml <welcome-file> and all seemed to work okay.
I could Run on server without any problem.
Until i dragged a folder into my webapp.
folder in my project
Now when i run on server my file doesnt change at all, and even when i change the welcome-file from web.xml it doesn't change.
It looks like there's another file somewhere like a copy from the original "inicio.html" that's executing on my server.
this is an example of what's happening
I tried to change my TomCat's web.xml file and it doesn't works.
It's unlikely that the new IMG folder is relevant. Deployment Descriptors aren't really hot swappable.
Make sure automatic building is enabled on the Project menu, and then try right-clicking on the server in the Servers View and choosing "Clean Tomcat Work Directory". Otherwise, you'll need to restart the server for changes to take effect.
When I run a java web project it always opens in my browser the "index.html" page, so I want to choose another page when the project starts.
How can I do it?
Thanks in advance.
Configure the URL to be used when you run your project as follows:
Select your project in the Projects panel, right click and select Properties... from the context menu.
Select Run from the list of categories.
You should see that Context Path already is set to something. It is set to /WebApplication1 in the sample screen shot below. Leave that field alone.
Specify the Relative URL you want to be used when NetBeans runs your application. By default it will be empty. The value you provide will be appended to the context path to construct the URL. In the screen shot below the relative URL is set to /Servlet1, so this will be be appended to the context path of /WebApplication1 to build the URL http://localhost:8080/WebApplication1/Servlet1 to be used when the application is run.
When your web application is run, the URL to be used is logged to the run window. Note the text Browsing: http://localhost:8080/WebApplication1/Servlet1 near the bottom of the screen shot.
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 created a new project and created artifact for it.
When I run Tomcat from command prompt and go to: http://localhost:8080/IntelProject1/index.jsp
I can see my page.
But when I try to run it from IntelliJ, it opens empty page:
http://localhost:8080
and if I try to go to:
http://localhost:8080/IntelProject1/index.jsp
this is what it displays:
HTTP Status 404 - /IntelProject1/index.jsp
type Status report
message /IntelProject1/index.jsp
description The requested resource is not available.
Apache Tomcat/7.0.57
The reason it is able to find it from tomcat is because I edited server.xml file in tomcat/conf folder:
<Context path="/IntelProject1" docBase="C:\Users\ibogojevic\Desktop\IntelProject1\web\JSP" />
But I want to be able to open it and debug from within IntelliJ
Maybe my artifact is wrong.
Any thoughts?
Open Debug Configuration in IntelliJ IDEA and make sure that Deploy applications configured in Tomcat checkbox is checked as it shown on the screenshot.
For me it worked with:
File >Project Structure >Artifacts
In the
Output Layout on the right side >"Available Elements?"
right click on the available libraries ( for me it was "Spring MVC-4.2.4.RELEASE")
Put into Lib
And it worked.
I'm using Tomcat 6 and using the Servers functionality in Eclipse to manage it. I have a project named foobar and I'd like to change the context path so that the URLs referenced are http://localhost:8080/app instead of http://localhost:8080/foobar. I've tried everything that I can think of:
Updated the server.xml path value in the Context section
From
<Context docBase="foobar" path="/foobar" reloadable="true" source="org.eclipse.jst.j2ee.server:foobar"/></Host>
To
<Context docBase="foobar" path="/app" reloadable="true" source="org.eclipse.jst.j2ee.server:foobar"/></Host>
I updated the file conf/Catalina/localhost/foobar.xml to set the path="/app" and docBase="foobar" with no luck.
I tried to remove the Module in Eclipse and redeploy at least a dozen times.
I went through the suggestions here: How to change context root of a dynamic web project in Eclipse?
I know that I can simply rename the project, but I don't want to.
EDIT:
I also should mention that I have some db settings in the application context. I am unsure if this should be set to foobar.xml or app.xml..? Eclipse automatically creates an app.xml file in conf/Catalina/localhost, but it seems to be ignored after I make changes.
In project properties click on Web Project Settings (assuming you are in a dynamic web project.) The only configuration value there is "Context root:"
change "Context root" to /app
rebuild
remove the project from tomcat
redeploy.
Step 1: In the project properties, click on Web Project Settings. The only configuration value there is "Context root:"
Step 2: change "Context root" to /app.
Step 3: Clean the tomcat server.
Step 4: Click Ok button on the dialogue Box.
Step 5: Click Yes on the next dialogue Box.
Step 6: Rebuild your project.
Here is an example of how I changed the context root of a web application under MyEclipse Enterprise, Version 2016 Stable 1.0, with an external Tomcat, version 6. The old context root is "cr1" and the new root is "cr2".
Under the menu "Project, Properties, MyEclipse, ProjectFacets, Web", click the "Context Root" tab, click the "Config..." button, and change the "Web Context Root" to "cr2".
In the "MyEclpipseExplorer" view, refactor the name of the project ("cr1"), to "cr2".
Go to the "webapps" directory under Tomcat, and eliminate the directory named "cr1".
Go to the directory "conf/Catalina/localhost" and remove cr1.xml.
Clean and redeploy the app in MyEclipse.
My personal experience is that the path needs to match the project name under tomcat webapps. If webapps/app1 in tomcat, then eclipse web module path needs to be /app1, otherwise there may be issue in accessing other pages, if those pages are not aligned well as relative path.