Yes,

The problem seems to be that struts 2 convention plugin is attempting to load the classes by loading files from the war file that is still inside the ear in the deploy directory of your jboss server. This virtual file can't be loaded in the mechanism being provided by the convention plugin and therefore fails.

I am going to get around this by adding:

<bean type="org.apache.struts2.convention.ActionConfigBuilder" name="convention" class="com.myapp.MyPackageBasedActionConfigBuilder"/>

To struts.xml and extending the convention plugin provided ActionConfigBuilder. My class will override the findActions method and then just include my action classes that I register manually. This is not ideal, but it will allow me to proceed and use the convention plugin without the automated discovery process. If I have more time to dedicate to this later I will try and figure out a better way to actually handle the situation. If so I will post the solution back to the list then.

-Scott

On Jul 12, 2010, at 1:50 AM, mid491 mid491 wrote:

Hi,

I got the same problem : when my WAR is inside the EAR the plugin doesn't work, if I deploy the war alone, all works fine!

tell me if you find an issue?

DT

> From: miller.sc...@gmail.com
> To: user@struts.apache.org
> Subject: convention plugin 2.1.8.1 and JBoss 5.1
> Date: Fri, 9 Jul 2010 22:27:46 -0700
>
> I have been unable to get the struts convention plugin to work on
> JBoss 5.1.
>
> If I set
>
> <constant name="struts.convention.exclude.parentClassLoader"
> value="true" />
>
> as per the convention plugin documentation, and debug through the
> setup code, I notice that the WEB-INF/classes directory in my war
> (which is deployed in an ear) gets removed from the set of URL's to
> search for action classes.
>
> Switching that constant to 'false' allows the WEB-INF/classes
> directory to remain in the set of URL's, but then I get this error
> when it attempts to load the war:
>
> 2010-07-09 22:14:03,102 ERROR [CommonsLogger.java:27] : Unable to read
> URL [vfszip:/<JBOSS_HOME_DIR>/server/default/deploy/myapp.ear/myapp-
> web.war/WEB-INF/classes/]
> java.io.FileNotFoundException: /< JBOSS_HOME_DIR>/server/default/
> deploy/myapp.ear/myapp-web.war/WEB-INF/classes
> at
> org
> .jboss
> .net.protocol.file.FileURLConnection.connect(FileURLConnection.java: 105)
> at
> org
> .jboss
> .net
> .protocol .file.FileURLConnection.getInputStream(FileURLConnection.java:
> 112)
> at java.net.URL.openStream(URL.java:1007)
> at
> com.opensymphony.xwork2.util.finder.ClassFinder.jar(ClassFinder.java:
> 464)
> at
> com
> .opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
> 129)
> at
> org
> .apache
> .struts2
> .convention
> .PackageBasedActionConfigBuilder
> .findActions(PackageBasedActionConfigBuilder.java:352)
> at
> org
> .apache
> .struts2
> .convention
> .PackageBasedActionConfigBuilder
> .buildActionConfigs(PackageBasedActionConfigBuilder.java:317)
> at
> org
> .apache
> .struts2
> .convention
> .ClasspathPackageProvider .loadPackages(ClasspathPackageProvider.java:53)
>
>
> Is there some magical configuration setting I am missing? or does this
> just not work on JBoss 5.1 when deploying inside of an ear?
>
> Thanks,
>
> Scott
>

De nouvelles Emoticones sur Messenger ? Téléchargez gratuitement les émoticônes Summer !

Reply via email to