Announcement Announcement Module
No announcement yet.
Can't deploy compile-time woven classes Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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):
    at java.util.jar.JarOutputStream.putNextEntry(JarOutp
    at org.aspectj.ajdt.internal.core.builder.AjBuildMana ger$4.writeZipEntry(
    at org.aspectj.ajdt.internal.core.builder.AjBuildMana ger$4.acceptResult(
    at org.aspectj.ajdt.internal.compiler.AjPipeliningCom pilerAdapter.acceptResult ... 38)
    at ava:54)

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

  • #2
    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
      Thanks for the follow-up, glad to hear you figured it out!



      • #4
        This might be a problem with the AspectJ Tooling. I'll have a look. Thanks for bringing it up.