On Thu, Aug 6, 2009 at 9:56 PM, tibi<t...@dds.nl> wrote: > i'm autowiring too... i have spring injecting my managers without a problem > i still have them definied in xml files... but that will be the play > moment of next week ;)
If you have an existing application based on AppFuse, and you don't want to wait until the release of AppFuse 2.1 to port it from XML configuration to annotations, here are some notes that may help. 1. Get the patch, based on AppFuse SVN commit #3175 (ticket # APF-1105) >From your application directory: wget http://issues.appfuse.org/secure/attachment/10512/XMLToAnnotations.patch 2. Do some surgery on the patch. The patch was designed to be applied on the AppFuse repository, not on an AppFuse-derived application, so you'll need to change some package names + paths to get it to apply. Search and replace (using your IDE, sed, etc.) "org.appfuse" with "com.yourcompany.yourapp" "org/appfuse" with "com/yourcompany/yourapp" "service/src" with "core/src" (modular archetype) or "core" (flat app) "data/common/src" with "core/src" (modular archetype) or "core" (flat app) "data/pom.xml" with "core/pom.xml" (modular archetype) and then depending on your ORM replace one of these strings with "core/src": "data/hibernate/src" "data/jpa/src" "data/ibatis/src" 3. Apply the doctored patch: EITHER with the patch tool: patch -p0 < XMLToAnnotations.patch The patch will be applied hunks at a time. Where you hit upon parts of the patch that are for ORMs that you're not using, then you can safely skip by clicking enter twice: File to patch: Skip this patch? [y] OR, if you're using the Git DVCS (which incidentally, I highly recommend): git apply -p0 --reject 4. Some cleanup by hand: Afterwards you'll be left with various files in your working copy update. But inevitably, depending on how much you've changed files (for example, reorganizing imports, updating code style, adding your own functionality) some parts of the patch will not apply. You'll need to fix this manually. For each part of the patch that could not be applied, there will be a .rej file. You can list them all as follows: find . -name "*.rej" You'll need to manually edit the source files, find the rejected lines of the patch and add them in as appropriate. 5. Bump JUnit. I needed to upgrade the version of JUnit to 4.6, as I was hitting the following issue: Caused by: java.lang.NoClassDefFoundError: org/junit/runners/BlockJUnit4ClassRunner However, on the app I was porting to annotations, I've upgraded other dependencies along the way, so this may not be an issue for you. Alex --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net