...this time when re-naming your project. Turns out tc Server doesn't pick up the re-name and issues arise. With the help of Wadud, we worked out that you need to find the Server.xml for your tc server and change any references to the old naming convention of your project. Also link the file with the editor (a backward and forward arrow button in STS). This change needs to be made for your pom.xml file as well as your org.eclipse.wst.common.component file.
Clean *everything* (much safer this way) and try again.
Such a pain, you'd think that tools like STS would sort this out for you instead of having to go through this.
Showing posts with label Spring. Show all posts
Showing posts with label Spring. Show all posts
Thursday, 10 December 2009
Wednesday, 9 December 2009
Another STS PITA
So here's another problem that took ages to sort out. If the XSD you are using in your project is referencing other XSDs on a server and in your network connection settings you have not bypassed the proxy for that server thn instead of STS informing you of this it does this instead (for ages):
There is no useful warning message or error or time out message. Although the issue itself was not with STS it is still a big usability fail!
Tuesday, 8 December 2009
Lessons Learnt from the STS & RTC Installation
Today I embarked upon the STS & RTC installation specified in Andrew's post.
What can i say other than it has been fairly painful. Firstly I was using an older version of STS, so I upgraded STS. Once I did this, I referenced back to my original workspace - bad idea! Eclipse totally got itself in a twist. The best thing to do is create a brand new workspace and import your project from the existing to the new workspace.
The second issue I have been having issues with is the installing new software. I added the urls (specified in Andrew's post) but in order to connect to the repository I had to change the network connection settings. This caused the urls to time out. I tweaked the settings again to ensure they are correct, still no luck. I had to delete and re-add all the urls in order to get the software to update.
Both these issues have caused me a tremendous amount of pain today and I thought it would be worth documenting, in order to make life easier for others.
What can i say other than it has been fairly painful. Firstly I was using an older version of STS, so I upgraded STS. Once I did this, I referenced back to my original workspace - bad idea! Eclipse totally got itself in a twist. The best thing to do is create a brand new workspace and import your project from the existing to the new workspace.
The second issue I have been having issues with is the installing new software. I added the urls (specified in Andrew's post) but in order to connect to the repository I had to change the network connection settings. This caused the urls to time out. I tweaked the settings again to ensure they are correct, still no luck. I had to delete and re-add all the urls in order to get the software to update.
Both these issues have caused me a tremendous amount of pain today and I thought it would be worth documenting, in order to make life easier for others.
Thursday, 3 December 2009
Getting Started With Spring Web Services
Being a newbie in the world of web services I was asked to set one up on my current project. As we are using Spring MVC & STS it made sense to continue down the Spring route.
Also Spring-WS supports contract first whereby one starts with the WSDL first and then implements the endpoint using Java as opposed to contract last where you start with the code first and generate the WSDL from that. There are many advantages outlined in the Spring Tutorial extensively, but one of the biggest selling points for me was that in a contract first the contract would remain constant over time whereas in a contract last the contract might be subject to change as the Java code changes.
The Spring Tutorial above will take you through a detailed outline of how to set up a Spring Web Service, in my post (from my now newly acquired Spring Web Service wisdom) I will take you through the basic set up for a web service with the generation of a WSDL. This simplification is aimed at the newbie for whom it may be a daunting task to set up a Spring web service with very little prior experience. Before I get going, I'd like to thanks Russel Hart (@rus_hart on twitter) for all his help and guidance with my task.
That is pretty much the it in terms of the steps needed to setup Spring WS and create the service contract. You will then need to write the Java code to implement you Endpoint for your project accordingly.
My Sample project and the WS Tutorial project (from SpringSource) can be found here.
Also Spring-WS supports contract first whereby one starts with the WSDL first and then implements the endpoint using Java as opposed to contract last where you start with the code first and generate the WSDL from that. There are many advantages outlined in the Spring Tutorial extensively, but one of the biggest selling points for me was that in a contract first the contract would remain constant over time whereas in a contract last the contract might be subject to change as the Java code changes.
The Spring Tutorial above will take you through a detailed outline of how to set up a Spring Web Service, in my post (from my now newly acquired Spring Web Service wisdom) I will take you through the basic set up for a web service with the generation of a WSDL. This simplification is aimed at the newbie for whom it may be a daunting task to set up a Spring web service with very little prior experience. Before I get going, I'd like to thanks Russel Hart (@rus_hart on twitter) for all his help and guidance with my task.
- Step 1: Download and Install STS from SpringSource
- Step 2: Create a new Maven Project ensuring that the archetype is a webapp.
- Step 3: Add all the Maven dependencies to your pom.xml.
- Step 4: Create/Import the XSD that you will be using for the project (this is the data contract).
- Step 5: Modify the web.xml file (this defines a Spring-WS
MessageDispatcherServletand maps all incoming requests to this servlet). - Step 6: Create a ws-servlet.xml file (this file will contain your EndPoints bean and WSDL (service contract) Definitions to autogenerate the WSDL).
- Step 7: In src--> main create a folder called 'java' and ensure that it is part of the Java buildpath (right click on the project properties --> Java Build Path --> Add Folder and add the java folder to the buildpath).
- Step 8: In the Java folder create the EndPoint java class.
- Step 9: Extend the AbstractJDomPayLoadEndPoint class and implement the invokeInternal method. NB: It is possible to extend other classes also most suited to your particular project.
- Step 10: Ensure that your project builds
- Step 11: Ensure that you have added the web project to your Tomcat server.
- Step 12: Run the project on your Tomcat server.
- Step 13: Check your localhost to ensure your WSDL has been generated (in my instance the URL would be: http://localhost:8080/wsTest/Sample.wsdl).
That is pretty much the it in terms of the steps needed to setup Spring WS and create the service contract. You will then need to write the Java code to implement you Endpoint for your project accordingly.
My Sample project and the WS Tutorial project (from SpringSource) can be found here.
Subscribe to:
Posts (Atom)