Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5521

WebAppUtil.getWebappInfoFromWebsiteId throws IllegalArgumentException when web.xml not found

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: ALL COMPONENTS
    • Labels:
      None

      Description

      WebAppUtil.getWebappInfoFromWebsiteId throws IllegalArgumentException when web.xml does not exist in applications/content/webapp/content/images/WEB-INF/web.xml. This causes org.ofbiz.common.email.NotificationServices.setBaseUrl to fail when webSiteId is a custom component site id.

      Stack trace
      java.lang.IllegalArgumentException: applications/content/webapp/content/images/WEB-INF/web.xml does not exist.
      org.ofbiz.webapp.WebAppUtil.parseWebXmlFile(WebAppUtil.java:148)
      org.ofbiz.webapp.WebAppUtil.getWebXml(WebAppUtil.java:131)
      org.ofbiz.webapp.WebAppUtil.getWebSiteId(WebAppUtil.java:117)
      org.ofbiz.webapp.WebAppUtil.getWebappInfoFromWebsiteId(WebAppUtil.java:100)
      org.ofbiz.common.email.NotificationServices.setBaseUrl(NotificationServices.java:262)
      org.ofbiz.common.email.NotificationServices.prepareNotification(NotificationServices.java:200)
      org.ofbiz.common.email.NotificationServices.sendNotification(NotificationServices.java:132)

      1. WebAppUtil.patch
        1 kB
        Gareth Carter

        Issue Links

          Activity

          Hide
          gareth.carter Gareth Carter added a comment -

          Theres a webapp reference in the ofbiz-component.xml but there is no WEB-INF folder or web.xml

          <webapp name="contentimages" title="Content Images" server="default-server" location="webapp/content/images" mount-point="/contentimages/" app-bar-display="false"/>

          Show
          gareth.carter Gareth Carter added a comment - Theres a webapp reference in the ofbiz-component.xml but there is no WEB-INF folder or web.xml <webapp name="contentimages" title="Content Images" server="default-server" location="webapp/content/images" mount-point="/contentimages/" app-bar-display="false"/>
          Hide
          gareth.carter Gareth Carter added a comment -

          Simple patch to add a try catch IllegalArgumentException in the loop

          Show
          gareth.carter Gareth Carter added a comment - Simple patch to add a try catch IllegalArgumentException in the loop
          Hide
          jacques.le.roux Jacques Le Roux added a comment -
          Show
          jacques.le.roux Jacques Le Roux added a comment - I added it at http://svn.apache.org/viewvc?view=revision&revision=1519245 I will check that!
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This not the reason of the problem. It was my bad, I was simply stupid (too fast, no thoughts) on this

          I reverted r1519245 at
          trunk r1562767
          R13.07 r1562768
          R12.04 r1562769
          R11.04 r156270

          Show
          jacques.le.roux Jacques Le Roux added a comment - This not the reason of the problem. It was my bad, I was simply stupid (too fast, no thoughts) on this I reverted r1519245 at trunk r1562767 R13.07 r1562768 R12.04 r1562769 R11.04 r156270
          Hide
          jacques.le.roux Jacques Le Roux added a comment - - edited

          == TYPO ==
          If OFBIZ-5305 is re-done then this will need to be also

          Show
          jacques.le.roux Jacques Le Roux added a comment - - edited == TYPO == If OFBIZ-5305 is re-done then this will need to be also
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I need to reapply after OFBIZ-5305 (itself after OFBIZ-5312)

          Show
          jacques.le.roux Jacques Le Roux added a comment - I need to reapply after OFBIZ-5305 (itself after OFBIZ-5312 )
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I finally prefered to add an empty contenimages webapp. Though I did not test (please do) I'm quite reassured this will do it here.

          Fixed at r1658622

          Show
          jacques.le.roux Jacques Le Roux added a comment - I finally prefered to add an empty contenimages webapp. Though I did not test (please do) I'm quite reassured this will do it here. Fixed at r1658622

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              gareth.carter Gareth Carter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development