Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve user experience (i.e.: documentation) when migrating from STS3 #340

Closed
mauromol opened this issue Aug 12, 2019 · 13 comments
Closed
Milestone

Comments

@mauromol
Copy link

I'm here again with a lot of questions! :-)
I know the issue title is not very descriptive, so I'm going to try to explain my point of view/use case. Please feel free to split into more focused issues if you prefer.

Now that #96 and #108 have brought support for non-boot projects and (at least partial) XML config, I decided to give STS4 a try. So, I'm trying to "migrate" my Eclipse projects from STS3 to STS4 tooling.

Unfortunately I don't see any progress on #113, which perhaps could have helped me a bit to make the move.

So, let's start with the questions.

STS4 installation from the update site

I don't like the idea to install STS4 distribution, I prefer to build my Eclipse installation from scratch, just installing the plugins I want through update sites. I have been doing this for years.
First of all, the page at:
https://spring.io/tools
doesn't mention this possibility. You have to click on "User guide, installation instructions, FAQ" after scrolling the page a bit to get to:
https://github.com/spring-projects/sts4/wiki
and then, clicking on "Installation (latest release)" you get to:
https://github.com/spring-projects/sts4/wiki/Installation
Here, the guide talks about the existence of the update sites, but doesn't give any hint on what to install.
If in Eclipse I try to install software from that update site, I get the following categories:

  • Core / Eclipse Integrations Commons
  • Extensions / Spring IDE
  • Resources / Spring IDE
  • Spring Tool Suite 4 Distribution
  • Spring Tool Suite 4 Language Server Integrations for Eclipse
  • Uncategorized

