"Access is denied" message while deploying spring app in tomcat 6 - java

While trying to deploy my spring app on tomcat 6 I get an error saying
java.util.logging.errormanager:4
java.io.filenotfoundexception: c:\program files\apache software foundation\tomcat 6.0\logs\catalina.2010.02.16.log <Access is denied>
at java.io.fileoutputstream.openappend <native method>
at java.io.fileoutputstream.<init><unknown source>
at java.io.filewriter.<init><unknown source>
at apache.juli.filehandler.open<filehandler.java:259>
at apache.juli.filehandler.open<filehandler.java:59>
at apache.juli.filehandler.open<filehandler.java:50>
at sun.reflect.nativeconstructoraccessorImpl.newInstance0<native method>
at sun.reflect.delegatingconstructoraccessorImpl.newInstance<unknown source>
at sun.reflect.constructor.newInstance<unknown source>
at java.lang.class.newinstance0<unknown source>
at org.apache.juli.classloaderlogmanager.readconfiguration<classloaderlogmanager.java:418>
.....
.....
at java.util.logging.logmanager$2.run<unknown source>
.....
.....
Is this because Tomcat hasn't been installed properly? Or do I need some permissions to use Tomcat? Or are some important tomcat files missing? Or something else?

I solved it by running netBeans (or whichever IDE you are using to run the application) as an administrator. That gives you access permissions.

Check if the following file exists:
c:\program files\apache software foundation\tomcat 6.0\logs\catalina.2010.02.16.log
Your exception says <Access is denied>, so maybe the file is open in another application or you are missing permissions?

right click on log folder and in security give yourself proper WRITE permission and make sure folders are not in read only mode.

Looks like you're working on a machine that has some security policies in place that restrict you from installing software yourself. This is very common in most organizations nowadays.
Do the following:
Uninstall tomcat.
Find a folder where you can read/write into (eg. D:\neetu)
Install tomcat in the above folder.
Run tomcat.
It should work now.

After installing Apache Tomcat you must give the OS user who will be running the Tomcat server write/update rights to the directories: temp, logs, work.

Tomcat has no access rights to the c:\program files\ folders. There are ways to get around this, but the easiest way will be to install Tomcat in another directory, e.g in your user area (C:\Users).

Solution: I right click on eclipse and gave it administrative rights

The simple solution is that you need to run Tomcat with Administrator Permission. And this access denied will never occur.

Related

tomcat starts but doesnt show up in browser when entering: localhost:8080 or ip:8080 Centos7 vm

so I've manually installed tomcat version 9.0.10 and the newest java JDK.
I've correctly added the manager-gui and admin-gui users. i have went into the server.xml files and found that all the ports were correct.. (connecting to default port 8080) I had to do []# unset CATALINA_HOME or else it wouldn't let me start tomcat so I did and it started but when I went to the browser and typed in the localhost:8080 it didn't show, it only says firefox could not establish connection with server localhost:8080 so I went into logs to see if there were any errors and sure enough there was an error like so: /usr/local/tomcat/apache-tomcat-9.0.10/bin/catalina.sh: line 464: /usr/bin/Java/jdk-10.0.2/bin/bin/java does not exist.. and its probably right why would there be /bin/bin/ like that in a directory.. so i went into the catalina.sh file copied what it had inside into a blank file in documents and went to line 464 (txt editor numbered the lines for me) and what i found was this line at 464: eval $_NOHUP "\"$_RUNJAVA" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS %CATALINA_OPTS\
but I have no idea what to do about it.. i think i might have a path problem or could be a port problem but I don't think so... I've installed apache and it works great in the browser with localhost.. could that affect the tomcat access maybe?
anyway, id really appreciate any help I can get.. I'm very new to this by the way. I'm sorry, I couldn't copy and paste from my virtual machine so I had to type it. im on centos 7.
I think you are looking for tomcat deployment page where you can manage your artifact. If that is correct
First thing you need to check is that whether your installation contains tomcat manager application.
You can verify this by looking in to this path ("apache-tomcat-9.0.10\webapps\manager") If this path is absent you may have to reinstall your tomcat.
Try downloading the zip from the below path and start the server.
If you are trying to deploy your custom application you may have to provide the context path for accessing you application. Also you can verify the deployment by looking in to the above path. For eg: if you are trying to deploy test.war then a folder named test will appear in the webapp folder.
Hope this helps.

How to run "hello world" JSP page with Tomcat8 in Intellij IDEA 15?

