HTTP 404 when trying to run a jsp file in eclipse - java

I get 404 error when trying to run a jsp file eclipse. The confusing thing is the server is running and I can go to localhost:8080 without any problems. I have attached an image of my configuration of server, the jsp file and also the location of the file and the error.
I embed the image cause of the reputation thing so I have linked it
More information:
I am using TOMCAT 7, ECLIPSE KEPLER I have checked the location of helloworld.jsp its in WebContent. I have restarted the server. I have created another dynamic web project nothing works. I get the same problem I can go to localhost:8080 but I cant run an JSP file
SOLVED:
Okay guys its pretty simple to solve this problem. There are two things you need to try.
1)Right click your project and export the war file into C:\ProgramFiles\Tomcat7 folder
If this does not work then.
2) Right click your project and export the war file into some directory and copy the war file into C:\ProgramFiles\Tomcat7 then start the Tomcat server and there you go your JSP file work.
You will probably end up doing step 2 because of stupid windows file permissions
Also thanks for all the help guys really appreciate it.

Make sure that u have put your Jsp files into the WebRoot and check the location and even check your Web.xml and after that run and still if its not working then post your Web.xml here.

Unfortunately, user3135774's solution does not work for me, as am using an Apple computer.
I have read and researched another problem (Error 500: No Output Folder), which I have along with Error 404, carefully, and I think this is related to permission issues.
The JSP file is supposed to be compiled and then deployed under Tomcat/work/Catalina/localhost/YourProjectName. The 404 error message means that there is no files in that directory. Since Eclipse has no write permission to this directory, you have to change the access permissions. After changing the permission to 777, there we have the compiled .java and .class files.

Since you do not have any of them
index.html/index.htm/index.jsp/default.html/default.htm/default.jsp page
To run your jsp page :
In Eclipse:
=>goto Java Resource
=>right click on your jsp page
=>in that select Run as Server.

After applying everythings, it did not work for me to read image file in eclips.
Finally, It works! after that I change deploy path.
Server Locations>Deploy path(Set with "Workspace" of Eclipse)

Related

The filename, directory name or volume label syntax is incorrect

While running my eclipse I received this error. But when I run my project it is executed in the internal browser. But it is not executed in the default system web browser. Any one answer for this. Thanks in advance for the answer
You may change browser setting from eclipse -
Window->Web Browser-> Now select your browser
This problem comes when you change the .html or .jsp file to text file or some other file type which is not read by web container.
In my case i had .jsp/html files changed to text format.
I changed the file types:
1) right click on file from folder where you files are located
2) open file properties
3) change the "open with" to your default web-browser (chrome,mozila,IE)
4) Apply ok
Go to eclipse and run your project...
Even if I tried every suggestion, I have could not overcome that issue at first. In my case, delete the tomcat installation folder (for me C:/tomcat), then installing tomcat again solved my problem. May be you are confused while other settings, too.

java.io.filenotfoundexception jboss project localhost

I've been working on web project written in jsp and running on jboss. I have problem after deployment of project. I'm getting an error after hitting localhost:8080/Myapp : java.io.filenotfoundexception Null/easyfile.properties <Can't find easyfile.properties>. I have this file in conf folder in my app directory. For sure I need to properly point to this file or place it somewhere in jboss installation folder but unfortunately I'm new to Java and 've been working with PHP but I've been assigned to client who has home site written as one jsp site with some xml. I need to change their frontend a little bit but I'm trying to set up my local environment without success.
Any help would be great.
Regards Adam

Website directory structure different from eclipse

I am coding a website using java servlets and am using eclipse and tomcat. When I test it using localhost, it works fine. But when I am deploying it on my actual website, the directory structure is messed up and the files are not called properly.
My eclipse directory structure on localhost is
Project Name
.src/packageName/java files
.WebContent/HTML files.
When I make a call from the html files, I use the relative location and tomcat automatically knows to look in the src/packageName folder. For example, from the /WebContent/login.html page makes a onClick call as follows,
. This will automatically trigger the java file in /src/packageName/welcome
When I am deploying it in my actual website, the WebContent/login.html is throwing an error WebContent/welcome file is not found. How do I tell my website to search in /src/packageName folder?
Hmm...have you been sure to package the application as a war for deployment.

