I have installed the Roo Shell 2.0.0.RELEASE in my eclipse. I have never worked with Roo, but, as I understood, it will regenerate the .aj files of my imported roo project when I modify something in them.
However, when you open the projects, it just delete the .aj with commands like this:
roo> Deleted SRC_MAIN_JAVA\com\bbva\front\oorg\cirbe\cirbedaos\dto\vinculaciones\DetalleVinculacionesDaoOutDto_Roo_JavaBean.aj - not required for governor com.bbva.front.oorg.cirbe.cirbedaos.dto.vinculaciones.DetalleVinculacionesDaoOutDto
I don't know if I should write or configure something else, since most manuals I see only say that the Shell should generate these files automatically. Any idea about what im missing?
Indicate that I think the project used to work with shell 1.1.5 (i imported an existing project), but I was unable to open it, so I used 2.0.0. It is assumed that Roo has also updated this in the POM files:
Updated ROOT\pom.xml [updated property 'roo.version' to '2.0.0.RELEASE'; updated property 'roo.version' to '2.0.0.RELEASE']
Spring Roo uses the annotations included in your .java files to generate the .aj files. Each version of Spring Roo could provide/deprecate different annotations. Spring Roo 2.x is a major update, and it does not support some of the annotations of Spring Roo 1.x
https://docs.spring.io/spring-roo/docs/current/reference/html/#no-backward-compatibility
As you said, the project was created with the 1.x version of Spring Roo, so the generated code included annotations that are not supported by the 2.x version of Spring Roo. That is the reason because your .aj files are being removed with the message not required for governor.
Also, I guess that a warning message appeared to you in the Spring Roo shell before to open the project.
Hope it helps.
Related
I'm trying to build a web app in Netbeans. In project properties, I have four libraries - JSF2.2, MySQL JDBC Driver, PrimeFaces 5.0 and Java EE Web 7 API Library (all of them embedded in NetBeans, nothing was additionally downloaded). When I was creating the project, I selected JSF2.2 framework and Primefaces.
When I try to build (or clean and build) my project, I get the following error:
Warning: Could not find file E:\My Documents\NetBeansProjects\ConferenceManager\${libs.jsf20.classpath} to copy.
Any ideas?
Solved!
I removed the "default" library and included separate .jar fil that I had downloaded. That solved the problem with JSF, but then the same problem happened with MySQL connector (and I solved it the same way).
I wanted to walkthrough the spring code. For that I cloned the code and built it using ./import-into-eclipse.sh command. There are some instructions given in README.md file for checking out source in eclipse.
After following above instructions I was able to see the spring code in my eclipse workspace. To refer the spring source from my project I added all of spring projects (like spring-beans, spring-aop etc) in my project's Java build path. I was able to use spring code in my project.
Now the issue is that whenever I run the test cases in my project, I get initialization error. I removed spring projects from my java build path and junit test started working.
I tried to dig into the issue. For that I tried to run some of the test cases of spring projects itself like BeanUtilsTests.
but I got:
Class not found org.springframework.beans.BeanUtilsTests
java.lang.ClassNotFoundException: org.springframework.beans.BeanUtilsTests
I verified that classpath is set:
Don't know what is the issue. Can someone please tell me that what I did wrong.
Is there any better way to view/edit spring code?
Usually the below error,
Class not found org.springframework.beans.BeanUtilsTests
java.lang.ClassNotFoundException: org.springframework.beans.BeanUtilsTests
occurs when the corresponding jar is missing in the classpath. Since you have already added the spring-beans jar manually, I suspect you are using an incompatible version of the spring-beans jar with your spring-boot.
You can check the Maven repo Spring Beans to check the compatible version. But I would suggest using a dependency management tool like Gradle or Maven to include the required dependency jars. Spring-Boot Gradle file
I installed Spring in Eclipse/EE simply from the Eclipse Marketplace.
However, either the Spring jar files aren't there, or am missing something within the project setup.
I looked to find them in the project library thru "Build path". I even tried searching the .jar files within the Windows directories.
I know I'm missing something big-- please bear with me.
Took me hours.
Note: I saw stackoverflow.com/questions/6288563/adding-external-jar-file-in-eclipse/11004869.
Update: found the jars in an earlier release-- 3.05. OK now i think.
Of course they are not there. There is not reason for them to be in eclipse. Select File > New > Spring Template project. This will create new maven project with spring dependencies included
I'm just starting with having fun with Spring Roo...
Everything is nice so far. But eclipse (STS) sometimes behaves strage.
If i generate a new Spring MVC-Project, the containing Packages are shown as I'm familiar with, in eclipse.
If i generate a Roo-Project, Eclipse just shows the Package-Folders.
How can i fix this?
You can fix this by configuring your Eclipse project to contain Roo generated folder src as an Eclipse Source Folder.
For more information and how to, please see the following article.
http://www.informit.com/articles/article.aspx?p=367962
Figure 6-1 is the dialog where you should add your Source folder.
Cheers!
I want to create a web app that will use wicket, hibernate and spring frameworks. My IDE of choice is Eclipse, I am using maven for the .war generation and I am running Mac OS. What steps should I follow to correctly install and configure all the tools so as to have a project running that relies on these 3 frameworks. I was able to successfully set up wicket but I am having trouble for setting up hibernate and spring. I went through multiple tutorials but I still couldn't find the solution.
Thanks!
I will now try to explain a bit what is the problem I can't solve. I first began with a clean project:
mvn archetype:create -DgroupId=test.framework -DartifactId=microForum
Moved on to the project folder and mvn eclipse:eclipse
Imported the project from eclipse
Looked into the apache wicket homepage where there are multiple examples, so I read through the page and that was enough to learn what to add to the pom and had wicket and everything up and running nicely
My next step was trying to use hibernate and/or spring. I thought that "adding" hibernate and spring in the same way I added the wicket necessary configurations and dependencies to the pom (by hand) might not be that easy. So I tried using the maven archetype: appfuse-basic-spring. So:
mvn archetype:generate -> launchs the wizard that lets you choose among different archetypes
After choosing the archetype number 2 ( Hibernate + Spring + Spring MVC) it fails
After googling a bit I found out why it fails (something like I should add a -archetype after appfuse-basic-spring. So, instead of using the wizard, I put:
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring*-archetype* -DarchetypeVersion=2.1.0-M1 -DgroupId=test.framework -DartifactId=microForum2
This created my project (after multiple warnings). I paste a screenshot (Image 1) because some of the information might have some important meaning :
http://img97.imageshack.us/img97/6687/screenshot20100323at112.png
- Image 1
I then did mvn eclipse:eclipse and it started downloading millions of things, which seemed very odd so I Control+C it.
Following schmimd04 answer I tried to use the eclipse maven plugin but I couldn't create a maven project:
Unable to create project from archetype [org.appfuse.archetypes:appfuse-basic-spring:RELEASE]
The defined artifact is not an archetype
Thanks!
p.d: My Mac OS already had maven installed (version 2.2.0), I tried downloading the last one and repeating the same steps but I still had the same trouble.
Bert's recommendation LegUp, jweekend.com/dev/LegUp, have worked just fine for me. I used the wicket + Spring + JPA archetype. I will still look for the reason why maven's Hibernate+Spring+Spring MVC archetype didn't work for me. I'll edit this once I have the answer. For the time being, legup did the job!
Thanks
Install the Maven plugin for Eclipse from the update site: http://m2eclipse.sonatype.org/update.
This will allow you to create Maven projects (I would start with the quickstart archetype) and easily add dependencies, such as Hibernate, Spring, and Wicket.
As Pascal is saying, your question is to broad to answer. A few pointers that might help you:
use 'mvn eclipse:eclipse' to generate an Eclipse project out of your pom.xml. There might even be a working eclipse project that allows to open a pom.xml as eclipse project. I can't say, i left eclipse behind for good.
spring is 'just' a library that need to be in your classpath. the above command will ensure it is there (if it is defind as dependency in the pom.xml) You need to define a applicationContext.xml for Spring that resides in your classpath. See the Spring documentation for that.
hiberate is similar, it is just a library that needs to be in the classpath and that needs to find a config file. in there, the connection to the database is described. See the hibarnate docu (or one of the many blogs out there) for more info.
If you are stuck with a particular problem, please describe it so people can help here.
Bert
I don't know if it sounds odd. But it is because you have archtype data in your .metadata for respective workspace. If you delete the workspace. You can create new archtype. I know deleting worksapce is not a good idea. But still it works.