Giter Club home page Giter Club logo

tomcatplugin's Introduction

Logo Eclipse Tomcat Plugin       Codacy Badge  SourceForge  Apache License  Project of the Month

The Eclipse Tomcat Plugin provides simple integration of a Tomcat servlet container for the development of Java web applications.

This project is an actively maintained fork of the original Sysdeo Tomcat Plugin.

Features

  • Start and Stop toolbar icons
  • Debugging support
  • Easy setup

Installation

This plugin is available at the Eclipse Marketplace

Alternatively you can use the update site at https://devtools.his.de/tomcatplugin/updatesite

After the plugin was installed, please go to Window | Preferences | Tomcat and configure the path of your Tomcat installation.

Screenshots

Starter
Start, stop and restart Tomcat quickly from the toolbar.

Recent changes

  • Version 9.1.6
    • Feature: New icons
  • Version 9.1.5
    • Bugfix: Unable to open "JVM Settings" in Preferences in Eclipse 2020-09
  • Version 9.1.4
    • Bugfix: Persisting root and work directory works now for "Tomcat projects"
    • Bugfix: When a project is added to Tomcat's system classpath, add Tomcat's libraries to the system classpath, too.
  • Version 9.1.3
    • Feature: Signed jars
  • Version 9.1.2
    • Bugfix: webClassPathEntries can't be cleared
  • Version 9.1.1
    • Bugfix: Debug View shows "Tomcat 7.x" for Tomcat 8.x and 9.x
    • Bugfix: DevLoader does not work on Tomcat 8.5.4
    • Bugfix: Update Context fails with error if optional work dir is not specified
  • Version 9.1.0
    • Bugfix: fix Eclipse Neon compatibility issue
    • Feature: Support for Maven classpath management added
  • Version 9.0.1
    • Bugfix: fix compatibility issue with Eclipse Neon
  • Version 9.0.0
    • Feature: Add support for Tomcat 9
    • Change: The version number will now reflect the highest supported Tomcat version.

tomcatplugin's People

Contributors

boulik avatar conikost avatar croger42 avatar jochenw avatar markuskeunecke avatar nhnb avatar pmclaren avatar tillneum avatar yuezk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tomcatplugin's Issues

New icons

Coud you build and update the plugin with the latest enhancements like new icons.
TY

Add support for Tomcat 10

Since Tomcat 10 started to release its first milestone builds, we should support Tomcat 10 in future.

Unable to start tomcat after eclipse 2024-03 update

I recently updated to eclipse version 2024-03 (4.31) and not able to start tomcat using the eclipse tomcat plugin since then.

I get these two errors in the eclipse error log whenever I try to start tomcat.

Impossible to start Tomcat
Check home directory setup in Tomcat preference page/n

image

java.lang.ClassCastException: class org.eclipse.jdt.internal.core.JavaNature cannot be cast to class org.eclipse.jdt.core.IJavaProject (org.eclipse.jdt.internal.core.JavaNature and org.eclipse.jdt.core.IJavaProject are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4f68e955)
	at net.sf.eclipse.tomcat.TomcatBootstrap.runTomcatBootstrap(TomcatBootstrap.java:169)
	at net.sf.eclipse.tomcat.TomcatBootstrap.start(TomcatBootstrap.java:112)
	at net.sf.eclipse.tomcat.actions.StartActionDelegate.run(StartActionDelegate.java:43)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:239)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:581)
	at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:454)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4274)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)

image

Tomcat 10 version

Any chance to upgrade devloader to Tomcat 10 (jakarta API).

The last version I have is DevLoaderTomcat85.jar, which also works fine in Tomcat 9.

In 10, it obviously fails with

Caused by: java.lang.NoSuchMethodError: 'javax.servlet.ServletContext org.apache.catalina.Context.getServletContext()'
	at org.apache.catalina.loader.DevLoader.getServletContext(DevLoader.java:196)

Tomcat home points to symbolic link

My Tomcat home in Eclipse preferences points to /usr/local/opt/tomcat/libexec, which is a symbolic link to the actual tomcat folder.

lrwxr-xr-x  1 mystygage  admin    23B Feb  8 13:54 tomcat -> ../Cellar/tomcat/9.0.16

Every time I open the pref pane there is an error "Value must be an existing directory" shown above the Tomcat version, even if the symlink didn't change. If I click in the input field for Tomcat home folder, the error message goes away.

This error does not affect the functionality of the plugin, but the message is irritating

Unable to install using Eclipse jee-2021-032

Here is the error when I'm using Eclipse jee_2021-032 to install this plug in:

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:336)
at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:293)
at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:185)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:171)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1418)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1324)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:440)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:411)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.eclipse.ecf.provider.filetransfer.httpclient45.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:248)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:71)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

add ability to set java environment for tomcat

In some my projects, I need to run Tomcat under Java version 8, in others - version 11 or 17. It would be very convenient to be able to select a Java environment before starting Tomcat

Remove path attribute from context.xml

The context.xml, that is created with "Update context definition" in the projects context menu, looks like this:

<Context path="/iaas" reloadable="true" docBase="C:\Work\git\Labcase\Iaas\src\wx-iaas-parent\wx-iaas-vaadin-ui\target\iaas-vdn-webapp" workDir="C:\Work\git\Iaas\src\wx-iaas-parent\wx-iaas-vaadin-ui\target\iaas-vdn-webapp-work" />

This used to be correct, but isn't for later version of Tomcat, (Don't know exactly when, I reproduce this with 9.0.54.)
where the context path is derived from the name of the context.xml, rather than the path attribute. If the attribute is
present, the following message is being logged:

The path attribute with value [/iaas] in deployment descriptor [C:\opt\apache-tomcat-9.0.54\conf\Catalina\localhost\iaas.xml] has been ignored

Upgrading to 202403

Hello,

I had a problem with my version of the original plugin, and though I would give a heads up.

Big thanks to @iloveeclipse for helping.

The TomcatProjectPropertyPage getJavaProject() method :

protected IJavaProject getJavaProject() throws CoreException {

    IProject project = (IProject) (this.getElement().getAdapter(IProject.class));
    return (IJavaProject) (project.getNature(JavaCore.NATURE_ID));

}

needs to do it something like this in 202403:

protected IJavaProject getJavaProject() throws CoreException {

    IProject project = (IProject) (this.getElement().getAdapter(IProject.class));

    IProjectNature nature = project.getNature(JavaCore.NATURE_ID);
    if (nature != null) {
         return JavaCore.create(project);
    } else {
        // return null;
        String msg = "Cannot get IJavaProject";
	Status status = new Status(IStatus.ERROR, TomcatLauncherPlugin
		.getDefault().getBundle().getSymbolicName(), IStatus.ERROR,
		msg, null);
	throw new CoreException(status);
    }
}

See eclipse-pde/eclipse.pde#1215

ClassNotFoundException: org.apache.catalina.loader.DevLoader

When starting up, my context will not load due to:

Caused by: java.lang.ClassNotFoundException: org.apache.catalina.loader.DevLoader
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:104)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1200)
... 58 more

If I understand correctly, this class is within your library however obviously is not available to tomcat.

How is DevLoader supposed to be loaded into tomcat prior to my context loading? why isn't this happening?

Wont work on Unbuntu

I cant get this plugin working on a ubuntu 18.04.5 LTS
$CATALINA_HOME and $CATALINA_BASE are separated.
conf is located in $CATALINA_BASE
There are two JDK Installations 8 and 11. Tomcat is required to use 8.
I always got "Impossible to start Tomcat"

Both directories are set correctly, btw. conf should be located in $CATALINA_BASE not ..HOME
Symlinked to CATALINA_HOME to go around this problem
All access rights are correct.
Assumed to not be required to set CLASSPATH for Standalone startup, however with or without adding classpath it will not start.

Support project specific selection of Tomcat version, and JVM version

It is nowadays more than common to have more than one version of a project in the workspace, that support the various versions of the servlet standard (javax.servlet, jakarta.servlet 5.x, and 6.x)

This is typically solved by having various Projects, that all depend on a common core, where the core is agnostic of the servlet API.
In general, that works fine, but the problem here is, that the selection of Tomcat version, and JVM version are global. In other words, the
started Tomcat will, by definition, work for only one of these projects. So, upon switching projects, I need to:

  1. Shutdown the running Tomcat.
  2. Adjust the global preferences to meet the next projects requirements.
  3. Start Tomcat again.

A much better approach would be, if we could have project specific settings for Tomcat, and JVM. (Ideally, we could have several Tomcats running at the same time, in which case we could also need a setting for the port number.)

UI: The classic buttons would still act on the Tomcat from the global preferences. However, if a project has specific settings for Tomcat, or JVM, then the projects context menu would also have entries for starting, and stopping the projects Tomcat.

Not clear what you mean by "path of your Tomcat installation"

It is not clear what you mean by "path of your Tomcat installation" -- is that the binary? the URL?

I installed tomcat 9 using homebrew on macOS. I have two ways of starting tomcat. At startup after running:
brew services start tomcat
Or:
catalina run

Or do you mean where the server.xml file should be located?
How do I specify my .war file?
Unfortunately the dialog isn't helping.
screenshot

High resolution icons

The icons for the toolbar are very pixelated, especially when you are working with a dark theme.
screenshot 2019-02-18 at 14 13 36

How to perform the same execution the plugin does but with the console

So this is the deal, I am using the net.sf.eclipse.tomcat.updatesite-2016-04-19 plugin (I know it's an older version but help me out) and I'm running an application that I just recently migrated to tomcat 8.5. What happens is that when I run the application with the plugin it does so perfectly but when I build the .war, put it in webapps and run the "./catalina.sh run" the app doesn't start up. I noticed that the plugin loads a lot of jars from .m2 and does many other things that somehow makes it possible for the application to actually run and that's why I need to know exactly how the plugin executes the webapps, so I can perform the same process using a command line and not eclipse directly.

Please help.
Thank you.

Path attribute in context file unnecessary

The Tomcat plugin is configured with context declaration mode context files. I have a project configured with app. This creates a XML file app.xml with the following content:

<Context path="/app" reloadable="false" docBase="/Users/user/Projects/git/app-folder" workDir="/Users/user/Projects/git/app-folder/work" />

At least for Tomcat 9 the path attribute in context files is unnecessary. Tomcat starts with this warning:

WARNING: The path attribute with value [/app] in deployment descriptor [tomcat/conf/Catalina/localhost/app.xml] has been ignored

Omitting the path attribute removes the warning.

How to export the .war?

No entiendo nada, ¿por qué no ponen manuales ni guías? Esto es un auténtico lío y dolor de cabeza

Plugin does not add all projects to classpath

Hi,

In the latest version of the plugin (version 9.1.5) if there are two or more projects selected in the "Add Java projects to Tomcat classpath" list of Tomcat >> Advanced settings, the generated classpath only has reference to the latest project from the list and its dependencies. The references to the other projects from the list are not present in the classpath generated.

A version of the plugin that was working fine is 9.1.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.