struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdtommy <>
Subject using annotations with struts 2 in jboss not finding actions
Date Fri, 28 Sep 2012 16:57:32 GMT
The application is using Jboss and has an ear file which contains an war file
and a jar file.  The war contians all our web pages.  The action classes
which I have annotated are in the jar file that is in the ear.  From my
googleing I have setup my struts.xml file with the following constants:

    <constant name="struts.convention.action.fileProtocols"
value="ear,jar,vfsfile,vfszip" />
    <constant name="struts.convention.action.disableJarScanning"
    <constant name="struts.convention.action.includeJars"

Jboss container starts up fine, but my action is not loaded.  I have
downloaded the source for the convention plugin to see what it is using to
find the action classes and it seems to only look at the war file for action
classes when it scans.  Is there a way to get it to look in the jar file
that contains the actions class when it scans foe the annotated action

file structure:<br/>
&nbsp;&nbsp;|--aplication_logic_actions.jar *<--- this contains the action
classes which are annotated*

I have debugged the code for the convention plugin and here is where I see
my problem.  In the *PackageBasedActionConfigBuilder* class and the
*buildUrlSet()* method it has this line of code:

    UrlSet urlSet = new UrlSet(classLoaderInterface, this.fileProtocols);

after this code I get about 200 + urls.  It then goes through this code:

    if (excludeParentClassLoader) {

This condiftion block removes all my urls since they are all from jboss I
guess and I have *excludeParentClassLoader* set to true.  It then hits this

    urlSet = urlSet.includeClassesUrl(classLoaderInterface);

after this I get one url in my urlset:

> file:/C:/evolution/trunk/powersports/jboss/server/dms/deploy/http-invoker.sar/invoker.war=file:/C:/evolution/trunk/powersports/jboss/server/dms/deploy/http-invoker.sar/invoker.war

Now it finally gets to the part that has the jar incllude regex

    List<URL> rawIncludedUrls = urlSet.getUrls();
    Set<URL> includeUrls = new HashSet<URL>();
    boolean[] patternUsed = new boolean[includeJars.length];
    for (URL url : rawIncludedUrls) {

since there is the 1 url in the urlset and my jars are not there then it
does not find them.  There must be something else I am missing on how to get
my url to show up in that url set before the regex comparison code is run, 
I just don't know what that is

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message