[JBoss AOP] New message: "Re: Deploying AOP in 5.1 with pojo cache"
by Flavia Rainone
User development,
A new message was posted in the thread "Deploying AOP in 5.1 with pojo cache":
http://community.jboss.org/message/522814#522814
Author : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com
Message:
--------------------------------------------------------------
Hi! Running Vehicle's main method with javaagent does not solves your problem, because the weaving is performed at runtime:
<target name="war" depends="compile">
<java classname="com.test.pojo.Vehicle" fork="true" >
<jvmarg value="-Xmx128M"/>
<jvmarg value="-javaagent:WebContent/WEB-INF/lib/jboss-aop.jar"/>
<jvmarg value="-Djboss.aop.path=WebContent/META-INF/pojocache-aop.xml"/>
<classpath refid="compile.classpath"/>
<classpath path="build/classes" />
</java>
<war destfile="dist/Cache.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent"/>
<lib dir="WebContent/WEB-INF/lib"/>
<classes dir="build/classes"/>
</war>
</target>
This means that the class file in buid/classes is not instrumented, it is instrumented only in the memory of the JVM while executing Vehicle's main(). So, your Vehicle class file remains unchanged and that's why you're seeing that error in JBoss AS.
You need to compile your Vehicle class with aopc instead. Take a look at our tutorial for a build.xml example of how to do that.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522814#522814
14 years, 3 months
[Beginner's Corner] New message: "Re: jboss creates alot of index.html files"
by Peter Johnson
User development,
A new message was posted in the thread "jboss creates alot of index.html files":
http://community.jboss.org/message/522809#522809
Author : Peter Johnson
Profile : http://community.jboss.org/people/peterj
Message:
--------------------------------------------------------------
The contents of the file looks like it came from server/default/deploy/ROOT.war/index.html.
The only way the files could get copied to the /root directory, and have an owner and group of root, is if a process that was running as root placed them there. Based on what you wrote, I gather that JBoss AS is not running under root. Which means that it is not JBoss AS or any of the apps deployed to it that are doing this (unless there is something about Linux security that I don't know, which is very possible )
I checked two of my Linux systems and neither of them have these files in /root.
If you were running on Windows, I would suggest running File Monitor (or Process Monitor) from Sysinternals. That tools lets you monitor which processes are doing what to files; you could easily set it up to tell you everything that is happening to files in a specific directory. I don't know if there are any Linux tools that would do the same thing.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522809#522809
14 years, 3 months
[JBoss AOP] New message: "Re: withincode from JUnit test not working"
by Flavia Rainone
User development,
A new message was posted in the thread "withincode from JUnit test not working":
http://community.jboss.org/message/522805#522805
Author : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com
Message:
--------------------------------------------------------------
> nizzy wrote:
>
> In the past I have been able to use the call and withincode combination, however the java class defined in the withincode was not a JUnit test.
How about other calls that match the call pointcut (without within/withincode)? Calls made from other points of your code should be intercepted.
If there isn't such a call, I would replace your call in the test class:
public class MyTest extends TestCase{
public void testSomething()
{
pojo.call();
}
}
By something like this:
public class MyTest extends TestCase
{
public void testSomething()
{
Caller.call();
}
}
public Caller
{
public static void call()
{
pojo.call();
}
}
I.e., I would move that call to another class, and see if JBoss AOP intercepts it. If it doesn't, it definitely has nothing to do with being inside a test class. And, since we have tests for all pointcut types, I would guess that the problem is somewhere else in that case.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522805#522805
14 years, 3 months