You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jdtommy <jd...@gmail.com> on 2012/09/28 18:57:32 UTC
using annotations with struts 2 in jboss not finding actions
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"
value="false"/>
<constant name="struts.convention.action.includeJars"
value=".*/lightspeed.*?jar(!/)?,.*/lightspeed*?jar(!/)?,.*lightspeed.*?jar(!/)?,.*lightspeed*?jar(!/)?"
/>
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
classes?
file structure:<br/>
-application.ear<br/>
|--application.war<br/>
|--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
code:
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: http://struts.1045723.n5.nabble.com/using-annotations-with-struts-2-in-jboss-not-finding-actions-tp5710681.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: using annotations with struts 2 in jboss not finding actions
Posted by Lukasz Lenart <lu...@apache.org>.
2012/10/1 jdtommy <jd...@gmail.com>:
> Yes. Struts 2
Nice :-) But could you be more precise ?
http://struts.apache.org/downloads.html
http://struts.apache.org/downloads.html#PriorReleases
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: using annotations with struts 2 in jboss not finding actions
Posted by jdtommy <jd...@gmail.com>.
Yes. Struts 2
On Oct 1, 2012 2:33 AM, "Lukasz Lenart [via Struts]" <
ml-node+s1045723n5710694h86@n5.nabble.com> wrote:
> Struts2 version ?
>
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5710694&i=0>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5710694&i=1>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://struts.1045723.n5.nabble.com/using-annotations-with-struts-2-in-jboss-not-finding-actions-tp5710681p5710694.html
> To unsubscribe from using annotations with struts 2 in jboss not finding
> actions, click here<http://struts.1045723.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5710681&code=amR0b21teUBnbWFpbC5jb218NTcxMDY4MXwtNjI1MTg4NjMz>
> .
> NAML<http://struts.1045723.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://struts.1045723.n5.nabble.com/using-annotations-with-struts-2-in-jboss-not-finding-actions-tp5710681p5710701.html
Sent from the Struts - User mailing list archive at Nabble.com.
Re: using annotations with struts 2 in jboss not finding actions
Posted by Lukasz Lenart <lu...@apache.org>.
Struts2 version ?
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: using annotations with struts 2 in jboss not finding actions
Posted by jdtommy <jd...@gmail.com>.
I think this works in jboss 5.x or above. I am using Jboss 4. If this is
incorrect please let me know.
--
View this message in context: http://struts.1045723.n5.nabble.com/using-annotations-with-struts-2-in-jboss-not-finding-actions-tp5710681p5710683.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: using annotations with struts 2 in jboss not finding actions
Posted by Martin Gainty <mg...@hotmail.com>.
so you want the EAR ClassLoader to be searched before JBoss ClassLoader? ..here is how
<classloading xmlns="urn:jboss:classloading:1.0"
domain="your.ear"
export-all="NON_EMPTY"
import-all="true"
parent-first="false">
</classloading>
http://phytodata.wordpress.com/2010/10/21/demystifying-the-jboss5-jboss-classloading-xml-file/
HTH
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Fri, 28 Sep 2012 09:57:32 -0700
> From: jdtommy@gmail.com
> To: user@struts.apache.org
> Subject: using annotations with struts 2 in jboss not finding actions
>
> 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"
> value="false"/>
> <constant name="struts.convention.action.includeJars"
> value=".*/lightspeed.*?jar(!/)?,.*/lightspeed*?jar(!/)?,.*lightspeed.*?jar(!/)?,.*lightspeed*?jar(!/)?"
> />
>
> 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
> classes?
>
> file structure:<br/>
> -application.ear<br/>
> |--application.war<br/>
> |--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
> code:
>
> 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: http://struts.1045723.n5.nabble.com/using-annotations-with-struts-2-in-jboss-not-finding-actions-tp5710681.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>