tomcatplugin / tomcatplugin Goto Github PK
View Code? Open in Web Editor NEWTomcat plugin for Eclipse
License: Other
Tomcat plugin for Eclipse
License: Other
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
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.
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
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)
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.
No entiendo nada, ¿por qué no ponen manuales ni guías? Esto es un auténtico lío y dolor de cabeza
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
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
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.
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);
}
}
How to add tomcat button to star, stop and restart tomcat server in eclipse
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)
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.
In project properties -> DevLoader classpath, there if i uncheck "Use SMART! maven classpath". If I uncheck it and apply, it is checked again when i return.
Since Tomcat 10 started to release its first milestone builds, we should support Tomcat 10 in future.
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)
Coud you build and update the plugin with the latest enhancements like new icons.
TY
WebClassPathEntries will not be cleared even though Tomcat project be restarted in a DevLoader uncheck all state.
tomcatplugin v9.1.0
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.
There is only one tomcat project and any java projects in my workspace.
The java projects has class file but not builded to jar.When I start tomcat by tomcat plugin,
how can I load the java projects?
I want to run my tomcat server using tomcat plugin with JVM arguments (-Dxxx=yyyy). How would I do it in Tomcat plugin?
Many Thanks.
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?
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:
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.
Unable to open "JVM Settings" in Preferences in Eclipse 2020-09 (4.17.0).
The following error message is displayed:
Could Not Accept Changes
The currently displayed page contains invalid values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.