UNLV-ShaneD / unlvCS473kilo

5 stars 4 forks source link

Spring #6

Closed benallyc closed 12 years ago

benallyc commented 12 years ago

I am having the worst luck doing ANYthing with Spring. Does anyone have anything set-up? Just an example or whatever. I can't find any solid tutorials.

dabinett commented 12 years ago

I've only found a few tutorials that did little more than what Sowders showed but I did find this. Seems to have a bit more to it. http://blog.springsource.org/2009/05/27/roo-part-2/

benallyc commented 12 years ago

I'll definitely have a look at it. Thanks!

UNLV-ShaneD commented 12 years ago

Make sure not to install STS to a protected directory such as the Program Files folder. It appears STS doesn't follow best practices for persistent data.

UNLV-ShaneD commented 12 years ago

Also, make sure to check the Error Log. You can do this by going to Window > Show View > Other... > Error Log If the latest message is "File /.../src/main/aspect does not exist yet. Create it and re-run configuration", then create that folder and close and re-open the Roo Shell (same as opening an Error Log view).

UNLV-ShaneD commented 12 years ago

Tutorial:

http://www.giantflyingsaucer.com/blog/?p=2373

UNLV-ShaneD commented 12 years ago

Okay, I found a potential problem with the STS distribution in the installer.

When you create an MVC project, the org.springframework-version is set to 3.0.6.RELEASE Unfortunately, they included only the jars for 3.0.5.RELEASE So, when you change the pom.xml file to fix this, everything works as expected with a clean error log.

If you pull from the primary repository, the project should work. I can't figure out how to get the Hello World page working, though...

UNLV-ShaneD commented 12 years ago

Alright, the hello world page is working now. I changed the springframework version to 3.1.0.RC2 - seems to work a bit better. You may need to add the Spring Roo nature to the project, but you can visit the test page now by navigating to http://localhost:8080/abc/

There are lots of pitfalls the tutorials leave out (e.g. why does the project name default to abc and how are you supposed to know to navigate to /abc). I am not impressed with this software.

benallyc commented 12 years ago

I'm trying to pull from the repo, but I'm getting merge conflicts?

benallyc commented 12 years ago

Well I think I cloned your most current commits to the repo. However, I'm getting Tomcat server errors when I try to view the browser version of "Hello World!" I'm just opening browser with the address: http://localhost:8080/abc/

How do I approach 'compiling' (for lack of Spring Roo terms)? Do I just click the Play icon? Or do I Run as... Maven Build? Or?

UNLV-ShaneD commented 12 years ago

Merge conflicts happen when you have stuff in your directories different than from whats in the repository. Git doesn't magically sort that stuff out, unfortunately.

This tutorial helped me the most when setting up the MVC project.

We are not using the Tomcat server - we are using the VMWare vFabric tc Server Developer Edition. The software needed for this should be downloaded automatically by STS. If not, try running through that tutorial with a test project. You run the project off of the VMWare vFabric tc Server - first, you must add the project to it. The tutorial runs through this.

Make sure the project has the Spring and Maven natures. You can do this by right-clicking the project in the ?project? explorer - the options will be there towards the bottom.

benallyc commented 12 years ago

I'm having trouble with the IDE Roo Shell. I'm not able to type hint or anything command whatsoever, without the command outputting "roo> Version is required" Have any of you run into this problem? I can't find anything on it. I have the STS folder on my C: drive

benallyc commented 12 years ago

This was the problem I was experiencing before: http://superuser.com/questions/337131/unable-to-start-spring-roo-and-get-it-working

But now, I'm getting the problem explained above.

dabinett commented 12 years ago

Mine works fine, I think. Here were my steps:

  1. Download Shane's code.
  2. In STS, go to File -> Import -> General Tab -> Existing Projects into workspace and choose the folder you made.
  3. Right click on "onbudget" on the left side and click Spring Tools -> Add Roo Project Source.

That should work. At least hint works and tells me to do the persistance setup.

benallyc commented 12 years ago

Yeah, I did that, but yesterday I was experiencing some problems with seeing the build, so I decided to rework the entire installation process again. (i.e.-re-adding the Path for the environment variables and placing the STS folder in C:) and I get this situation with the Roo Shell command line displaying: roo> Version is required

J.R., you mind having a look at it tomorrow between compilers and 473?

strongd commented 12 years ago

So yeah, just to have this documented.

I believe there are a couple solutions to the Version is required problem with the Roo shell (I've also had this problem, just like Corbin).

  1. Download and use an older version of Spring Roo that you can get from the SpringSource website. Spring Roo 1.1.5.RELEASE should work just fine (apparently there are a lot of changes between that version and the new 1.2.1.RELEASE).
  2. Add the version numbers to the maven section in the pom.xml file in our project manually. Refer to Matt's email that he sent to all of us about the maven plugins.
  3. I think that this issue can also be fixed by remaking our project from the beginning as a Spring Roo project and use that to build all the Maven stuff/dependencies. Then there should be no issues with using any version of Roo.

If the third option works out and is feasible, then it might be the safest way to proceed for the sake uniformity between all team members.

UNLV-ShaneD commented 12 years ago

I'm going with option 3. There was an issue with using Roo, but I fixed that by changing the pom.xml file to use 1.1.5.RELEASE - then I guess Maven kicked in when I re-opened the project and downloaded the dependencies. I'll report back in a few...

UNLV-ShaneD commented 12 years ago

Just had the best error ever:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'applicationConversionService' while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [edu.unlv.kilo.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: edu.unlv.kilo.web.ApplicationConversionServiceFactoryBean Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [edu.unlv.kilo.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: edu.unlv.kilo.web.ApplicationConversionServiceFactoryBean

UNLV-ShaneD commented 12 years ago

I pushed what I have to offbudget. This thing causes a 700 line stack trace, it's hilarious.

Browse to: localhost:8080/offbudget/ see if you can't figure this out

UNLV-ShaneD commented 12 years ago

Okay, it's working! Turns out I turned off automatic builds and forgot to build before launching :derp:

UNLV-ShaneD commented 12 years ago

And, now, when I re-import, doing any commands in the roo shell causes roo to crash...

POM.xml fixed itself back to Roo version 1.2.1 I went to the community downloads page for Spring Roo, and 1.0.5 is not available.

I GUESS I'LL START OVER ONE MORE TIME. This /should/ work out of the box with the latest release, no mucking about.

UNLV-ShaneD commented 12 years ago

Fail Only 4,294,967,295 more seconds and I might succeed!

Log file:

// Spring Roo 1.2.1.RELEASE [rev 6eae723] log opened at 2012-03-13 11:22:07 So pro.

I believe I have to reinstall STS. How it got corrupted is beyond me.

UNLV-ShaneD commented 12 years ago

Okay, it turns out there is nothing wrong with offBudget - my installation of STS just got corrupted somehow.