I created webproject template in Intellij IDEA 15 (EE) and tried to run "hello world" application with simple JSP page on installed Tomcat server. But I've got this kind of error:
Error running Tomcat 8.0.33: Error copying configuration files from /opt/tomcat/conf to /home/praytic/.IntelliJIdea15/system/tomcat/Tomcat_8_0_33_webproject/conf: /opt/tomcat/conf/catalina.properties (Permission denied)
I tried this answer, but it didn't make a thing. I don't know, maybe the reason is that I use wrong installation guide. However it works fine from the terminal. How To Install Apache Tomcat 8 on Ubuntu 14.04
I've checked the /opt/tomcat/conf permissions and it says that only root has access to list, create/delete the folder and tomcat and me can only list files. However I added myself as a tomcat-user in tomcat-users.xml. Doesn't it matter?
The error means that intelliJ needs write access to the conf file. So the other answer was correct. You have to set the write flag with +w or like this:
chmod -R 644 /opt/tomcat/conf/ as root or with sudo.
It has nothing to do with tomcat users, only with OS users. It is unfortunately not enough, that only root has the write permissions, except that IntelliJ would be also started with root permission, but that is also not a good idea.

Tomcat startup batch issue

Can anyone please explain the below problem.
I'm using tomcat 8 and when I'm trying to start startup.bat file, the command prompt is opening and closing immediately just like blinking. However in the past while I'm working with java programs it worked fine but recently I installed Xampp and there in it again tomcat is downloaded "C:\xampp\tomcat". The same problem comes here in this folder as well, when I try to run startup.bat file. But when I use "XAMPP control panel" to start the Tomcat its able to get start and I'm getting "localhost:8080" start page in the browser.
The connector port for both tomcats are 8080 and I tried with changing the port number in tomcat 8 but no use. There should not be 2 tomcat servers in a single system? If not, why? (I've not installed them, both are in C drive)
I want to work with java servlet programs now.So I need use of tomcat. I've set below environment user varibles:
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_65;
path to C:\Program Files\Java\jdk1.8.0_65\bin;C:\apache-maven-3.3.9\bin
Please suggest the solutions.
Thanks in advance.
I think you should check the tomcat log to find some clues, it is in log folder of your tomcat installation folder. Maybe you have missed some startup variable in start.bat for your new installed things.
BTW, if you want to keep seeing what happened in startup, try to run startup.bat in a command line console, but not double click it through your mouse. It will continue on generating log output in that console.

Tomcat: startup.bat is missing

In many materials about tomcat what I've looked I saw that authors uses exeternal batch script for start and stop tomcat.
I didn't see information about wrting this script. I think this script provided by tomcat.
I used exe file for installing my tomcat 7 on my windows 7. In tomcat directory I search startup.bat. This file is missed.
Can you help me?
It should be in the /bin directory. If you're missing this file possibly it means that you have installed Tomcat using Windows Installer. Try to download appropriate .zip archive, I believe that you will find startup script there.
I was puzzled by this - windows people need to script too!
However I think it is because tomcat gets installed as a service with a manager. If you want to start and stop it without using the manager you start and stop the service directly.
You can do this by typing (in an admin command prompt)
net start tomcat7
and
net stop tomcat7
Though it would be everywhere, still if you download the zip from their site, you can follow these instructions - http://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html
bin\startup.bat is for windows & .sh is for Unix.
Have you checked bin directory under Tomcat instalation dir? It should containt *.bat for start and stop server etc.
If you want to start Tomcat server by using startup.bat and you are unable to find it(that's because installer does not have it, you can only see it if you download and run .zip this will show startup.bat explicitly https://www.screencast.com/t/RMPCq5eJre3),
So to solve the issue just go to C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7\bin and double click Tomcat.exe, a command prompt like screen will appear this is the the same as clicking startup.bat script. Hope this helps

Problem with Tomcat: 503 Service Temporarily Unavailable

Sorry if repost
I’m new to JSP. I’m following a tutorial from a book, but I’m facing a problem in one of the first steps of the example web app.
I’ve installed the Tomcat 6.0, and this is it’s full path:
C:\Program Files\Apache Software Foundation\Tomcat 6.0
The book says that to start Tomcat, I must cd into the Tomcat home directory and run bin/startup.sh, but since there is not any startup.sh file into bin folder, I do bin/tomcat6.exe.
I don’t know If that is right, but Tomcat seems to start correctly that way.
But here is the problem : I created a folder (named Beer-v1) with an HTML form inside (form.html), and I placed everything into the already existing folder webapps.
This is the full path of the html file:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\Beer-v1\form.html
So I type in my browser: http://localhost:8080/Beer-v1/form.html , but the page “503 Service Temporarily Unavailable” is displayed, and not the form.html.
What am I doing wrong?.
Please help.
Thanks in advance.
The book says that to start Tomcat, I
must cd into the Tomcat home directory
and run bin/startup.sh, but since
there is not any startup.sh file into
bin folder, I do bin/tomcat6.exe.
If you don't have TOMCAT_HOME/bin/startup.bat which should be used for Windows instead of startup.sh for Unix/Linux, but have tomcat6.exe and tomcat6w.exe, then you've probably installed Tomcat through an installer.
What you need to do, is on the system tray, find the tomcat logo, right-click on it and start it.
Alternatively, run Services.msc (from windows Run) and start Apache Tomcat 6 service.

Categories

Resources