Giter Club home page Giter Club logo

Comments (21)

tillneum avatar tillneum commented on June 3, 2024 4

Release 9.1.7 is published.

from tomcatplugin.

jochenw avatar jochenw commented on June 3, 2024 4

Marketplace is showing version 9.1.7 now.

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024 2

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.

matthijslambooy avatar matthijslambooy commented on June 3, 2024

Same here since i updated eclipse to 2024-03 eclipse on Ubuntu

from tomcatplugin.

The-Arne avatar The-Arne commented on June 3, 2024

Yea, I got exactly the same problem.

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024

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.

tillneum avatar tillneum commented on June 3, 2024

Hi rkurman, it seems to me that the second diff just reverts the first one.

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024

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.

tillneum avatar tillneum commented on June 3, 2024

Now the diff in #42 (comment) is what you had before in #42 (comment)

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024

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.

tillneum avatar tillneum commented on June 3, 2024

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.

rkurman avatar rkurman commented on June 3, 2024

@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.

tillneum avatar tillneum commented on June 3, 2024

Thank you.

from tomcatplugin.

markuskeunecke avatar markuskeunecke commented on June 3, 2024

@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.

tillneum avatar tillneum commented on June 3, 2024

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.

markuskeunecke avatar markuskeunecke commented on June 3, 2024

Fine :) @tillneum

from tomcatplugin.

matthijslambooy avatar matthijslambooy commented on June 3, 2024

Thanks for the fix!!

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024

Awesome, thank you! Do you know how long it will take until it will be available in the Eclipse Marketplace?

from tomcatplugin.

markuskeunecke avatar markuskeunecke commented on June 3, 2024

I just updated the listing in the Marketplace.

from tomcatplugin.

rkurman avatar rkurman commented on June 3, 2024

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.

The-Arne avatar The-Arne commented on June 3, 2024

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)

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.