I have a java application (Ninja framework) which uses TreeTagger. Root directory of TreeTagger is set via enviroment variable TREETAGGER_HOME. When I run application via ninja, everything works fine, however, when i deploy war file to tomcat, it cannot locate Tree Tagger binary:
java.lang.RuntimeException: java.io.IOException: Unable to locate tree-tagger binary in the following locations [/home/jarino/treetagger/bin/tree-tagger]. Make sure the environment variable 'TREETAGGER_HOME' or 'TAGDIR' or the system property 'treetagger.home' point to the TreeTagger installation directory.
The location which is specified in exception (/home/jarino/treetagger/bin/tree-tagger) is valid - the binary file exists. Why Tomcat application can't see existing file?
I'm guessing you are not running the Tomcat application server as the user jarino, so,
Double check that the tomcat user, which the tomcat process is running as, has the environment variable set
If the environment variable is actually set, double check that tomcat user has the correct privileges to access the treetagger directory in your home folder
TIP: I can see that a maven package exists for treetagger. Using a dependency manager, will make your life much easier :-)
Related
I've successfully installed java 1.8.0 and the runtime environment. After configuring some global variables in the setting (such as setting CATALINA_HOME, CLASSPATH and Path) and running tomcat/bin/startup, I received many error messages in the console starting as:
java.util.logging.ErrorManager: 4
java.io.FileNotFoundExceptiong: C:\Program Files\apache-tomcat\logs\catalina.2018-03-27.log (access denied)
at java.io.FileOutputStream.open0(Native Method)
....
etc etc
Where should I start fixing this? Is it a problem with my java runtime? Both JRE and Tomcat I have are 64 bits
The issue is most likely resulting from your file location. Try the following steps:
Confirm that your Tomcat folder is written down accurately.
If it is correctly located in the folder you have mentioned, try moving your Tomcat folder to another location outside of your Program Files. The issue is most likely caused by lack of administrator access while trying to work with your program in a locked location (Program Files).
If you absolutely need to have your Tomcat in your Program Files directory, run your IDE/Terminal in Administrator mode to override access privileges for the Program Files directory.
I am trying to deploy a .war file using Tomcat8, Apache, and Ubuntu 15.04. When I click "Select WAR file to upload" in the /manager section of tomcat I get the following error:
FAIL - Deploy Upload Failed, Exception: java.io.FileNotFoundException:
/opt/tomcat/webapps/musicStore.war (Permission denied)
How would I fix this?
Converting comments to an answer, adding more information:
Your /opt/tomcat/webapps directory belongs to someone (execute ls -l /opt/tomcat/webapps to see whom it belongs to).
While tomcat is running, execute ps aux | grep catalina to see which user is running tomcat (depends on the way you start it - might be your own current user). You could chown <thatuser> /opt/tomcat/webapps. However, for production systems I'd strongly recommend to not have the manager application running and tomcat's own directory writeable to itself. It opens up quite a few attack vectors and is bad practice IMHO
If it's a local development system, comfort typically trumps security - and you might opt for keeping the manager app.
To mitigate the potential manager-app problems in production, at least limit access to known IP-Addresses, keep the user database well maintained (not in tomcat-users.xml with clear text passwords). However, on my production systems, tomcat can not write to its own webapps directory - thus hot deployment of applications through the manager app won't work anyways...
I am trying to start weblogic server in eclipse but I get error like \IBM\RationalSDLC\ClearQuest\cqjni.jar was unexpected at this time.I found out that this is causing because of System PATH environment variable contains entry of it.I don't have administrative rights (Windows 7) so i can't modify system PATH variable.I have defined user defined PATH varible but it is getting appended to system PATH variable.
So how can I use only user defined PATH variable or modify weblogic script to use user defined PATH variable?or any other solution?
Any help would be appreciated.
I also faced the same issue. But I was able to resolve this issue by doing the below steps.
Check for the CLASSPATH variable value in Windows7 using echo %CLASSPATH% from command prompt.
Check if the CLASSPATH shows the below path
C:\Program Files\IBM\RationalSDLC\ClearQuest\cqjni.jar
If Yes, then open the below 2 files in edit mode from the path(Weblogic server)C:\Bea\Middleware\user_projects\domains\XXXX\bin
3.1 startWebLogic.cmd
3.2 setDomainEnv.cmd
and set the CLASSPATH manually removing the C:\Program Files\IBM\RationalSDLC\ClearQuest\cqjni.jar
Start the server, you would be able to start the server then.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I am installing Tomcat 7 in my PC it works in Eclipse but when I try to open in bin/ tomcat7.exe it just open and closes, (I am stopping the server in Eclipse). Also, in Eclipse I'am trying to open admin console like URL:(localhost:1234/admin) it shows 404 error. Can anyone who knows this problem explain a solution?
If you are using Windows, you can follow the following to run tomcat7.exe :
Open your Command prompt (cmd)
Set your JAVA_HOME or JRE_HOME. Eg. set JRE_HOME=C:\Program Files\Java\jre7
Go to the directory of your tomcat. Eg. cd C:\Program Files\apache-tomcat-7.0.35\bin
Run startup.bat file. Eg. startup.
This should start your tomcat server without using Eclipse.
First Set JAVA_HOME and CLASSPath path
For Windows Java Path Settings
Right click on Computer and open Properties.
In Windows Vista or Windows 7, go to Advanced System Settings.
Else go to next step. Go to Advanced Tab and click on Environment
Variables button.
Select CLASSPath under the list of System Variables, and press Edit and add If CLASSPath not available there click New button add
C:\Program Files\java\jre 1.x.x_xx\bin
after a semicolon.
Now click on New' button under system variables and enter
JAVA_HOME as variable name and path to jdk home directory (ex.
C:\Program Files\Java\jdk1.x.x_xx
After Completing Java Path Settings
Go to the directory of your Tomcat. Eg. cd C:\Program
Files\apache-tomcat-7.0.35\bin
Run startup.bat file
To start your application server in Windows :
Open command prompt .(Run as Administrator).
Go to the path (..\apache-tomcat-8.0.27\bin) and run startup.bat
A new command prompt opens up and should stay unclosed to tell your server is in running state.
If command prompt opens and closes automatically, then the reason can be as below.
tomcat is already in started state in Eclipse.
Check the connector port configured in server.xml file and check if that port is free in your local machine. [netstat command]
Change the connector port to some unused port, preferably in 80XX series.
Let me know if you are able to invoke localhost:(the http connector port) you have configured in server.xml through you web browser.
You don't start Tomcat by double clicking the exe, use the batch files instead.
startup.bat starts the server, shutdown.bat stops it again.
And ignore the advise to get the service installer. You don't need those unless you want the server to start on system boot and run in the background. Which you don't want unless you're going to configure a production server, which you aren't here.
The batch files are in the same directory on your computer as the exe.
you have to set JAVA_HOME and JRE_HOME in System environment.while setting the JAVA_HOME and JRE_HOME, you should assure that JRE path that you are setting is corresponding to the JDK whose path you have set in JAVA_HOME. some time what happens that there may be more than one JDK in the system so conflict occurs. better to have only one JDK and corresponding JRE.
This is probably due to a bad setup of an environment variable.
For example, if you setup incorrect JAVA_OPTS, tomcat startup will fail.
You can check your configuration by calling : catalina configtest
Here an example of the output for bad setup of JAVA_OPTS :
Error occurred during initialization of VM Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
It works for me after updating the jdk path in JAVA_HOME compatible to your tomcat version in user Variables.
the JAVA_HOME and JRE_HOME environment variables set should not have semicolon or ; at the end...I was facing similar problem...removed semi-colon or ; from the end and tomcat server started from cmd screen after running startup command(of tomcat..bin folder).
I checked environment variables and compiler version everything was fine, deleting junk files from work folder worked for me.
Just download the tomcat 32-bit/64-bit Windows Service Installer (pgp, md5) as in this set up is given which will install tomcat on your PC and you can also start and stop tomcat using the tomcat service.
In my experience tomcat7 might not like it if JAVA_PATH or JDK_PATH contain bracket symbols like in "Program Files (x86)". Make sure you format path in your environmental variables correctly or move your JDK to another folder.
In my case, I had some reference to a jar file in catilana.bat, but the jar I had removed from my system. Tomcat started successfully once I removed that reference from catilana.bat
Check your JRE_HOME location in environment variables. if it didn't work then try
1). Open CMD in administration mode.
2). locate to your tomcat directory.
3). run startup.bat --->> It will show your problem.
Had the same problem with Apache Tomcat 9 version.
Solution is very simple.
Apache Tomcat 9 is supported by Java 8 and later versions. So, I had JRE_HOME with JRE7 path, I binded it to new JRE8 and everything works fine.
Different versions of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The mapping between the specifications and the respective Apache Tomcat versions is:
I'm trying to run a sample app in Tomcat. I've installed tomcat, set up the environment variable by creating a new system variable called JAVA_HOME which is set to C:\Program Files\Java\jdk1.6.0_20. And I've created a new dir for the web app in the tomcat program directory. In the cmd prompt I navigate to the tomcat program directory and type in bin/startup.sh and I get the following error: 'bin' is not recognized as an internal or external command, operable program, or batch file.
I'm using tomcat 6.0 and I'm on a windows machine. What could the problem?
On Windows you must run the startup.bat file instead of the startup.sh file (note the extension is different).
Also, enter the bin directory before executing the bat script.
cd bin
startup.bat
Your on windows try:
bin\startup.bat
If you try typing in bin\startup.bat on a Windows machine and still get the same error, there's a possibility that Windows is not seeing the batch script where it should be. As a-horse-with-no-name already said, try installing Tomcat to a location where there are no spaces in the path. In your case, anywhere other than Program Files.
EDIT: To resolve this space issue, you can do two things: 1) Install JDK/JRE to a common location without spaces (say, C:\Java) and set it to be JAVA_HOME environment variable. 2) Install Tomcat to another location (say, C:\Tomcat) and proceed from there. Since these are all in common location, I believe you can do this as a limited account user without needing admin privileges.
Try to install Tomcat (and possibly the JDK) into a directory without spaces.
The script you ran is intended for *nix systems. Try bin\startup.bat
I'm a little confused by some of the answers. First, the error you are receiving is from Windows. Nothing to do with Tomcat. The Windows OS thinks you have entered a command, and doesn't recognize it. Files with the .bat extension are always recognized by Windows as Batch file commands....... soooo..... Navigate to the bin directory, again, under your tomcat installation. Then....
Don't append the bin in front of the command. You should do a quick look to make sure that the "startup.bat" file is here (dir *.bat). Then just type "startup.bat".
Seems like I just type "catalina.bat start" (for my tomcat catalina installation)