-
Notifications
You must be signed in to change notification settings - Fork 38k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc: JBossLoadTimeWeaver on JBoss 6.0 [SPR-7887] #12543
Comments
Costin Leau commented Jens is it AspectJ that causes the problem or LTW in general? Regarding the WAR can you make a very basic jar, no libraries filters or anything like that and simply make it available. W/o any binaries the war should be quite small (max hundred of kbs). |
Jens Reimann commented This seems to be a problem with the LTW implementation of Spring. Using AspectJ with compile time weaving works even with JBoss 6. Using LTW works only with JBoss 5.1. I try to make a sample tomorrow if find the time. |
Costin Leau commented I think we're talking about different things here - I just tried petclinic with Spring 3.0.3 and it seems to be working just fine. I've used the JPA with automatic LTW detection and context and tx config. Anything special in your config? |
Jens Reimann commented Well tx might be working fine since it uses Spring AOP by default. Try switching tx support from proxy to aspectj mode. Nothing special I am aware of. The LTW adapter is detecting JBoss and JBoss LTW fine, but it does not perform LTW. I'll try to prepare the sample. |
Costin Leau commented No need. I've been able to reproduce this locally myself - indeed the LTW works just fine (registers the class transformer) but it never gets called to intercept the classes. I assume something in the internal JBoss classloading architecture changed though it's not apparent since the LTW registration works just fine. |
Jens Reimann commented Output JBoss 5.1.0: Output JBoss 6.0.0: |
Costin Leau commented What configuration are you using for starting the server? default, minimal, jbossweb-standalone? Just trying to address all target deployments. |
Jens Reimann commented I am using "default". |
Marius Bogoevici commented Jens, Costin The LTW registration works fine, the problem is that JBoss' scanning deployer loads the classes before the ApplicationContext is bootstrapping, i.e. before the transformer is added to the classloader. While we will try to find a better solution for this, a simple workaround that I can think of would be to include a WEB-INF/jboss-scanning.xml file with the following content: <scanning xmlns="urn:jboss:scanning:1.0"> |
Costin Leau commented Jens can you confirm whether the workaround fixes the problem on your end? |
Jens Reimann commented Costin, yes this seems to solve the issue quite fine. Seems to be a workaround. Although I had to place it in the WAR file which is packed inside an EAR file. Putting the file in the META-INF of the EAR file did not work (maybe I did something wrong). I am not sure what this means for the packaged JPA JARs in the EAR file. But anyway, for the moment this looks really good. Thanks for the help! |
Costin Leau commented It worked for me if I placed the file as mentioned directly inside WEB-INF (not META-INF). |
Ales Justin commented
Putting jboss-scanning.xml into EAR' META-INF only controls direct EAR' classpath entries. This is current, by default, behavior.
Like mentioned, it depends how they are defined: true EAR module (aka sub-deployment) vs. plain cp entry |
Juergen Hoeller commented I've turned this into a documentation issue, adding a corresponding note to JBossLoadTimeWeaver. As of Spring 3.1, JBossLoadTimeWeaver also supports JBoss 7. For Spring 3.0.6, it's JBoss 5 and 6 only. Juergen |
Jens Reimann opened SPR-7887 and commented
The load time weaver used with AspectJ stopped working with JBoss 6.
I made a plain war file with one aspect written in AspecJ. The compile time weaving is working in JBoss 5.1 and 6. The load time weaving is triggered in JBoss 5.1 but when I deploy the same WAR file to JBoss 6 the load time weaving is not triggered although the load time weaver for JBoss is found and activated by Spring according to the log.
I also found that
@Transactional
only works using the proxy mode, once aspectj mode used there is no evaluation of@Transactional
. So it looks like as if the Spring library suffers the same problem.I can upload my sample war but since it is 7 MB I would wait until someone needs it.
Affects: 3.0.5
Attachments:
Referenced from: commits 44b5df0, 0c5a13c
The text was updated successfully, but these errors were encountered: