Tomcat 7.0 not getting start from Eclipse - java

I have installed tomcat 7.0 on my system. When I am trying to run my application on the server from eclipse, it shows me this error
The archive: C:/Program Files/Apache Software Foundation/Tomcat 7.0/bin/bootstrap.jar which is referenced by the classpath, does not exist.
What can be the issue?

double-click on Tomcat server --> click on Overview of Tomcat settings appears --> "Open launch configuration" then Classpath --> under classpath...Edit User Entries here

As your Error shows bootstrap.jar is not in classpath so,
Go through eclipse-->Build path--> configure build path check your server .
Check the your server lib for given jar
If this is not resolve your problem delete your server , install again, and add your server in your new eclipse workspace project.
Hope it will help.

Try deleting the server configuration, and configure the server again.
If it doesn't work, change the server directory location.
If still issue, try un & reinstall of Tomcat. As a last option - try Tomcat 6/8 instead of 7.

you have to add class path of java in the environment variable and then add the path of your Tomcat to the PATH.

Related

How to configure JBoss server in IntelliJ with server base dir and a settings.xml

I'm trying to switch from Eclipse to IntelliJ Ultimate. But I have trouble configuring an application server.
What I have:
IntelliJ IDEA Ultimate 2020.3
a JavaEE application running on JBoss EAP 7.1
What I already achieved:
Adding an application server in Settings -> Build, Execution, Deployment -> Application Servers: I added a JBoss Server and specified the JBoss home directory
Adding a Run/Debug Configuration where I chose the JBoss server, added the artifacts which should be deployed, added some VM options, specified the JRE
Where I am stuck:
Here are the things I miss from the Eclipse configuration, and I can't find any documentation or help about that:
In Eclipse, there is a "server runtime environment" which specifies a "server base directory" and a "configuration file" (settings.xml) in addition to the server home directory and JRE. Where can I find these settings in IntelliJ?
Alternatively, there is the "launch configuration" in Eclipse, where you can define "program arguments" in addition to VM arguments. These also seem to set the server config and base dir.
Any help is highly appreciated. Thanks a lot!
There are instructions from IntelliJ site:
Application Servers
Application server run configurations
Update:
Basically you add your JBoss server
Settings->Application Servers- click + icon to add server
screenshot here
Then in run configurations you add and config your JBoss server
screenshot here

Unknown version of Tomcat was specified with tomcat -9.0.37

I downloaded the windows service installer of version 9.0.37.But at the time of connecting tomcat with eclipse IDE which is of version 2020-06 it is showing error that the version of tomcat was unspecified.
So please help me how can I configure my eclipse with tomcat-9.0.37
Look, you need to atleast open the folder once.
It will ask you the permission to enter after which it's contents will be visible to u as well as Eclipse.
So, after setting up and installing Tomcat, just go into the folder once, open it & then try connecting from Eclipse.
Instead of changing permissions, try this once!
From the WTP Tomcat FAQ: "To support searching for Tomcat runtimes, the contents of each directory being tested is checked for a set of content that uniquely identifies the version of Tomcat. These sets are based on the standard zip or tar.gz downloads from Apache. The packaged install for various versions of Linux (and even for other Operating Systems) might not quite match the expected set of files."
So get and unpack the zip file from https://tomcat.apache.org/download-90.cgi in a folder your user owns and use that instead (with its own port numbers or after disabling your Tomcat service).
I had the same problem. Later when I tried accessing the Tomcat folder from the file explorer, it said you need permissions to access this folder. This made me realize that the folder is in read-only mode.
So in the file explorer, right-click on Tomcat 9.0 folder, go to properties, click on the checkbox beside Read-only to deselect it and then click on OK.
Then again try the add server process in eclipse. It should work now.
Tomcat folder is in the following location :
C-> Program Files -> Apache Software Foundation
or wherever you have installed Tomcat.
I had first downloaded the .exe file in apache website and I had this same issue. I tried to change the permissions but it did not work so I went back to apache website and downloaded the .zip file. I extracted it to the same folder I have eclipse and closed and opened eclipse again. It worked this way.
You've to specify where the tomcat is, it can be from
a) Program files
C >> Program Files >> Apache Software Foundation
b) If tomcat is downloaded and you've zip,
Specify the Tomcat file location, don't select bin/conf folder, Tomcat won't be recognized but specify the folder of Tomcat Downloaded.
Doing any of these you can add sever in Eclipse
just try to enter C-> Program Files -> Apache Software Foundation -> tomcat ->bin and make sure there are files installed in this folder.
after that you can add the server in eclipse it will work.

