Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Issue with WAR file

Thank you Andy for your answer. Well, when we work under IDE, everything is smooth enough to avoid developpers to take care about many details. The WAR or even an EAR projet can be converted to an AspectJ project and something handles correctly the problem of compiling and weaving the aspects. WAR and EAR files are not more than specialized JAR file with well-known conventions and rules. It is why we have expected similar behavior with IAJC task but we have to recognize we have surrestimated the capabilities of this specialized task. We have to returned back to the starting point by following your recommended approach.

Best regards,

JA.





De :        Andy Clement <andrew.clement@xxxxxxxxx>
A :        aspectj-users@xxxxxxxxxxx
Date :        2012-05-22 11:56
Objet :        Re: [aspectj-users] Issue with WAR file
Envoyé par :        aspectj-users-bounces@xxxxxxxxxxx




Hi,

This is related to the other war discussion we had - AspectJ has no
knowledge beyond understanding a jar.  Similar to how javac has no
understanding either.

Of course, this doesn't mean we can't add it.  But the recommended
approach at the moment is to use the other tools available to do
pre-processing (unpacking) and post-processing (repacking) - tools
like the ant jar task.  How about producing output to some other jar
and then using another ant task that runs after the compile to merge
the contents back into the right place in your war file?

I'm a bit surprised things behaved at all given that the input was a
war file - I'd have expected the leading directories on the front of
the package names to have given the weaver problems.

cheers,
Andy

On 18 May 2012 09:50, Jean Andre <Jean.Andre@xxxxxxxxxx> wrote:
> Hello,
>
> We have a problem and we tried to figure out if this problem can be solved
> by iajc. We have WAR file which contains the source and the @aspectJ files.
> We use the ANT command  <iajc> inpath="my_original_War" -outJar="MyWar" -
> classpath="The full list of jar"
>
> The weaven did not report any error, everything seems fine. BUT, when we
>  tried to run the WAR file inside the EAR, it fails. We compared the both
> WAR and the  WAR produced by the Weaver did not have the same structure as
> the original WAR.
>
> The WAR has an additional folder starting from the root :
> com\companyName\projectName\.... In fact, the weaver have put the src folder
> at the root of the WAR file instead of keeping the classes inside
> WEB-INF\classes. It it like having duplicated classes, with and without
> veaven.
>
> For sure, it is not normal ?
> Iis there a way to specify with IAJC  the destination folder where to put
> the weaven classes inside the WAR (I think, there are weaven classes ?)
>
> What are our alternatives ?
>
> Best regards and thank you for your quick feedback.
>
> JA.
>
> =============================================
> The exact command for the weaver
> =============================================
>
>            <iajc inpath="Web_origine.war"
>                     outjar="Web.war"
>                  showWeaveInfo="false">
>                    <classpath>
>                            <pathelement path = "ext/aspectjrt.jar"/>
>                            <pathelement path = "ext/javax.faces.jar"/>
>                            <pathelement path =
> "ext/annotations-4.2.0.Final.jar"/>
>                            <pathelement path = "ext/antlr-2.7.6.jar"/>
>                            <pathelement path = "ext/cglib-nodep-2.2.2.jar"/>
>                            <pathelement path =
> "ext/cof-service-api-official.jar"/>
>                            <pathelement path =
> "ext/cof-service-web-official.jar"/>
>                            <pathelement path =
> "ext/common-api-core-official.jar"/>
>                            <pathelement path =
> "ext/common-api-dm-official.jar"/>
>                            <pathelement path =
> "ext/common-api-email-official.jar"/>
>                            <pathelement path =
> "ext/common-api-il-services-official.jar"/>
>                            <pathelement path =
> "ext/common-api-java-services-official.jar"/>
>                            <pathelement path =
> "ext/common-api-moneris-official.jar"/>
>                            <pathelement path =
> "ext/common-api-pega-services-official.jar"/>
>                            <pathelement path =
> "ext/common-api-web-official.jar"/>
>                            <pathelement path =
> "ext/common-api-web-struts-official.jar"/>
>                            <pathelement path =
> "ext/common-api-web-tags-official.jar"/>
>                            <pathelement path =
> "ext/common-api-wi-official.jar"/>
>                            <pathelement path = "ext/commons-lang-2.4.jar"/>
>                            <pathelement path =
> "ext/commons-logging-1.1.1.jar"/>
>                            <pathelement path =
> "ext/commons-validator-1.4.0.jar"/>
>                            <pathelement path = "ext/cssparser-0.9.6.jar"/>
>                            <pathelement path = "ext/dom4j-1.6.1.jar"/>
>                            <pathelement path = "ext/guava-11.0.1.jar"/>
>                            <pathelement path = "ext/hibernate-3.3.2.jar"/>
>                            <pathelement path =
> "ext/hibernate-annotations-3.4.0.jar"/>
>                            <pathelement path =
> "ext/hibernate-commons-annotations-3.4.0.jar"/>
>                            <pathelement path =
> "ext/hibernate-entitymanager-3.4.0.jar"/>
>                            <pathelement path =
> "ext/hibernate-validator-4.2.0.Final.jar"/>
>                            <pathelement path = "ext/junit-4.10.jar"/>
>                            <pathelement path = "ext/log4j-1.2.16.jar"/>
>                            <pathelement path = "ext/ojdbc14-10.2.0.4.jar"/>
>                            <pathelement path =
> "ext/org.springframework.asm-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.beans-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.context-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.core-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework._expression_-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.jdbc-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.orm-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.transaction-3.0.6.RELEASE.jar"/>
>                            <pathelement path =
> "ext/org.springframework.web-3.0.6.RELEASE.jar"/>
>                            <pathelement path = "ext/pop-api-official.jar"/>
>                            <pathelement path =
> "ext/pop-services-official.jar"/>
>                            <pathelement path =
> "ext/richfaces-components-api-4.2.0.Final.jar"/>
>                            <pathelement path =
> "ext/richfaces-components-ui-4.2.0.Final.jar"/>
>                            <pathelement path =
> "ext/richfaces-core-api-4.2.0.Final.jar"/>
>                            <pathelement path =
> "ext/richfaces-core-impl-4.2.0.Final.jar"/>
>                            <pathelement path = "ext/sac-1.3.jar"/>
>                            <pathelement path = "ext/slf4j-api-1.6.4.jar"/>
>                            <pathelement path =
> "ext/slf4j-log4j12-1.6.4.jar"/>
>                            <pathelement path = "ext/j2ee.jar"/>
>                            <pathelement path =
> "ext/commons-collections-3.2.1.jar"/>
>                            <pathelement path =
> "ext/org.springframework.aop-3.0.6.RELEASE.jar"/>
>                    </classpath>
>
>                   </iajc>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top