Checking Glassfish error log

I'm using NetBeans 7.2 and GlassFish 3.1.2 and I'm running a web application with JSPs and Servlets. There seems to be some errors in the output because I'm getting a blank webpage when the app is run. I understand that the log file is located in glassfish/domains/logs folder, but I'm not able to see any System.out or System.err inside of that text file.
Is there anything I have to configure so that I can read the log and come to know as to where I'm going wrong? Ideally I'm trying to debug the servlet.
In NetBeans, go to Tools->Servers. Select the GlassFish Server and on the 'common' tab the 'Domains folder' + the 'Domain Name' is the root folder you need to browse to on your machine. Inside of that folder, you'll see a 'logs' folder which will contain the 'server.log' file.

build-impl.xml:1031: The module has not been deployed

I have been working on a Java web application and i am using SmartGwt on Netbeans 7.3 and out of a sudden I encountered this problem. I tried cleaning the build-impl.xml then restarting the IDE and I should say I have fairly low knowledge on this. Can someone please tell me why it is giving an error and how I can fix that?
The error message says :
nbproject/build-impl.xml:1031: The module has not been deployed. See the server log for details.
BUILD FAILED (total time: 4 seconds)
Note: i am using Tomcat 7.0.34
may its so late but the response useful for others so :
Sometimes, when you don't specify a server or servlet container at the
creation of the project, NetBeans fails to create a context.xml file.
In your project under Web Pages, create a folder called META-INF.
Do this by right mouse button clicking on Web pages, and select:
New->Other->Other->File Folder
Name the folder META-INF. Case is important, even on Windows.
Create a file called context.xml in the META-INF folder.
Do this by right mouse button clicking on the new META-INF folder, and
select:
New->Other->XML->XML Document
Name it context (NetBeans adds the .xml)
Select Well-formed Document
Press Finish
Edit the new document (context.xml), and add the following:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/app-name"/>
Replace app-name with the name of your application.
Now your in-place deployment should work. If not, make sure that the
file can be read by everyone.
The context.xml file is specific to Tomcat. For more information about
that file, see the Tomcat documentation at tomcat.apache.org.
Start your IDE with administrative privilege( Windows: right click and run as admin), so that it has read write access to tomact folder for deployment. It worked for me.
Take a look at the server logs!
I had been with this for hours. The awful Tomcat servlet is not very helpful neither but if you can see the stacktrace that should be enough.
For instance, I read the following error message there:
As you can see, the message was pretty clear and easy to fix :-)
Check if there any other instance of the server is running already
Check if the port that will be used by the server is free.
If you add jars in tomcat's lib folder you can see this error
Close Netbeans.
Delete all libraries in the folder "yourprojectfolder"\build\web\WEB-INF\lib
Open Netbeans.
Clean and Build project.
Deploy project.
One of the main reason for this error is due to permission not granted to all users. so remove this error, follow the following steps :
1) Go to the C:/Programme Files/Apache Software Foundation/Tomcat 7.0
2) Right click on the Tomcat 7.0 folder and click on properties.
3) go to Security Tab.
4) Select the User and click on Edit... button
5) Grant all the permission to the user and click on apply and ok.
Refresh the system and now try. I hope it will work
if you still getting this error try this.
Go to Netbeans services
Remove Apache Tomcat.
Add Apache Tomcat again.
Build Project.
Deploy Project
in my case , it said that the 8080 port is in use , so I change the server port of Tomcat to 8081 and it works
Check whether you placed the within the .. or outside the ...
If you placed it outside the server tag , and if you try to access the init-parameter then it will give error.

Categories

Resources