Running a duplicate Java Project on Tomcat 7

I'm working on Java project for a portal. I checked out a sample portal from an svn, and pasted a renamed copy of it in the eclipse package explorer.
When I tried to run this new project on a Tomcat 7 server, I got the error message:
Could not publish server configuration for Tomcat v7.0 Server at localhost.
Multiple Contexts have a path of "/SamplePortal".
What do I need to do to get this new project to run?
All the suggestions in this thread are valid. If you extract the war file into a folder inside of Tomcat's webapps folder, it should work.
If you are trying to do it from Eclipse, make sure the file server.xml is not corrupted, or that Eclipse is not misreading it. Restart Eclipse if that is the case.
You need to change the name of your project directory or .war file so it doesn't conflict with the existing SamplePortal project.

Unknown version of Tomcat was specified in Eclipse

I want to add latest tomcat-7.0.42 in my eclipse. Probably eclipse tomcat server adapter 7 only supports tomcat version upto 7.0.12 ..
So please help me how can I configure my eclipse with tomcat-7.0.42
You are specifying tomcat source directory.
You need to specify tomcat binary installation root directory, also known as CATALINA_HOME.
Usually, this is where you untar apache-tomcat-7.0.42.tar.gz file.
This happened to me because Tomcat was still in the process of downloading (Download and Install). The message disappeared after a few minutes.
The eclipse window should really have some type of progress indicator showing download status.
To recognise your Tomcat installation folder, Eclipse is scanning for the following files:
conf/catalina.policy
conf/server.xml
conf/web.xml
conf/context.xml
conf/tomcat-users.xml
conf/catalina.policy
conf/catalina.properties
lib/catalina.jar
so make sure you're pointing to the right place and have the right read permissions.
E.g.
OS X (if installed via brew), it's: /usr/local/opt/tomcat/libexec
Linux/Ubuntu: see: Tomcat and Eclipse Integration Error
For LINUX the installation directory for Tomcat 7 is:
/usr/share/tomcat7
Please use this configuration.
More here:
http://gridlab.dimes.unical.it/lackovic/eclipse-tomcat-ubuntu-jersey/
I got the same error and resolved it by giving enough permissions to the folder. I gave full permissions by (you can try limited permissions which is enough for eclipse to run tomcat)
sudo chmod -R 777 apache-tomcat-8.5.33/
FYI, I encountered this error on my mac, but I think it should be same for ubuntu system too.
I know this is and oldie but i had this issue recently with the latest versions of Tomcat and Eclipse on Windows 10.
It was a permissions issue. All i had to do was navigate to the Tomcat install directory and open the folder. I was prompted to access the folder as an Administrator.
After this the versions were recognised by Eclipse and I could add the new runtime.
I am on MacOS and installed tomcat using homebrew, Following path fixed my problem
/usr/local/Cellar/tomcat/9.0.14/libexec
Probably, you are trying to point the tomcat directory having the source folder. Please download the tomcat binary version from here .For Linux environments, there you can find .zip and .tar.gz files under core section. Please download and extract them. after that, if you point this extracted directory, eclipse will be able to identify the tomcat version. Eclipse was not able to find the version of tomcat, since the directory you pointed out didn't contain the conf folder. Hope this helps!
As soon as you provide the directory where Tomcat needs to be installed and click ok you can notice download and installation starts in the progress tab of Eclipse.
Let the process complete.The error will automatically disappear.
Note: It is not mandatory to name your folder CATALINA_HOME. I have tested this with windows. Cannot assert the same for Linux but IMO same rule should apply.
Just in case...
Apache Tomcat 8.5.X is not compatible with Apache Tomcat 8.0 server selection in eclipse. And it gives this error.
Go to "Window -> preferences -> Server -> Runtime Environments"
Remove the existing servers they might not have downloaded completely.
Add new Server
For Windows Users,
Use the Tomcat Service Installer from the Apache tomcat downloads page. You will get a .exe file. which Installs the service for windows. It will usually install Apache tomcat at "C:\Program Files\Apache Software Foundation\Tomcat 8.0" and its easily recognized in eclipse.
Having installed tomcat with brew the solution for me was:
sudo chmod -R 777 /usr/local/Cellar/tomcat/<your_version>
In my case I used wrong directory, the right one is lib exec and my path:
/usr/local/Cellar/tomcat#7/7.0.96/libexec
You are pointing to the source directory. You can run a build by running ant from that same directory, then add '\output\build' to the end of the installation directory path.
It may be due to the access of the tomcat installation path(C:\Program Files\Apache Software Foundation\Tomcat 9.0) wasn't available with the current user.
Since this is evidently happening on Linux, this would be because your dev user might not have read access to Tomcat's installation directory. That's because Tomcat's installation directory (let's say it is pointed to by CATALINA_HOME) is owned by tomcat:tomcat while your dev user is something that's neither tomcat nor one that belongs to the tomcat group. Therefore Eclipse fails to read ${CATALINA_HOME}/conf/catalina.policy.
The following should fix the permission issue:
sudo find ${CATALINA_HOME} -type d -exec chmod o+rx {} \;
Why do we need the execute bits? Because to traverse a directory and reach its descendants, you need execute permissions. In your case, if CATALINA_HOME isn't yet set, replace the actual installation directory (/opt/tomcat/apache-tomcat-<version> maybe?) in the above.
For Windows
Just open the (tomcat xx.x) folder once and check if you can see all other root folders while selecting folder.
Sometimes windows wont give access to this folder