These are a lot of categories! So, my first doubt was: what should I install??
Under "Spring Tool Suite 4 Distribution" there are "Spring Tool Suite 4 Main Feature" and "Spring Tool Suite 4 Branding Feature". The latter one sounds to me like pure "marketing" (perhaps logos, splash screens, whatever), so "Main Feature" sounds more appropriate. However, it's not clear to me which features I will get with it which I won't.
For instance, in Core / Eclipse Integrations there are:

  • Eclipse Integration Commands - Livexp (?)
  • Eclipse Quicksearch (I know this and I love it)
  • Spring Tool Suite Common UI Components (what is it for? Isn't installed automatically?)
  • SpringSource Tool Suite (Core) (this sounds like STS3 core?)
  • SpringSource Tool Suite Framework Support (UI) (what is it for? Isn't installed automatically?)
  • SpringSource Tool Suite Framework Support Core (what is it for? Isn't installed automatically?)

Apart from the Quicksearch, which is a known component of its own, are the other needed? Will they be installed as part of the "STS4 Main Feature"?
The confusion is augmented by the fact that all these plugins are versioned as 3.9.10 (STS3?) rather than 4.3.1...

Also, in "Extensions / Spring IDE" I find:

  • Spring IDE Boot Microservices Dash (I think this is needed if you use microservices with Spring Boot)
  • Spring XML Namespace Support

For my use case (webapp with Spring and XML config) I think the last one is really needed, but what still confuses me is the version number (3.9.10), which makes me wonder whether that component is indeed the legacy STS3 XML config support component rather than the new one implemented in #108.

On the other hand, versions seem to be 4.3.1 for packages under "Spring Tool Suite 4 Language Server Integrations for Eclipse" category, but here again there are a lot of components which are not easy to understand from a user point of view: what do I need and what I don't? Package details don't help (they are simply equal to the package names, without any further details).

I know I'm following an "expert path", but I must confess it has never been so hard to understand what I should install and what I could omit with any other Eclipse plugin I tried so far. Indeed, it was much easier with STS3 itself to combine your own installation through the update site.

Using a JDK instead of a JRE to run Eclipse

The page at:
https://github.com/spring-projects/sts4/wiki/Known-Limitations-&-Issues
suggests that in order for some features to work, running Eclipse with a JDK instead of a JRE is required. However, is there a way to see if the requirement is satisfied? I mean, if I configure Eclipse to run with the server.dll library contained in the jre folder of the JDK (which ensures better integration with the Windows process manager), does it satisfy the requirement?
Example:

-vm
C:/Program Files/Java/jdk1.8.0_202/jre/bin/server/jvm.dll

Using STS4 on an existing project

The user guide talks about how to create new Spring projects with the Starter projects. But I can't find any mention of what to do when you're dealing with an existing project. This is especially confusing when you come from STS3, where you had to configure a project nature and you could set up some project configuration like the list of XML Bean config files for your project, automatic detetction through classpath scanning and so on.
So, reading this:
https://stackoverflow.com/questions/49201689/enable-spring-project-nature-in-sts-4-to-fix-xml-schema-problems
I see that there's no Spring nature any more.
By the way, in my projects I had previously already removed the Spring nature because of the following problems in STS3:

So, with STS4 it seems like I should expect "everything" to work (I mean, the XML support features that were implemented) out of the box, without configuring anything on my project. Some clarifications in the User guide would have helped though. Especially because it seems like I have some issues with XML file schema validations: the above SO question was written at the times of STS 4.0, but now we're at 4.3.1 and from #108 I would expect STS4 to detect the latest shemas of Spring Integration from the classpath, but I have some validation errors like the following:

<int-ws:outbound-gateway
  id="myWsOutboundGateway"
  request-channel="myWs.webServiceRequestChannel"
  reply-channel="myWs.webServiceResponseChannel"
  marshaller="myWsMarshaller"
  uri="${myWs.url:https://www.example.com/myWs}"
  message-sender="myWsMessageSender" 
  header-mapper="myWsHeaderMapper" />

The error says: cvc-complex-type.3.2.2: Attribute 'header-mapper' is not allowed to appear in element 'int-ws:outbound-gateway'., but I'm using Spring Integration 4.3.x which does support that attribute (all works fine at runtime).
Again, in the above SO question Martin suggests to use versioned schemas in the namespace declarations, which is generally not recommended however.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Nieraj Singh:)

I've split this item into three components to work on.

  1. The current one now just covers "Using STS4 on an existing project"
  2. Improving documentation on installing STS4 components into base Eclipse: https://www.pivotaltracker.com/story/show/170245267
  3. Using JDK: https://www.pivotaltracker.com/story/show/170245300

@mauromol
Copy link
Author

Thanks Nieraj for taking this and Kris for #397.

I just wanted to say that indeed I'm still stuck at this: I still feel like my Eclipse 2019-06 installation with a bunch of STS4 4.4.2 and STS3(?) 3.9.11 bundles is not working as expected with my Spring projects, although I have to admit that I didn't try to fix this myself a lot during the last months.
With #397 I can now say that the problem is not related to the JDK requirement, but I still have many doubts regarding the plugins installation and the steps I should take to test/try/experiment whether STS4 tooling is actually working or not on my projects.

@martinlippert
Copy link
Member

@mauromol If you can create a few slimmed down sample projects that you can share with us, we could have a more in-depth look at those projects, too, and provide feedback. Just as an additional option.

@mauromol
Copy link
Author

mauromol commented Jan 8, 2020

Hi Martin,
I really think that the first thing I should check is my STS4 installation, so the second point highlighted by Nieraj. In this way I can experiment with my projects (and possibly extract use cases) with the certainty that I'm not just using a broken set of plugins on my Eclipse installation...

So any progress on the STS4 installation documentation on base Eclipse (or at least some guidance) would be much appreciated.

@martinlippert
Copy link
Member

@mauromol I added more details to the installation wiki page, hope that helps: https://github.com/spring-projects/sts4/wiki/Installation#spring-tool-suite-4-the-eclipse-based-distribution

@mauromol
Copy link
Author

mauromol commented Jan 9, 2020

Hi Martin,
this helped, thank you. I added a couple of features and here is how my installation looks like now:

immagine

Then I went back to the XML files that I mentioned in my original report and this is what I see:

  • the Spring Integration schemas in the classpath are now found and applied correctly, I do not have the error about missing header-mapper on <int-ws:outbound-gateway> any more
  • content-assist for packages, classes, interfaces, properties and bean references does not work
  • navigation for fully qualified class names works
  • navigation for property names and bean references does not work

So, regarding content assist and navigation, it seems like I'm just relying on the standard Eclipse XML features. I don't know if this is expected, but this is what I see in the XML content assist configuration page:

immagine

That is, I can't see anything related to Spring.

Another question: how can I see if there's some "Spring Boot Language Server" process running on my system? And also, is it supposed to run even for non-Boot applications? (as I said, I'm using a plain Dynamic Web Project).

@martinlippert
Copy link
Member

There are various options to check for a running spring-boot-language-server process. You can use the jps command from the JDK to list all running Java processes on your system. That should list the spring-boot-language-server process, if it is running.

Another option is to enable the logging of the spring-boot-language-server (in the Preferences -> Language Server -> Spring Language Server, check the Spring Boot one. That results in a new console view being opened for the running language server that shows the log. It is mostly showing internal stuff, but at least you can easily see whether the language server is running or not.

With regards to the missing content-assist, I guess this is related to your XML file not being recognized as a Spring-related XML file - which is most likely a limitation on our side that we should fix. Can you attach a sample XML file for which content-assist doesn't work? That would be awesome.

@mauromol
Copy link
Author

mauromol commented Jan 9, 2020

Indeed with VisualVM I see a Java process with org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp main class currently running, so I guess it's ok. This "Spring Boot Language Server" is supposed to run even when dealing with non-Boot projects, isn't it?

The xml file is an applicationContext XML file. This is an excerpt:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:jms="http://www.springframework.org/schema/jms" default-lazy-init="true"
	xmlns:task="http://www.springframework.org/schema/task"
	xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xmlns:amq="http://activemq.apache.org/schema/core"
	xsi:schemaLocation="http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd">

	<!-- Load configuration properties -->
	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="ignoreUnresolvablePlaceholders" value="true" />
		<property name="locations">
			<array>
				<value>classpath:/conf/datasource.properties</value>
				<value>classpath:/conf/shop.properties</value>
			</array>
		</property>
		<property name="propertiesArray">
			<array>
				<ref bean="commonConfigurationProperties" />
				<ref bean="configurationProperties" />
			</array>
		</property>
	</bean>
	
	<bean id="commonConfigurationProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
		<property name="properties">
			<value>
				productionModeEnabled=false
				systemMail.dcsBackendUserRecipientAddress=example@example.com
				systemMail.senderAddress=ACME &lt;noreply@example.com&gt;
			</value>
		</property>
	</bean>

	<bean id="configurationProperties" abstract="true"
		class="org.springframework.beans.factory.config.PropertiesFactoryBean" />

	<context:annotation-config />
	<context:component-scan base-package="it.dcssrl" />
	<tx:annotation-driven proxy-target-class="true" />

	<!-- [CUT] -->

	<!-- Import other common configuration files -->
	<import resource="classpath:context/applicationContext-shopCommon-jms.xml" />
</beans>

Of course I'm trying code assist and navigation on <bean> namespace elements, I know there's no support right now for custom namespaces.

@martinlippert
Copy link
Member

(btw, the mentions above was a mistake, please ignore)

@martinlippert
Copy link
Member

The good news here is: I tried your XML file and content-assist works for me when I use this inside of a Dynamic Web Project. The bas news: there must be a difference somewhere that prevents this from working for you.

I would suggest to submit a new issue for this (since this is not really related to user documentation anymore) and attach a small sample project that could help us to reproduce the issue.

@martinlippert
Copy link
Member

It would also be helpful to enable the log output of the language server via Preferences -> Language Servers -> Spring Language Servers and attach that output to the new GitHub issue as well.

@martinlippert
Copy link
Member

I added a new page to the user guide wiki that specifically addresses questions and issues when moving a workspace from Spring Tool Suite 3 to the Spring Tools 4 for Eclipse here: https://github.com/spring-projects/sts4/wiki/STS3-Migration

Therefore I am closing this item here now. Please open additional enhancement requests against the newly created wiki page if you come across additional questions or would like to share your experiences with the community. Contributions to that page are also highly welcome.

I am sorry that this took so long. Hope the new wiki page helps the community to further adopt the Spring Tools 4 for Eclipse.

@mauromol
Copy link
Author

Hi Martin,
thank you for the new wiki page, I think it's really useful to make the migration path more clear.

Sorry for not getting back to you with my problem with the broken XML file editing in my main project. I wasn't able yet to understand what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants