Struts 2
  1. Struts 2
  2. WW-3984

Struts 2.3.8 convention plugin doesn't work with EAR on JBoss 5.1

    Details

    • Flags:
      Important

      Description

      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.

      1. TestEAR.ear
        6.21 MB
        Rafal Szczepankiewicz
      2. struts2-jboss-ear.png
        126 kB
        Lukasz Lenart
      3. struts2-ear.ear
        3.46 MB
        Rafal Szczepankiewicz
      4. struts_2.3.11_libs.zip
        1.43 MB
        Rafal Szczepankiewicz
      5. serverLog.zip
        21 kB
        Rafal Szczepankiewicz
      6. libs.JPG
        96 kB
        Rafal Szczepankiewicz
      7. config-browser screenshot.jpg
        40 kB
        Rafal Szczepankiewicz

        Issue Links

          Activity

          Hide
          Lukasz Lenart added a comment -

          Good to hear that

          Regarding the JBoss variable feel free to register an issue about that - maybe we will find a solution

          PS. I live in Sucha Beskidzka

          Show
          Lukasz Lenart added a comment - Good to hear that Regarding the JBoss variable feel free to register an issue about that - maybe we will find a solution PS. I live in Sucha Beskidzka
          Hide
          Rafal Szczepankiewicz added a comment -

          Finally, I've managed to convert my project to use struts without any errors.
          Problem was with keeping struts libs in the web application.
          When I've moved them into EAR everything runs smoothly.

          One thing that I'm afraid is that in order to run struts 2 you have to change jboss variable which is never a good thing.
          Hopefully it won't be an issue, keeping my fingers crossed.

          Thanks for your help and support Lukasz !

          PS: If you are ever in Cracow, Poland let me know I will buy you a huge beer

          Show
          Rafal Szczepankiewicz added a comment - Finally, I've managed to convert my project to use struts without any errors. Problem was with keeping struts libs in the web application. When I've moved them into EAR everything runs smoothly. One thing that I'm afraid is that in order to run struts 2 you have to change jboss variable which is never a good thing. Hopefully it won't be an issue, keeping my fingers crossed. Thanks for your help and support Lukasz ! PS: If you are ever in Cracow, Poland let me know I will buy you a huge beer
          Hide
          Rafal Szczepankiewicz added a comment -

          Tested on EAP and it also works.
          Unfortunately there is still something wrong with my project and actions are not getting mapped...
          I will try to check what's the reason and keep you updated.

          Show
          Rafal Szczepankiewicz added a comment - Tested on EAP and it also works. Unfortunately there is still something wrong with my project and actions are not getting mapped... I will try to check what's the reason and keep you updated.
          Hide
          Lukasz Lenart added a comment -

          NIce Updated docs

          Show
          Lukasz Lenart added a comment - NIce Updated docs
          Hide
          Rafal Szczepankiewicz added a comment -

          It's working !!! I can confirm that actions are mapped on JBoss AS 5.1
          Tommorrow at work I will check if same solution works on JBoss EAP.

          One thing worth mentioning is that for me and probably all windows users (I'm using win 7 64 bit)
          you need to modify run.conf.bat file and add this line:
          set "JAVA_OPTS=%JAVA_OPTS% -Djboss.vfs.forceVfsJar=true"

          Show
          Rafal Szczepankiewicz added a comment - It's working !!! I can confirm that actions are mapped on JBoss AS 5.1 Tommorrow at work I will check if same solution works on JBoss EAP. One thing worth mentioning is that for me and probably all windows users (I'm using win 7 64 bit) you need to modify run.conf.bat file and add this line: set "JAVA_OPTS=%JAVA_OPTS% -Djboss.vfs.forceVfsJar=true"
          Hide
          Lukasz Lenart added a comment -

          Added note about that to the docs

          https://cwiki.apache.org/WW/jboss-5.html

          Show
          Lukasz Lenart added a comment - Added note about that to the docs https://cwiki.apache.org/WW/jboss-5.html
          Hide
          Lukasz Lenart added a comment -

          You must set jboss.vfs.forceVfsJar=true in bin/run.conf

          Discovered that when removed current JBoss installation and downloaded new one from the internet

          Show
          Lukasz Lenart added a comment - You must set jboss.vfs.forceVfsJar=true in bin/run.conf Discovered that when removed current JBoss installation and downloaded new one from the internet
          Hide
          Lukasz Lenart added a comment -

          Which version of JBoss did you use? jboss-5.1.0.GA-jdk6.zip or jboss-5.1.0.GA.zip?

          Show
          Lukasz Lenart added a comment - Which version of JBoss did you use? jboss-5.1.0.GA-jdk6.zip or jboss-5.1.0.GA.zip?
          Hide
          Lukasz Lenart added a comment -

          java version "1.6.0_37" on Mac Pro, what OS do you use? are the empty spaces in the path to JBoss home?

          Just cleaned up JBoss and the same, the jar action is in /BOL/ACE/NewLook namespace.

          Show
          Lukasz Lenart added a comment - java version "1.6.0_37" on Mac Pro, what OS do you use? are the empty spaces in the path to JBoss home? Just cleaned up JBoss and the same, the jar action is in /BOL/ACE/NewLook namespace.
          Hide
          Rafal Szczepankiewicz added a comment -

          I just downloaded fresh copy of JBoss 5.1 AS and installed latest java 1.6.0.41 and still got same result.

          Show
          Rafal Szczepankiewicz added a comment - I just downloaded fresh copy of JBoss 5.1 AS and installed latest java 1.6.0.41 and still got same result.
          Hide
          Rafal Szczepankiewicz added a comment -

          Tested this on 3 different computers and not working on all of them, can you try again with cleaning tmp/work folders ?

          Show
          Rafal Szczepankiewicz added a comment - Tested this on 3 different computers and not working on all of them, can you try again with cleaning tmp/work folders ?
          Hide
          Rafal Szczepankiewicz added a comment -

          I'm using EAP 5.0.1 but it doesn't work also with AS 5.1 GA on my computer. What Java version are you using ?

          Show
          Rafal Szczepankiewicz added a comment - I'm using EAP 5.0.1 but it doesn't work also with AS 5.1 GA on my computer. What Java version are you using ?
          Hide
          Lukasz Lenart added a comment -

          AS, 5.1

          Show
          Lukasz Lenart added a comment - AS, 5.1
          Hide
          Rafal Szczepankiewicz added a comment -

          hmm are you using Jboss EAP or AS version ?

          Show
          Rafal Szczepankiewicz added a comment - hmm are you using Jboss EAP or AS version ?
          Hide
          Lukasz Lenart added a comment -

          Just deployed your example and everything is ok, action is visible, the second jar contains no actions

          Show
          Lukasz Lenart added a comment - Just deployed your example and everything is ok, action is visible, the second jar contains no actions
          Hide
          Rafal Szczepankiewicz added a comment -

          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.

          Show
          Rafal Szczepankiewicz added a comment - 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.
          Hide
          Lukasz Lenart added a comment -

          includeJars is applied to path so it would be the best to have something like "all the jars that match *struts2-jboss* directory"

          Show
          Lukasz Lenart added a comment - includeJars is applied to path so it would be the best to have something like "all the jars that match *struts2-jboss* directory"
          Hide
          Rafal Szczepankiewicz added a comment -

          this is strange, I will double check that but includeJars shouldn't change if I'm using same jar.

          Show
          Rafal Szczepankiewicz added a comment - this is strange, I will double check that but includeJars shouldn't change if I'm using same jar.
          Hide
          Lukasz Lenart added a comment -

          I have added second jar to the project, everything is ok. The mentioned problem is probably related to includeJars' pattern.

          Show
          Lukasz Lenart added a comment - I have added second jar to the project, everything is ok. The mentioned problem is probably related to includeJars' pattern.
          Hide
          Rafal Szczepankiewicz added a comment -

          sure, thanks!
          Just to save you time problem seems to be with readUrls method in PackageBasedActionConfigBuilder that for some reason returns only first jar from whole war file.

          Show
          Rafal Szczepankiewicz added a comment - sure, thanks! Just to save you time problem seems to be with readUrls method in PackageBasedActionConfigBuilder that for some reason returns only first jar from whole war file.
          Hide
          Lukasz Lenart added a comment -

          Ok, will try tomorrow

          Show
          Lukasz Lenart added a comment - Ok, will try tomorrow
          Hide
          Rafal Szczepankiewicz added a comment -

          Unfortunately it is not yet entirely fixed.

          With current fix actions will only be loaded from the first jar (alphabetical order) that is present under WEB-INF folder. All others will be ignored.

          In order to reproduce it using your example please add second jar to
          struts2-ear-web-1.0-SNAPSHOT.war -> WEB-INF -> lib with the name axxxxx.jar

          Show
          Rafal Szczepankiewicz added a comment - Unfortunately it is not yet entirely fixed. With current fix actions will only be loaded from the first jar (alphabetical order) that is present under WEB-INF folder. All others will be ignored. In order to reproduce it using your example please add second jar to struts2-ear-web-1.0-SNAPSHOT.war -> WEB-INF -> lib with the name axxxxx.jar
          Hide
          Hudson added a comment -

          Integrated in Struts2-JDK6 #647 (See https://builds.apache.org/job/Struts2-JDK6/647/)
          WW-3984 Adds support for URLs which are already normalized to file protocol (Revision 1447738)

          Result = SUCCESS
          lukaszlenart :
          Files :

          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
          Show
          Hudson added a comment - Integrated in Struts2-JDK6 #647 (See https://builds.apache.org/job/Struts2-JDK6/647/ ) WW-3984 Adds support for URLs which are already normalized to file protocol (Revision 1447738) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
          Hide
          Lukasz Lenart added a comment -

          Finally

          Show
          Lukasz Lenart added a comment - Finally
          Hide
          Lukasz Lenart added a comment -

          Check the example application on GitHub, I added a new subproject to emulate jar inside war and also changed configuration a bit - *.tmp files are files extracted by JBoss from ear/lib directory. Thus is strange as jars inside war are extracted to $JBOSS_HOME/server/default/tmp/<some-random-path>/filename.jar. Wait for Hudson to test.

          Now I must check if that didn't break support for JBoss 7

          Show
          Lukasz Lenart added a comment - Check the example application on GitHub, I added a new subproject to emulate jar inside war and also changed configuration a bit - *.tmp files are files extracted by JBoss from ear/lib directory. Thus is strange as jars inside war are extracted to $JBOSS_HOME/server/default/tmp/<some-random-path>/filename.jar . Wait for Hudson to test. Now I must check if that didn't break support for JBoss 7
          Hide
          Hudson added a comment -

          Integrated in Struts2-JDK6 #646 (See https://builds.apache.org/job/Struts2-JDK6/646/)
          WW-3984 Reverts some changes from previous commit (Revision 1447689)
          WW-3984 Adds additional logging to check what is wrong (Revision 1447654)

          Result = SUCCESS
          lukaszlenart :
          Files :

          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/JarEntryRevision.java

          lukaszlenart :
          Files :

          • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
          Show
          Hudson added a comment - Integrated in Struts2-JDK6 #646 (See https://builds.apache.org/job/Struts2-JDK6/646/ ) WW-3984 Reverts some changes from previous commit (Revision 1447689) WW-3984 Adds additional logging to check what is wrong (Revision 1447654) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/JarEntryRevision.java lukaszlenart : Files : /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
          Hide
          Rafal Szczepankiewicz added a comment -

          No actions are mapped, I've added config-browser screenshot from my browser.

          Show
          Rafal Szczepankiewicz added a comment - No actions are mapped, I've added config-browser screenshot from my browser.
          Hide
          Lukasz Lenart added a comment - - edited

          Ad.1 Shouldn't be a problem as annotation is just an additional hint for PackageBasedActionConfigBuilder how to build configuration.
          Ad.2 Hm... thus can be problematic thing - even with the attached WARN I was able to access actions defined in a jar outside war archive

          Show
          Lukasz Lenart added a comment - - edited Ad.1 Shouldn't be a problem as annotation is just an additional hint for PackageBasedActionConfigBuilder how to build configuration. Ad.2 Hm... thus can be problematic thing - even with the attached WARN I was able to access actions defined in a jar outside war archive
          Hide
          Rafal Szczepankiewicz added a comment -

          I noticed few things:

          1. Your example doesn't use any actions defined by annotation with custom namespace/action names.
          2. Your example have a bit different structure. I have my actions inside jar file that is placed inside war file. Yours is outside war.

          Also I think I don't see any actions in config-browser. Can you paste a screenshot showing how/where to check if actions are mapped using config-browser ?

          Show
          Rafal Szczepankiewicz added a comment - I noticed few things: 1. Your example doesn't use any actions defined by annotation with custom namespace/action names. 2. Your example have a bit different structure. I have my actions inside jar file that is placed inside war file. Yours is outside war. Also I think I don't see any actions in config-browser. Can you paste a screenshot showing how/where to check if actions are mapped using config-browser ?
          Hide
          Lukasz Lenart added a comment -

          The simplest way to check mapping is to include the Config Browser plugin and navigate to /config-browser/index.action

          Show
          Lukasz Lenart added a comment - The simplest way to check mapping is to include the Config Browser plugin and navigate to /config-browser/index.action
          Hide
          Lukasz Lenart added a comment -

          Yes, got the same error, but application works as those WARNs are related to DevMode and have nothing to do with the action resolution.

          Anyway I found the mistake, will commit soon.

          Show
          Lukasz Lenart added a comment - Yes, got the same error, but application works as those WARNs are related to DevMode and have nothing to do with the action resolution. Anyway I found the mistake, will commit soon.
          Hide
          Rafal Szczepankiewicz added a comment - - edited

          I've got the same error using your example:

          11:51:53,616 INFO [XmlConfigurationProvider] Parsing configuration file [struts-plugin.xml]
          11:51:53,620 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/struts2-ear.ear]!
          java.lang.NullPointerException
          at java.util.zip.ZipFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47)
          at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80)
          at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)
          at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225)

          I will test the same using JBoss 5.1.2 EAP

          Unfortunately I have the same error on EAP JBoss 5.1.2

          Show
          Rafal Szczepankiewicz added a comment - - edited I've got the same error using your example: 11:51:53,616 INFO [XmlConfigurationProvider] Parsing configuration file [struts-plugin.xml] 11:51:53,620 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/struts2-ear.ear] ! java.lang.NullPointerException at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47) at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80) at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225) I will test the same using JBoss 5.1.2 EAP Unfortunately I have the same error on EAP JBoss 5.1.2
          Hide
          Rafal Szczepankiewicz added a comment - - edited

          I'm using JBoss EAP 5.0.1. Checked just now using same constants and effect is the same.
          Application is deployed correctly but struts 2 actions are not mapped hence I'm getting no actions defined error.

          Okey checking with your app

          Show
          Rafal Szczepankiewicz added a comment - - edited I'm using JBoss EAP 5.0.1. Checked just now using same constants and effect is the same. Application is deployed correctly but struts 2 actions are not mapped hence I'm getting no actions defined error. Okey checking with your app
          Hide
          Lukasz Lenart added a comment - - edited

          Here is [1] the demo code I've been using, just run mv clean package and copy ear from struts2-ear-ear/target to $JBOSS_HOME/server/default/deploy/

          [1] https://github.com/lukaszlenart/struts2-jboss-ear

          Show
          Lukasz Lenart added a comment - - edited Here is [1] the demo code I've been using, just run mv clean package and copy ear from struts2-ear-ear/target to $JBOSS_HOME/server/default/deploy/ [1] https://github.com/lukaszlenart/struts2-jboss-ear
          Hide
          Lukasz Lenart added a comment -

          And those are WARNs, did you check if application works?

          I added some more logging, could wait for Hudson and test again enabling DEBUG level for org.apache.struts2.util.fs ?

          Show
          Lukasz Lenart added a comment - And those are WARNs, did you check if application works? I added some more logging, could wait for Hudson and test again enabling DEBUG level for org.apache.struts2.util.fs ?
          Hide
          Lukasz Lenart added a comment -

          This is a bit strange. What version of JBoss do you use? I've been testing with jboss-5.1.0.GA. I also used such struts.xml configuration:

          <struts>
          
              <constant name="struts.devMode" value="true" />
              <constant name="struts.convention.exclude.parentClassLoader" value="true" />
              <constant name="struts.convention.action.fileProtocols" value="jar,vfsfile,vfszip" />
              <constant name="struts.convention.action.mapAllMatches" value="true" />
              <constant name="struts.convention.package.locators" value="actions"/>
          
          </struts>
          
          Show
          Lukasz Lenart added a comment - This is a bit strange. What version of JBoss do you use? I've been testing with jboss-5.1.0.GA. I also used such struts.xml configuration: <struts> <constant name= "struts.devMode" value= "true" /> <constant name= "struts.convention.exclude.parentClassLoader" value= "true" /> <constant name= "struts.convention.action.fileProtocols" value= "jar,vfsfile,vfszip" /> <constant name= "struts.convention.action.mapAllMatches" value= "true" /> <constant name= "struts.convention.package.locators" value= "actions" /> </struts>
          Hide
          Rafal Szczepankiewicz added a comment -

          I've tested the fix and unfortunately it doesn't work.
          When using my work project I get following error when EAR is not exploded:

          09:57:57,086 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/BOL_APP.ear]!
          java.lang.NullPointerException
          at java.util.zip.ZipFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47)
          at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80)
          at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)

          I got the same error for all jars inside the ear file.

          When EAR is exploded I get similiar error for jar files:

          10:03:29,413 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/BOL_APP.ear/webapp.war/WEB-INF/lib/webappJava.jar]!
          java.lang.NullPointerException
          at java.util.zip.ZipFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47)
          at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80)
          at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)

          using above example TestEAR.ear I also get the same error:

          10:40:37,045 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/TestEAR.ear]!
          java.lang.NullPointerException
          at java.util.zip.ZipFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at java.util.jar.JarFile.<init>(Unknown Source)
          at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47)
          at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80)
          at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
          at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)
          at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225)
          at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)

          I've used latest build with your changes. I'm adding libs from struts 2.3.11 I've used as attachement.

          Show
          Rafal Szczepankiewicz added a comment - I've tested the fix and unfortunately it doesn't work. When using my work project I get following error when EAR is not exploded: 09:57:57,086 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/BOL_APP.ear] ! java.lang.NullPointerException at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47) at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80) at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132) I got the same error for all jars inside the ear file. When EAR is exploded I get similiar error for jar files: 10:03:29,413 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/BOL_APP.ear/webapp.war/WEB-INF/lib/webappJava.jar] ! java.lang.NullPointerException at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47) at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80) at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165) using above example TestEAR.ear I also get the same error: 10:40:37,045 WARN [JarEntryRevision] Could not create JarEntryRevision for [jar:file:/c:/program files/jboss/jboss-as/server/default/deploy/TestEAR.ear] ! java.lang.NullPointerException at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:47) at org.apache.struts2.util.fs.JBossFileManager.monitorFile(JBossFileManager.java:80) at com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1003) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) I've used latest build with your changes. I'm adding libs from struts 2.3.11 I've used as attachement.
          Hide
          Hudson added a comment -

          Integrated in Struts2-JDK6 #645 (See https://builds.apache.org/job/Struts2-JDK6/645/)
          WW-3984 Adds support for Convention plugin which based on actions in a Jar file embedded in Ear file on JBoss 5 server (Revision 1447442)

          Result = SUCCESS
          lukaszlenart :
          Files :

          • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/FileRevision.java
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/JarEntryRevision.java
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/Revision.java
          Show
          Hudson added a comment - Integrated in Struts2-JDK6 #645 (See https://builds.apache.org/job/Struts2-JDK6/645/ ) WW-3984 Adds support for Convention plugin which based on actions in a Jar file embedded in Ear file on JBoss 5 server (Revision 1447442) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/DefaultFileManager.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/FileRevision.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/JarEntryRevision.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/fs/Revision.java
          Hide
          Lukasz Lenart added a comment -

          Done, committed! Thanks for reporting, you can wait for Hudson's comment here and test with the latest build.

          Show
          Lukasz Lenart added a comment - Done, committed! Thanks for reporting, you can wait for Hudson's comment here and test with the latest build.
          Hide
          Lukasz Lenart added a comment -

          few days to solve two showstoppers, week of testing and done

          Show
          Lukasz Lenart added a comment - few days to solve two showstoppers, week of testing and done
          Hide
          Rafal Szczepankiewicz added a comment -

          Any approx date for 2.3.11 ?

          Show
          Rafal Szczepankiewicz added a comment - Any approx date for 2.3.11 ?
          Hide
          Lukasz Lenart added a comment -

          2.3.10 will be dropped and new 2.3.11 will be prepared instead.

          Show
          Lukasz Lenart added a comment - 2.3.10 will be dropped and new 2.3.11 will be prepared instead.
          Hide
          Rafal Szczepankiewicz added a comment -

          sorry, please let me know when the changes are committed so I can download them and test if the issue is resolved.
          Btw what's the approx release date for 2.3.10 ? On the web (https://issues.apache.org/jira/browse/WW/fixforversion/12323841) but it looks outdated.

          Show
          Rafal Szczepankiewicz added a comment - sorry, please let me know when the changes are committed so I can download them and test if the issue is resolved. Btw what's the approx release date for 2.3.10 ? On the web ( https://issues.apache.org/jira/browse/WW/fixforversion/12323841 ) but it looks outdated.
          Hide
          Lukasz Lenart added a comment -

          I didn't commit my changes yet...

          Show
          Lukasz Lenart added a comment - I didn't commit my changes yet...
          Hide
          Rafal Szczepankiewicz added a comment -

          Oh ok
          So should I grab the latest version from Struts_2_3_X ?

          Show
          Rafal Szczepankiewicz added a comment - Oh ok So should I grab the latest version from Struts_2_3_X ?
          Hide
          Lukasz Lenart added a comment -

          These are the JIRA version numbers
          Fix Version/s 2.3.10 [ 12323841 ]
          Fix Version/s 2.3.11 [ 12323903 ]

          Show
          Lukasz Lenart added a comment - These are the JIRA version numbers Fix Version/s 2.3.10 [ 12323841 ] Fix Version/s 2.3.11 [ 12323903 ]
          Hide
          Rafal Szczepankiewicz added a comment -

          Strange there was a post posted today at 9:13 with the info that you have fix ready containing following information:

          2.3.10 [ 12323841 ]
          2.3.11 [ 12323903 ]

          but it is not here anymore...

          Anyway please let me know how and from where I can grab the patch/fix when ready Thanks!

          Show
          Rafal Szczepankiewicz added a comment - Strange there was a post posted today at 9:13 with the info that you have fix ready containing following information: 2.3.10 [ 12323841 ] 2.3.11 [ 12323903 ] but it is not here anymore... Anyway please let me know how and from where I can grab the patch/fix when ready Thanks!
          Hide
          Lukasz Lenart added a comment -

          From where are those revision numbers?

          Show
          Lukasz Lenart added a comment - From where are those revision numbers?
          Hide
          Rafal Szczepankiewicz added a comment -

          I could not find revisions 12323841 and 12323903 in the http://svn.apache.org/repos/asf/struts/struts2/... Am I looking in the right place ?

          Show
          Rafal Szczepankiewicz added a comment - I could not find revisions 12323841 and 12323903 in the http://svn.apache.org/repos/asf/struts/struts2/ ... Am I looking in the right place ?
          Hide
          Rafal Szczepankiewicz added a comment -

          great news ! keeping my fingers crossed and waiting for the fix

          Show
          Rafal Szczepankiewicz added a comment - great news ! keeping my fingers crossed and waiting for the fix
          Hide
          Lukasz Lenart added a comment -

          Ok, I found a solution but it's a bit ugly as whole JBoss idea about VFS Need to refactor FileManagers and should be ok.

          Show
          Lukasz Lenart added a comment - Ok, I found a solution but it's a bit ugly as whole JBoss idea about VFS Need to refactor FileManagers and should be ok.
          Hide
          Lukasz Lenart added a comment -

          Does it work with any other version? 2.1.8? 2.2.3?

          Show
          Lukasz Lenart added a comment - Does it work with any other version? 2.1.8? 2.2.3?
          Hide
          Rafal Szczepankiewicz added a comment -

          Hey Lukasz,
          thank you for your help.
          Yes I've tried struts 2.3.4.1, 2.3.3, 2.3.1.2.
          2.3.4.1 - no actions mapped (jar is not found via url lookup in class PackageBasedActionConfigBuilder) or exception saying that web-inf classes could not be found (depending on excludeParentClassLoader param true/false)
          2.3.3 - won't even start keep getting could not find struts-default.xml
          2.3.1.2 - no errors at all but no actions are mapped regardless of excludeParentClassLoader setting.

          Show
          Rafal Szczepankiewicz added a comment - Hey Lukasz, thank you for your help. Yes I've tried struts 2.3.4.1, 2.3.3, 2.3.1.2. 2.3.4.1 - no actions mapped (jar is not found via url lookup in class PackageBasedActionConfigBuilder) or exception saying that web-inf classes could not be found (depending on excludeParentClassLoader param true/false) 2.3.3 - won't even start keep getting could not find struts-default.xml 2.3.1.2 - no errors at all but no actions are mapped regardless of excludeParentClassLoader setting.
          Hide
          Lukasz Lenart added a comment - - edited

          Did you try any other older version of Struts 2? 2.3.3? 2.3.4.1?

          And it would be better to attach a Maven based project instead of ear file - not needed, found one

          Show
          Lukasz Lenart added a comment - - edited Did you try any other older version of Struts 2? 2.3.3? 2.3.4.1? And it would be better to attach a Maven based project instead of ear file - not needed, found one
          Hide
          Rafal Szczepankiewicz added a comment -

          imported libs

          Show
          Rafal Szczepankiewicz added a comment - imported libs
          Hide
          Rafal Szczepankiewicz added a comment -

          server logs with errors

          Show
          Rafal Szczepankiewicz added a comment - server logs with errors
          Hide
          Rafal Szczepankiewicz added a comment -

          EAR that reproduces the error

          Show
          Rafal Szczepankiewicz added a comment - EAR that reproduces the error

            People

            • Assignee:
              Lukasz Lenart
              Reporter:
              Rafal Szczepankiewicz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development