Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3662

convention-plugin not work in jboss-7.0.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.3
    • Component/s: Plugin - Convention
    • Labels:
      None
    • Environment:

      OS:win7, JDK:1.6.0_26, APP:jboss 7.0.0

      Description

      1. first, replace the xwork-x.x.x.jar with a bug-fixed version, see: https://issues.apache.org/jira/browse/WW-3558, prevent the bug breaking the deployment

      2. use follow config in struts.xml
      <constant name="struts.convention.exclude.parentClassLoader" value="true" />
      <constant name="struts.convention.action.fileProtocols" value="jar,vfs,vfsfile,vfszip" />

      <constant name="struts.convention.package.locators" value="actions,action" />
      <constant name="struts.convention.package.locators.disable" value="false" />
      <constant name="struts.convention.package.locators.basePackage" value="com.mcms.web.actions" />

      3. deploy *.war file to jboss, then start it, get follow error log
      17:40:27,711 SEVERE [com.opensymphony.xwork2.util.finder.ClassFinder] Unable to read URL [vfs:/G:/jboss-as-7.0.0.Final/bin/content/struts2.war/WEB-INF/classes/]: java.io.FileNotFoundException: G:\jboss-as-7.0.0.Final\bin\content\struts2.war\WEB-INF\classes
      at java.io.FileInputStream.open(Native Method) [:1.6.0_26]
      at java.io.FileInputStream.<init>(FileInputStream.java:120) [:1.6.0_26]
      at java.io.FileInputStream.<init>(FileInputStream.java:79) [:1.6.0_26]
      at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70) [:1.6.0_26]
      at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) [:1.6.0_26]
      at java.net.URL.openStream(URL.java:1010) [:1.6.0_26]
      at com.opensymphony.xwork2.util.finder.ClassFinder.jar(ClassFinder.java:480) [xwork-core-2.2.3.jar:]
      at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:144) [xwork-core-2.2.3.jar:]
      at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:376) [struts2-convention-plugin-2.2.3.jar:]
      at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:334) [struts2-convention-plugin-2.2.3.jar:]
      at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53) [struts2-convention-plugin-2.2.3.jar:]

      4. use follow config in struts.xml
      <constant name="struts.convention.package.locators" value="actions,action" />
      <constant name="struts.convention.package.locators.disable" value="false" />
      <constant name="struts.convention.package.locators.basePackage" value="com.mcms.web.actions" />

      5. deploy *.war file to jboss, then start it.
      The war package deployed without any error, but no struts actions will be found(either use package scan or annotation)

        Attachments

        1. screenshot-invalid.png
          19 kB
          Karel Piwko
        2. ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg
          20 kB
          Lukasz Lenart
        3. struts2-annon.zip
          21 kB
          Karel Piwko
        4. xwork-core-2.2.3.1-temporarily-resolved.jar
          610 kB
          lwen.ma
        5. URLUtil.java
          4 kB
          Sreekanth S Nair
        6. JBoss7Fix-2.patch
          7 kB
          Rob Juurlink
        7. xwork-core-2.2.1.2-SNAPSHOT.jar
          1.12 MB
          Rob Juurlink
        8. JBoss7Fix.patch
          8 kB
          Rob Juurlink

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                mlw5415 lwen.ma
              • Votes:
                8 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: