Uploaded image for project: 'ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)'
  1. ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)
  2. LEP-6701

-Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory MISSING ! 5.0.x - OR - missing bea's stax-1.2.0.jar in lib/ext

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      liferay-portal-tomcat-6.0-5.0.1 bundle. Java jdk: sun jdk1.5.0_15

      Description

      Here are simplified function calls (must be from your portlet)
      ==========================
      Here are simplifie d functions from my OffererTopList class:

      private caller() {
      long groupId=GroupLocalServiceUtil.getUserGroup(10108, 10310).getGroupId();
      List<Layout> ls=LayoutLocalServiceUtil.getLayouts(groupId, false);
      Layout lo=findIntroTab(ls);
      // etc...
      }

      private Layout findIntroTab(List<Layout> layouts) {
      for (Layout l : layouts)
      if ("Intro".equals(l.getName("en_US",true))) // <-- EXCEPTION can't use wstx because factory is not in environment.
      return l;
      return null;
      }

      Here's exception:
      ==============
      Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found
      at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
      at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:178)
      at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
      at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
      at com.liferay.util.LocalizationUtil.getLocalization(LocalizationUtil.java:113)
      at com.liferay.portal.model.impl.LayoutImpl.getName(LayoutImpl.java:361)
      at com.liferay.portal.model.impl.LayoutImpl.getName(LayoutImpl.java:357)

      SOLUTION 1)

      Move stax.jar and wstx.jar from catalina/webapps\ROOT\WEB-INF\lib and put them into catalina/lib/ext (otherwise we will have them doubled and our portlet will colide with existing portlets and will will have exception : cant cast from class A to class A)

      this parameters must be set in environment:
      -Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
      -Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
      -Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory

      SOLUTION 2)

      Move stax.jar from catalina/webapps\ROOT\WEB-INF\lib and put it into catalina/lib/ext.
      Delete wstx.jar .
      Add stax-1.2.0.jar to catalina/lib/ext.

      Then above ridicolous -D settings are not needed.

      The end.

      Did anyone ever in history of liferay use function layout.getName("something here") ??? I am frustrated by this liferay product.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 minute
                1m
                Remaining:
                Remaining Estimate - 1 minute
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Packages

                  Version Package