[ 
https://issues.apache.org/jira/browse/WW-3984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13583149#comment-13583149
 ] 

Rafal Szczepankiewicz commented on WW-3984:
-------------------------------------------

nope not working, I'm adding EAR that reproduces the issue, the only difference 
is that I've added a new jar astruts2-ear-jar-1.0-SNAPSHOT into WEB-INF dir.
If I remove the jar actions are found again.
Problem in code is in this line (readUrls method of class 
PackageBasedActionConfigBuilder): ArrayList<URL> classesList = 
Collections.list(getClassLoaderInterface().getResources("")); which returns 
only first jar from the war file.
includeJars is applied later and doesn't matter if readUrls doesn't include jar 
with actions.


                
> Struts 2.3.8 convention plugin doesn't work with EAR on JBoss 5.1
> -----------------------------------------------------------------
>
>                 Key: WW-3984
>                 URL: https://issues.apache.org/jira/browse/WW-3984
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.3.8
>         Environment: JBoss 5.0 and 5.1, java 1.6 update 34
>            Reporter: Rafal Szczepankiewicz
>            Assignee: Lukasz Lenart
>            Priority: Critical
>              Labels: EAR, annotation, convention, jboss, struts
>             Fix For: 2.3.11
>
>         Attachments: config-browser screenshot.jpg, libs.JPG, serverLog.zip, 
> struts_2.3.11_libs.zip, struts2-ear.ear, TestEAR.ear
>
>
> Convention plugin is not able to read classes found in jar files when they 
> are deployed inside a EAR file under JBoss 5.0 and 5.1 version.
> Error = file not found exception. 
> I've debugged the issue (classes PackageBasedActionConfigBuilder and 
> ClassFinder) and there is no possibility to fix this using any of the 
> configuration parameters.
> This is only happening when EAR is not exploded. 
> I've check/read the forum and asked google about this and could not find any 
> information if and when this will be fixed. Are there any plans to add a fix 
> that will allow to use annotations with EAR files on JBoss ?
> This issue is serious since my project contains dozens of actions that are 
> defined via annotation (I would really want to avoid defining them in xml). 
> When deployed in EAR to JBoss they don't work. 
> Any help/workable workaround is appreciated.
> EAR that reproduces the error in attachements.
> Structure:
> TestEAR -> TestWeb.war -> TestJava.jar
> TestJava.jar contains class TestAction that uses annotation.
> When deplying the EAR in Jboss I get following exception:
> 19:22:53,195 ERROR [ClassFinder] Unable to read URL 
> [vfszip:/E:/Downloads/jboss-5.1.0.GA-jdk6/jboss-5.1.0.GA/server/default/deploy/TestEAR.ear/TestWeb.war/WEB-INF/lib/commons-lang-2.4.jar/]
> java.io.FileNotFoundException: 
> E:\Downloads\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\server\default\deploy\TestEAR.ear\TestWeb.war\WEB-INF\lib\commons-lang-2.4.jar
>       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(Unknown Source)
>       at 
> com.opensymphony.xwork2.util.finder.ClassFinder.jar(ClassFinder.java:417)
>       at 
> com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:91)
>       at 
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390)
>       at 
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
>       at 
> org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
>       ...
> Log with errors from startup can be found in attachement.
> libraries used by TestWeb.war added as attachements.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to