Starting JBoss 7.1.1 from eclipse fails

When starting JBoss from the servers view inside Eclipse Indigo SR2 with JBoss Tools 2.3.0 on my machine, everything runs fine.
I have copied all contents of my work folder containing Eclipse and JBoss-7.1.1.Final to a different machine.
Now, when I try to start the server, it fails with this message:
Starting JBoss 7.1.1 Runtime encountered an error. The archive: /jboss/jboss-modules.jar which is referenced by the classpath, does not exist.
I don't see anything referencing the jar in the runtime or server or project configurations. And the jboss-modules.jar is inside the root folder of the JBoss server, as expected. There are no deployments in the standalone.xml.
Both machines are running SuSe 12. .bashrc and .profile are empty.
The server starts fine from command line.
I have created a new runtime and a server using this runtime from scratch in Eclipse, but get the same error.
Any ideas are appreciated.
modules.jar is required to run JBOSS 7.1 Runtime, which is missing.
Go to Window > Preferences > Server > Runtime Environment > Default Classpath.
If you don't see any classpath in the right side menu,you can tweek the classpath setting by-
Change server to JBOSS 7.0 Runtime.
Again Change server to JBOSS 7.1 Runtime.
Delete and Add Server Again,
while Add new server,
Please Check the 2nd and 3rd checkboxes
-"Listen on all Interfaces to allow remote web connections"
-"Expose your management port as server's hostname"
now everything will run fine.
I have found the solution just now:
I have found the reference to the jboss-modules.jar in the launch configuration of the server under User Libraries. All attempts to delete it failed. After removing or resetting to defaults and applying, I started the server, received the same error and the .jar was in the launch cofig classpath again.
I actually had a project named jboss without any facets, just to have the JBoss files visible from the eclipse project browser. This project was closed.
After I opened it, the server started fine again.
I am still clueless about how the reference to the jboss-modules.jar from a project got into the launch config classpath and why it resisted removing attempts.
I know this is a late response but in case anyone needs a solution to this issue.
If you go to Window > Preferences > Servers > Runtime Environments > Default Classpath
You will see that the 'JBoss 7.0 Runtime' does not have 'modules../-[*/.jar]' dependency, which is where the jboss-modules.jar lives. After selecting the 'JBoss 7.0 Runtime' rather than the JBoss 7.1 Runtime, the error relating to the jboss-modules.jar went away, and the server starts without error.
My application also started without error. I am using JBoss 7.1.1.

Categories