Results 1 to 4 of 4

Thread: Can't deploy compile-time woven classes

  1. #1

    Default Can't deploy compile-time woven classes

    I've just upgraded to STS 2.7.2 (from 2.3.2)

    I had to recreate all of my projects, which wasn't unexpected. Getting everything to build wasn't too troublesome. However, my webapps all use compile-time weaving of classes from other projects in my workspace. This was never a problem in 2.3.2 and isn't a problem when building in 2.7.2. However, my deployed apps do not get the woven .class files which are placed in the build/classes directory next to the classes from java files that are actually included in the webapp project. The new 'Deployment Assembly' properties page for the project simply gives no option that would allow me to tell it to include the entire contents of the build/classes directory. Instead, it cherry picks the .class files which match .java files included in that project and ignores the rest.

    At the same time, if I configure the aspectj compiler to output to a jar file instead of to the project's output dir, it just throws an exception related to ZipFile. In short, there doesn't appear to be ANY WAY to get classes that are woven at compile time to be included with a deployed webapp. Surely, I'm not the only person who has run into this. There must be a fix, since it completely eliminates the ability to use compile-time weaving, or else it forces you to build all your code in a single webapp project, rather than keeping different components separated into separate projects.

    Please help!

    Edit: The exception I get when I try to get the aspectj compiler to write to a jar file is as follows (and it doesn't matter whether I give just a straight file name or a full path to a directory that I deifnitely have permissions to write to):

    ava.util.zip.ZipException
    at java.util.zip.ZipOutputStream.putNextEntry(ZipOutp utStream.java:175)
    at java.util.jar.JarOutputStream.putNextEntry(JarOutp utStream.java:92)
    at org.aspectj.ajdt.internal.core.builder.AjBuildMana ger$4.writeZipEntry(AjBuildManager.java:1152)
    at org.aspectj.ajdt.internal.core.builder.AjBuildMana ger$4.acceptResult(AjBuildManager.java:1089)
    at org.aspectj.ajdt.internal.compiler.AjPipeliningCom pilerAdapter.acceptResult ... nternalWorkspaceJob.run(InternalWorkspaceJob.java: 38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.j ava:54)

    unable to write compilation result
    Last edited by ideasculptor; Oct 14th, 2011 at 03:48 AM.

  2. #2

    Default

    I had to put the default output folder in the 'set a non-default output folder' in the aspectj compiler properties to get it to work. One would think the label specifies 'non default' because it otherwise uses the default (and it does place the aspectj output there), but the deployment mechanism apparently needs to have the path explicitly configured or it won't push the woven classes into WEB-INF/classes. Clearly an eclipse/aspecj problem, not STS, but I didn't want to leave this issue unresolved.

  3. #3
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,638

    Default

    Thanks for the follow-up, glad to hear you figured it out!

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  4. #4
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    750

    Default

    This might be a problem with the AspectJ Tooling. I'll have a look. Thanks for bringing it up.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •