Comments (21)
Release 9.1.7 is published.
from tomcatplugin.
Marketplace is showing version 9.1.7 now.
from tomcatplugin.
Actually, it was a bit more than that.
diff --git a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatBootstrap.java b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatBootstrap.java
index 27667da..8c7eb93 100644
--- a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatBootstrap.java
+++ b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatBootstrap.java
@@ -41,6 +41,8 @@ import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.JavaNature;
+import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jdt.launching.JavaRuntime;
import net.sf.eclipse.tomcat.editors.ProjectListElement;
@@ -166,42 +168,46 @@ public abstract class TomcatBootstrap {
if (tomcatProject != null) {
ArrayList webappClasspathFile = new ArrayList();
ArrayList visitedProjects = new ArrayList(); /*IMC*/
- IJavaProject javaProject = (IJavaProject) projects[i].getNature(JavaCore.NATURE_ID);
- WebClassPathEntries entries = tomcatProject.getWebClassPathEntries();
-
- IFile file = null;
- if (tomcatProject.getRootDirFolder() == null) {
- file = projects[i].getFile(new Path(WEBAPP_CLASSPATH_FILENAME));
- } else {
- file = tomcatProject.getRootDirFolder().getFile(new Path(WEBAPP_CLASSPATH_FILENAME));
- }
-
- File cpFile = file.getLocation().makeAbsolute().toFile();
- if (cpFile.exists()) {
- cpFile.delete();
- }
-
- if (entries != null) {
- getClassPathEntries(javaProject, webappClasspathFile, entries.getList(), visitedProjects);
-
- if (tomcatProject.getMavenClasspath()) {
- collectMavenDependencies(javaProject, webappClasspathFile, new ArrayList());
+
+ if (projects[i].hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject javaProject = JavaCore.create(projects[i]);
+
+ WebClassPathEntries entries = tomcatProject.getWebClassPathEntries();
+
+ IFile file = null;
+ if (tomcatProject.getRootDirFolder() == null) {
+ file = projects[i].getFile(new Path(WEBAPP_CLASSPATH_FILENAME));
+ } else {
+ file = tomcatProject.getRootDirFolder().getFile(new Path(WEBAPP_CLASSPATH_FILENAME));
}
-
- if (!webappClasspathFile.isEmpty()) {
-
- try {
- if (cpFile.createNewFile()) {
- PrintWriter pw = new PrintWriter(new FileOutputStream(cpFile));
-
- for (int j = 0; j < webappClasspathFile.size(); j++) {
- //TODO
- pw.println(webappClasspathFile.get(j));
+
+ File cpFile = file.getLocation().makeAbsolute().toFile();
+ if (cpFile.exists()) {
+ cpFile.delete();
+ }
+
+ if (entries != null) {
+ getClassPathEntries(javaProject, webappClasspathFile, entries.getList(), visitedProjects);
+
+ if (tomcatProject.getMavenClasspath()) {
+ collectMavenDependencies(javaProject, webappClasspathFile, new ArrayList());
+ }
+
+ if (!webappClasspathFile.isEmpty()) {
+
+ try {
+ if (cpFile.createNewFile()) {
+ PrintWriter pw = new PrintWriter(new FileOutputStream(cpFile));
+
+ for (int j = 0; j < webappClasspathFile.size(); j++) {
+ //TODO
+ pw.println(webappClasspathFile.get(j));
+ }
+ pw.close();
}
- pw.close();
+ } catch (IOException e) {
+ e.printStackTrace();
}
- } catch (IOException e) {
- e.printStackTrace();
}
}
}
diff --git a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatLauncherPlugin.java b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatLauncherPlugin.java
index 19a6eb1..3b31d42 100644
--- a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatLauncherPlugin.java
+++ b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/TomcatLauncherPlugin.java
@@ -424,7 +424,7 @@ public class TomcatLauncherPlugin extends AbstractUIPlugin {
IProject project = allProject;
try {
if((project.isOpen()) && project.hasNature(JavaCore.NATURE_ID)) {
- IJavaProject javaProject = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
+ IJavaProject javaProject = JavaCore.create(project);
if(!alreadyAdded.contains(project))
{
tempList.add(new ProjectListElement(javaProject.getProject()));
diff --git a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/VMLauncherUtility.java b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/VMLauncherUtility.java
index 4551704..e5677e8 100644
--- a/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/VMLauncherUtility.java
+++ b/net.sf.eclipse.tomcat/src/net/sf/eclipse/tomcat/VMLauncherUtility.java
@@ -238,7 +238,8 @@ public class VMLauncherUtility {
IProject project = ((ProjectListElement) iter.next()).getProject();
traceBuffer.append("Project " + project.getName());
if ((project.isOpen()) && project.hasNature(JavaCore.NATURE_ID)) {
- tempList.add(project.getNature(JavaCore.NATURE_ID));
+ IJavaProject javaProject = JavaCore.create(project);
+ tempList.add(javaProject);
traceBuffer.append(" added to tempList\n");
}
}
This works with Eclipse 2024-03, but I have not tested this with previous versions.
from tomcatplugin.
Same here since i updated eclipse to 2024-03 eclipse on Ubuntu
from tomcatplugin.
Yea, I got exactly the same problem.
from tomcatplugin.
Same here. I'm wondering, is the necessary change as simple as
This was the wrong diff anyway :-)
I have no idea about plug-in development and even less clue about how to test this.
from tomcatplugin.
Hi rkurman, it seems to me that the second diff just reverts the first one.
from tomcatplugin.
Hi rkurman, it seems to me that the second diff just reverts the first one.
Yes, I have literally no control over my Copy/Paste abilities. :-) The comment should be ok now.
from tomcatplugin.
Now the diff in #42 (comment) is what you had before in #42 (comment)
from tomcatplugin.
Now the diff in #42 (comment) is what you had before in #42 (comment)
Yes, but it is the correct one. Apologies for the confusion.
from tomcatplugin.
So far I managed to confirm that the patch works for both Eclipse 2024-03 and 2023-06.
But it works for me as well if I only apply the patch of class VMLauncherUtility.
@rkurman Could you test that, too?
from tomcatplugin.
@tillneum When only patching VMLauncherUtility
, I still get exceptions at the other two places TomcatBootstrap
and TomcatLauncherPlugin
. So, I am not sure why it would behave differently, but my setup definitely needs the full patch.
from tomcatplugin.
Thank you.
from tomcatplugin.
@rkurman If the patch provided by you works you could open a pull request to be merged in here. @tillneum: Are you capable of building a release?
from tomcatplugin.
There is no need to open a merge request, because I have the patch in my dev workspace. And yes, I'll build a new release soon.
from tomcatplugin.
Fine :) @tillneum
from tomcatplugin.
Thanks for the fix!!
from tomcatplugin.
Awesome, thank you! Do you know how long it will take until it will be available in the Eclipse Marketplace?
from tomcatplugin.
I just updated the listing in the Marketplace.
from tomcatplugin.
Sorry for my ignorance, but the Marketplace still offers version 9.1.4. Is there a way to refresh some cache, or does it take some time to become active?
from tomcatplugin.
Might be a cache problem in the market place. For me the eclipse update worked. So even if the market place installs an older version, the update sites seem to deliver the current version.
from tomcatplugin.
Related Issues (20)
- com.sysdeo.eclipse.tomcat_3.3.1.jar HOT 1
- tomcat HOT 1
- How to add JVM arguments when start tomcat HOT 1
- Tomcat HOT 1
- Unable to open "JVM Settings" in Preferences in Eclipse 2020-09 HOT 4
- Add support for Tomcat 10 HOT 4
- Wont work on Unbuntu HOT 2
- Plugin does not add all projects to classpath HOT 3
- Path attribute in context file unnecessary HOT 1
- Unable to install using Eclipse jee-2021-032 HOT 5
- Remove path attribute from context.xml HOT 4
- How to export the .war? HOT 2
- New icons HOT 3
- add ability to set java environment for tomcat HOT 1
- Support project specific selection of Tomcat version, and JVM version
- Tomcat 10 version HOT 2
- Upgrading to 202403
- tomcat HOT 1
- Project properties cannot be configured on Eclipse 4.31 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomcatplugin.