I know that this question has already been asked a couple of time but any answers helped me to fixed my own problem. Like I said I am working on OSX Mavericks and I would like to use tomcat with Eclipse JEE. Here is exactly what I did :
- I downloaded Eclipse JEE for mac.
- I downloaded Apache 7.0.47 on http://tomcat.apache.org/download-70.cgi
- I put my folder in /Library/apache-tomcat-7.0.47 and I created a symbolic link in this same folder that I named tomcat
- I tryied to configure it with Eclipse but when I start the server an error message occur :
"Port 8080 required by Tomcat v7.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)."
Do you know which process is using the port 8080 on mac OS and how to kill it ?
I tried to start the server on another port by changing it in eclipse in port 8081. But still nothing appear on localhost:8081.
I tried to launch appache with the terminal by typing : "/Library/Tomcat/bin/startup.sh" and still nothing happened, my web browser just tell me : "no data received".
I hope I have been understable and hope somebody could give me an issue.
I've not tried this on Mavericks, but I have used Tomcat 7 with the previous two versions of Eclipse on Lion and Mountain Lion.
• Be sure you are using the correct edition, Eclipse IDE for Java EE Developers Eclipse IDE for Java EE Developers not "Eclipse Standard 4.3.1" or "Eclipse IDE for Java Developers" nor any others. In theory you should be able to add plugins in order to get the equivalent, but that has never worked for me nor for many other folks.
• After downloading Tomcat, run it through the BatChmod app, turning on the checkboxes to clear the filesystem meta-data. By default, file permissions will block Tomcat from running on a Mac (in my experience at least).
• Test Tomcat by itself. Drag the "startup.sh" into a Terminal window and press Return to launch. Later drag the "shutdown.sh" into the same window to stop. Point a web browser to this address to see Tomcat's welcome:http://localhost:8080/ (Tip: You can trash all the .bat files when running on a Mac.)
• No need for symlinks. You should not have to do anything to at all to Tomcat, except the BatChmod. The trick is to configure a new server within Eclipse. The goal is to make Eclipse aware of your Tomcat folder. I'm sorry I cannot remember exact steps at the moment. Doing the configuration is not as easy as it should be – nothing in Eclipse is as easy as it should be.
• You may need to start from scratch. Trash Eclipse and all of its config files, settings files, etc., both visible and invisible. Do some googling to discover their locations.
• Beware that you should not share the "workspace" folder between versions of Eclipse. Others have advised that major (annual) versions of Eclipse are not completely compatible with their settings, prefs, and such.
• There may be some issues with Java 7 on Mavericks -- you may want to check the Apple Java Developer mailing list.
If you have a choice, considering using other tools instead of Eclipse. Eclipse is arcane and fragile. My first choice would be IntelliJ, though you'll need the commercial (not free of cost) version to do web server work. I only used Eclipse because of its plugin for Vaadin. Another choice is NetBeans which is easier to setup with Tomcat than Eclipse (and now has a good plugin for Vaadin btw).
Tip: I put Tomcat at the root level of my current user's home folder, just to keep things simple.
Related
I have a very specific problem deploying a webapp on a Windows installation of Tomcat 8.5 ( version 8.5.29 ) that I have been pulling my hair out for the last few days with no success. My web application generates a PDF using JasperReports and within this PDF is a barcode ( which uses Barbecue 1.5-beta ). Running this report on my local install of Tomcat works great, but when I deployed it to the server it did not produce the barcode. I did not see any errors either
Barcode just has placeholder
I downloaded the 8.5 distro without all the Windows specific installers and files, fired up tomcat (startup.bat) and ran the report again. This time it worked. The barcode rendered and everything. Same exact web app directory and config files.
I copied every file from the generic distro to the windows Tomcat install directory and ran again. Same problem. I went into the Tomcat Config dialog, changed the start up mode from jvm to java, but no luck.
The java virtual machine setting is:
C:\Program Files\Java\jre1.8.0_161\bin\server\jvm.dll
I changed it to use default and still the same problem. The java options are out of the box settings ( same when I ran the startup.bat ).
My only guess is the tomcat.exe that is being run is doing something different, but I cannot even begin to figure out what the difference is. I removed the tomcat native dll (tcnative-1.dll 1.2.16 ), but again no luck.
I feel like I need to just run the generic Tomcat 8.5, but this needs to be running all the time and run as a service.
I can't believe one stupid barcode is causing me so much pain. Its for a warehouse packslip so it is required. At this point I am willing to drive to the warehouse and just manually draw the barcodes myself!
Perhaps someone out in the internet has experienced this and has an idea before I just end my career and become a juggler.
Sorry if this is the wrong kind of question but currently I have an Apache server which is configured for Pyjamas. All I used to have to do was: pyjsbuild example.py and the GUI would appear in my browser.
I decided to switch to Java, so I picked Vaadin as my framework. How do I do the equivalent for Vaadin? All I want to do is compile the java and have Apache recognise it.
I'm using linux and I'm very new to building web applications, previously I only ever built the GUI side of things, I never had to touch the server.
You need Apache Tomcat to serve java pages. Install it separatly or see http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html for information on how to hook them together.
Vaadin projects work just as any web project. You have to crate a WAR file.
For example, if you are using Eclipse, right-click on the project, choose "Export..." and under "Web" choose "WAR file".
If you are using Netbeans or something else, google "create war in netbeans/intellij/..." to find out how to do this step.
This will generate a file with the extension .war, which you will have to copy in the "webbaps" folder of your Tomcat installation. Restart Tomcat and the application will be automatically deployed.
If you do not have access to the webapps folder, go to Tocatmcat's "Manager App" in the browser and
under the section "Fichier WAR à déployer"(WAR file to depploy) choose the generated file and click Deploy.
To start with, make sure that go through Getting Started chapter in Book of Vaadin. In this chapter you will find overview of the required toolchain and step-by-step installation instructions. Your Linux distribution might have more documentation about installing JDK (For example, see Ubuntu wiki for Oracle JDK installation).
It will be convenient for you to connect Tomcat to Eclipse IDE. This makes starting Tomcat and updating your application easy. For example, see this [blog] for some videos about connecting Eclipse to Tomcat.
Please note that using Eclipse is just one approach and later you might want to see if IntelliJ IDEA or command line works better for you.
I have just downloaded NetBeans 7.3 for JavaEE and installed it with Tomcat 7.0.41 Everything went fine and I can run NetBeans, start and stop Tomcat from within the IDE and add and remove servers at will.
However when I try and create a Java web Application project my server list is empty.
The message I get at the bottom of the wizard for creating projects is "No servers are registered in the IDE. To register a server, click the "Add..." button.
I have Googled and got nothing and looked at the NetBeans docs and got nothing, help me
I am running Netbeans 7.3, Java 1.7, Tomcat 7.0.41 and Windows xp-3.
This Problem is solved by just Restarted Netbeans Software
Thanks to all
I know the original problem was solved, but I had a very similar issue, and in my case simply restarting Netbeans did not help, so I wanted to help anyone with my issue. It sounds stupid, but I wanted to warn people that they need to be sure to download the right tomcat zip file.
Tomcat lists several zip files on their server, and I should have been using the Windows-64 zip file. Instead, I downloaded the first file, which just said "zip". I am not sure what configuration this was. It ran in windows 7, but created the same sort of mysterious pattern in Netbeans. In the Services tab, I could clearly see Apache Tomcat listed under Servers. If I started the service it worked fine. However, when I right clicked on my project and attempted to resolve missing server problem, it would not list tomcat in the list. The list is filtered to only show servers that are valid with the version of Java EE 6 or whatever you are using. In my case, apparently the original tomcat I downloaded was not valid.
You have to register the server inside Netbeans.
Simply a matter of going to the servers tab under tools & adding a new server & browsing to the installation location.
Follow the tutorial on the link below here (start at the time I have set):
Tutorial
Try this remove all server from the IDE and then double click the netbeans exe go to customize select the the tomcat server alone and then install
sample
Go to Tools -> Plugin -> Update Plugin.Worked for me, give it a try.
I have developed a java webservice application that I have been running on my dev-computer and in the meanwhile been setting up a dedicated ubuntu based linux server.
I have installed oracle-jre, mysql and apache tomcat 7 on this linux server and
after reading documentation I understand that I can either copy the deployed project archive (.WAR) or I can simply copy the project folder, into the servers /webapps/ folder from my development computer. Then restart tomcat7 and it should automatically run the webapp.
On my dev-computer with Eclipse IDE the webservice works properly as expected, but I cannot access the POST URL methods at all on the server
e.g. localhost:8080/Webservice/rest/account/login
(The installation on the server seems to be O.K as the Apache examples all work properly.)
I cannot see any logs in the /logs/ directory, in fact the folder is completely empty, so I cannot debug whats actually happening. Why aren't logs writing to the Catalina.out file?
Am I deploying this correctly as explained above?
Do I need to configure Eclipse or any project settings to reflect the change from the eclipse IDE / dev-computer to the server? E.g Is there any real difference?
A lot of questions there, but I wanted to clarify as much as possible,
Cheers,
Oliver
I fixed this issue by reinstalling tomcat.
I've just bought an iMac and would like to start programming on it. But I can't configure Tomcat and Netbeans to work together. I installed Tomcat and it seems it is working. But when I try to build a web application, netbeans ask all the time my user name and password. I already configured the user.xml but it's not working.
Can anyone give a tip?
Cheers
I had the same issue and I followed #Raph's answer and it worked. After that, I had another issue, Netbeans returned this error message:
Deployment error: Starting of Tomcat failed, check whether the /Applications/Tomcat/bin/catalina.sh and related scripts are executable
To solve this, in terminal, I navigated to tomcat-folder/bin and executed:
chmod 755 *.sh
And it solved my issue, cause it made the scripts executable.
Add a new Tomcat server is quite easy on NB. No "install" as a traditional sense needed to do that:
Download any compressed (not installers) tomcat version from http://tomcat.apache.org
Just unzip (uncompress) in your preferred folder. You dont need do any thing else.
Go to Tools ---> Servers -----> Add server.
Select Apache Tomcat Server. Then on "server location" label, select the folder where you have uncompressed your Tomcat Server. You can define in this window your log and password. NB will automatically change your user.xml.
This is a good way to configure as many servers as you want, and easily configure its access and management data.
I hope it helps.