Jetspeed 2
  1. Jetspeed 2
  2. JS2-558

Only "NULL" is shown in browser at what seems to be random intervals.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Incomplete
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: Layout
    • Labels:
      None
    • Environment:
      Apache/2.0.52 (CentOS) with Apache Tomcat 5.5.17 running in jdk1.5.0_03. Jetspeed 2.0 Final.

      Description

      Everything works fine in the portal most of the time, but at random intervals "NULL" is the only text rendered by the browser. I have looked at the jetspeed.log and found out that it prints out a stacktrace which seems to come from the rendering of the layout portlet. I will try to upload this as an attachement.

      1. jetspeed_log_snapshot_of_request.txt
        18 kB
        Eivinn Hustveit
      2. Jetspeed_stacktrace.txt
        13 kB
        Eivinn Hustveit

        Activity

        Hide
        David Sean Taylor added a comment -

        There was been no follow up on this issue after 1.5 years. I reviewed the code and it is almost completely rewritten in this area.

        Show
        David Sean Taylor added a comment - There was been no follow up on this issue after 1.5 years. I reviewed the code and it is almost completely rewritten in this area.
        Hide
        David Sean Taylor added a comment -

        Moving this issue to 2.2-dev

        Show
        David Sean Taylor added a comment - Moving this issue to 2.2-dev
        Hide
        David Sean Taylor added a comment -

        The default profiling rule makes Jetspeed look in the wml directory.
        You can change this or create a new rule. In the case of the j2 rule, just remove the mediatype requirement
        In the meantime I will try to come up with a patch to the NPE described above

        <ProfilingRule id="j2" standardRule="true">
        <description value="The default profiling rule for users and mediatype minus language and country."/>
        <Criteria>
        <Criterion name="user">
        <type value="group.role.user"/>
        <fallBackOrder value="1"/>
        <fallBackType value="0"/>
        </Criterion>
        REMOVE THIS CRITERION
        <Criterion name="mediatype">
        <type value="mediatype"/>
        <fallBackOrder value="2"/>
        <fallBackType value="1"/>
        </Criterion>
        <Criterion name="page">
        <type value="path.session"/>
        <value value="default-page"/>
        <fallBackOrder value="0"/>
        <fallBackType value="0"/>
        </Criterion>
        </Criteria>
        </ProfilingRule>

        Show
        David Sean Taylor added a comment - The default profiling rule makes Jetspeed look in the wml directory. You can change this or create a new rule. In the case of the j2 rule, just remove the mediatype requirement In the meantime I will try to come up with a patch to the NPE described above <ProfilingRule id="j2" standardRule="true"> <description value="The default profiling rule for users and mediatype minus language and country."/> <Criteria> <Criterion name="user"> <type value="group.role.user"/> <fallBackOrder value="1"/> <fallBackType value="0"/> </Criterion> REMOVE THIS CRITERION <Criterion name="mediatype"> <type value="mediatype"/> <fallBackOrder value="2"/> <fallBackType value="1"/> </Criterion> <Criterion name="page"> <type value="path.session"/> <value value="default-page"/> <fallBackOrder value="0"/> <fallBackType value="0"/> </Criterion> </Criteria> </ProfilingRule>
        Hide
        Eivinn Hustveit added a comment -

        I have now found out what happens when we browse Jetspeed with a UserAgent on which the CapabilityValveImpl returns wml as the mediatype.

        1. the line that causes the nullpointer is like you pointed out:
        absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ".vm",
        JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();

        2. The reason is that jpt.getTemplate is in fact returning null.

        3. The cause of point 2 is that the JetspeedPowerToolImpl.getTemplate(path, templateType, locator, descriptor) runs the following code in which returns null:
        TemplateDescriptor template = locator.locateTemplate(descriptor);

        This is due to the fact that the descriptor is using mediaType="wml" which again makes Jetspeed look for a template.vm located at apache-tomcat-5.5.20/webapps/jetspeed/WEB-INF/templates/layout/wml/en/US/layout.vm
        This template does not exist.

        I must admit that I cannot find out how to disable the WML support in Jetspeed when it is not needed. In my opinion the standard install should also default to XHTML and not HTML, but this is another discussion.

        Show
        Eivinn Hustveit added a comment - I have now found out what happens when we browse Jetspeed with a UserAgent on which the CapabilityValveImpl returns wml as the mediatype. 1. the line that causes the nullpointer is like you pointed out: absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ".vm", JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath(); 2. The reason is that jpt.getTemplate is in fact returning null. 3. The cause of point 2 is that the JetspeedPowerToolImpl.getTemplate(path, templateType, locator, descriptor) runs the following code in which returns null: TemplateDescriptor template = locator.locateTemplate(descriptor); This is due to the fact that the descriptor is using mediaType="wml" which again makes Jetspeed look for a template.vm located at apache-tomcat-5.5.20/webapps/jetspeed/WEB-INF/templates/layout/wml/en/US/layout.vm This template does not exist. I must admit that I cannot find out how to disable the WML support in Jetspeed when it is not needed. In my opinion the standard install should also default to XHTML and not HTML, but this is another discussion.
        Hide
        Eivinn Hustveit added a comment -

        This is the exact trace from jetspeed.log for a request through Firefox with the SE K800 UserAgent. It looks to me that it is the line "org.apache.jetspeed.capabilities.impl.CapabilityValveImpl - Mimetype: text/vnd.wap.wml" is the clue to why the portlet fragment dp-1 (VelocityOneColumn) crash with a nullpionter.

        I'm currently downloading the Jetspeed source with the tag RELEASE-2.0 and will try to debug it and see whether I can nail it down to some exact reasons. If you have any tips to where I can place my breakpoints please inform me.

        PS! Our portal does not serve mobile web-pages, but a normal portlet web-app.

        Show
        Eivinn Hustveit added a comment - This is the exact trace from jetspeed.log for a request through Firefox with the SE K800 UserAgent. It looks to me that it is the line "org.apache.jetspeed.capabilities.impl.CapabilityValveImpl - Mimetype: text/vnd.wap.wml" is the clue to why the portlet fragment dp-1 (VelocityOneColumn) crash with a nullpionter. I'm currently downloading the Jetspeed source with the tag RELEASE-2.0 and will try to debug it and see whether I can nail it down to some exact reasons. If you have any tips to where I can place my breakpoints please inform me. PS! Our portal does not serve mobile web-pages, but a normal portlet web-app.
        Hide
        David Sean Taylor added a comment -

        Elvinn, I cannot see where there is an exception thrown for a Capabiility failure.
        I expected to find something like:

        "We were unable to build a capability map for the agent, "userAgent
        ". This might be an indiciation that the capability database has not been correctly initialized."

        or

        "CapabilityServiceImpl: UserAgentPattern not valid :"

        But i see neither of these messages in the logs

        I then wrote a unit test to check for SonyEricsson browser, and our regex found it for the agent. The test passed:

        userAgent = "SonyEricssonK800i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1";
        System.out.println("Find pattern: " + userAgent);
        cm = capabilities.getCapabilityMap(userAgent);
        assertNotNull("getCapabilityMap is null", cm);
        assertTrue("Ericsson", cm.getClient().getName().equals("sonyericsson"));
        capabilityMapReport(cm);

        So Im not sure if this error is caused by this particular agent

        Show
        David Sean Taylor added a comment - Elvinn, I cannot see where there is an exception thrown for a Capabiility failure. I expected to find something like: "We were unable to build a capability map for the agent, " userAgent ". This might be an indiciation that the capability database has not been correctly initialized." or "CapabilityServiceImpl: UserAgentPattern not valid :" But i see neither of these messages in the logs I then wrote a unit test to check for SonyEricsson browser, and our regex found it for the agent. The test passed: userAgent = "SonyEricssonK800i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"; System.out.println("Find pattern: " + userAgent); cm = capabilities.getCapabilityMap(userAgent); assertNotNull("getCapabilityMap is null", cm); assertTrue("Ericsson", cm.getClient().getName().equals("sonyericsson")); capabilityMapReport(cm); So Im not sure if this error is caused by this particular agent
        Hide
        Eivinn Hustveit added a comment -

        Example UA that causes the NULL bug for us:

        SonyEricssonK800i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1

        Show
        Eivinn Hustveit added a comment - Example UA that causes the NULL bug for us: SonyEricssonK800i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1
        Hide
        Eivinn Hustveit added a comment -

        I think we finally have found out what causes this issue. It is the use of the User-Agent switcher plug-in in Mozilla Firefox. We are developing services for the mobile phone web-browsers and "emulate" this software using this plugin. After setting user-agent to some phone and entering our Jetspeed portal this NULL message comes up. If one switches back to default (UA=Mozilla...) it all works perfectly.

        I assume the best fix would be to support all User-Agents and preferably return a default site if no mode exist for the given UA.

        Show
        Eivinn Hustveit added a comment - I think we finally have found out what causes this issue. It is the use of the User-Agent switcher plug-in in Mozilla Firefox. We are developing services for the mobile phone web-browsers and "emulate" this software using this plugin. After setting user-agent to some phone and entering our Jetspeed portal this NULL message comes up. If one switches back to default (UA=Mozilla...) it all works perfectly. I assume the best fix would be to support all User-Agents and preferably return a default site if no mode exist for the given UA.
        Hide
        Eivinn Hustveit added a comment -

        Yes, unfortunately we are. I don't know how I can debug it either because it has never happened on my own computer. It looks to be an error reappearing at random intervals. I will be very grateful if you have any suggestions to how we can try to figure out what the problem is.

        Just as a note I can tell you that we have had problems in the past with browser caches, but I don not feel confident enough to blame that in this case since it appeared in the first browser session this last time.

        Show
        Eivinn Hustveit added a comment - Yes, unfortunately we are. I don't know how I can debug it either because it has never happened on my own computer. It looks to be an error reappearing at random intervals. I will be very grateful if you have any suggestions to how we can try to figure out what the problem is. Just as a note I can tell you that we have had problems in the past with browser caches, but I don not feel confident enough to blame that in this case since it appeared in the first browser session this last time.
        Hide
        David Sean Taylor added a comment -

        Eivinn, this one seems to have slipped by me. Are you still having problems here?

        Show
        David Sean Taylor added a comment - Eivinn, this one seems to have slipped by me. Are you still having problems here?
        Hide
        Eivinn Hustveit added a comment -

        We have now gotten this error with some more leads. The errror "NULL" came after opening Jetspeed for the first time on that browser session (and that day).
        The portlet which fails is as you have mentioned the layout portlet and the fragment "dp-1" is the standard Jetspeed login-portlet.

        Hope someone can help.

        Show
        Eivinn Hustveit added a comment - We have now gotten this error with some more leads. The errror "NULL" came after opening Jetspeed for the first time on that browser session (and that day). The portlet which fails is as you have mentioned the layout portlet and the fragment "dp-1" is the standard Jetspeed login-portlet. Hope someone can help.
        Hide
        Eivinn Hustveit added a comment -

        Just to check if I understand you correctly:

        Does the viewPage variable comes from the page given to the request dispatcher in doView() or doEdit()?

        Show
        Eivinn Hustveit added a comment - Just to check if I understand you correctly: Does the viewPage variable comes from the page given to the request dispatcher in doView() or doEdit()?
        Hide
        David Sean Taylor added a comment -

        Looking at 2.0 final source, line 196 in LayoutPortlet.java:

        absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ".vm",
        JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath();

        One of the parameters in the statement above must be null.
        Ensure that:

        1. viewPage is not null. viewPage comes from either a preference or init parameter
        2. jpt.getTemplate could be returning null. Although in reviewing the code, I don't see how this could happen

        Show
        David Sean Taylor added a comment - Looking at 2.0 final source, line 196 in LayoutPortlet.java: absViewPage = jpt.getTemplate(viewPage + "/" + JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE + ".vm", JetspeedPowerTool.LAYOUT_TEMPLATE_TYPE).getAppRelativePath(); One of the parameters in the statement above must be null. Ensure that: 1. viewPage is not null. viewPage comes from either a preference or init parameter 2. jpt.getTemplate could be returning null. Although in reviewing the code, I don't see how this could happen
        Hide
        Eivinn Hustveit added a comment -

        Our default-page.psml is presented below. Don't know wether the properties referencing TwoColumns does have anything to do with it, but the page won't show without them.

        <page>
        <defaults
        skin="orange"
        layout-decorator="mobiletech"
        portlet-decorator="mobiletech"
        />

        <title>publish</title>
        <metadata name="title" xml:lang="nb">publish</metadata>

        <fragment id="dp-1" type="layout" name="jetspeed-layouts::VelocityOneColumn">
        <fragment id="dp-12" type="portlet" name="j2-admin::LoginPortlet">
        <property layout="TwoColumns" name="row" value="0" />
        <property layout="TwoColumns" name="column" value="0" />
        </fragment>
        <fragment id="mcms" type="portlet" name="mcms::mcmsP">
        <property layout="TwoColumns" name="row" value="1" />
        <property layout="TwoColumns" name="column" value="0" />
        </fragment>
        <fragment id="dp-3" type="portlet" name="j2-admin::LocaleSelector">
        <property layout="TwoColumns" name="row" value="2" />
        <property layout="TwoColumns" name="column" value="0" />
        </fragment>
        </fragment>

        <security-constraints>
        <security-constraints-ref>public-view</security-constraints-ref>
        </security-constraints>
        </page>

        Show
        Eivinn Hustveit added a comment - Our default-page.psml is presented below. Don't know wether the properties referencing TwoColumns does have anything to do with it, but the page won't show without them. <page> <defaults skin="orange" layout-decorator="mobiletech" portlet-decorator="mobiletech" /> <title>publish</title> <metadata name="title" xml:lang="nb">publish</metadata> <fragment id="dp-1" type="layout" name="jetspeed-layouts::VelocityOneColumn"> <fragment id="dp-12" type="portlet" name="j2-admin::LoginPortlet"> <property layout="TwoColumns" name="row" value="0" /> <property layout="TwoColumns" name="column" value="0" /> </fragment> <fragment id="mcms" type="portlet" name="mcms::mcmsP"> <property layout="TwoColumns" name="row" value="1" /> <property layout="TwoColumns" name="column" value="0" /> </fragment> <fragment id="dp-3" type="portlet" name="j2-admin::LocaleSelector"> <property layout="TwoColumns" name="row" value="2" /> <property layout="TwoColumns" name="column" value="0" /> </fragment> </fragment> <security-constraints> <security-constraints-ref>public-view</security-constraints-ref> </security-constraints> </page>
        Hide
        Eivinn Hustveit added a comment -

        The only text in view page source is also "NULL".

        Show
        Eivinn Hustveit added a comment - The only text in view page source is also "NULL".
        Hide
        Eivinn Hustveit added a comment -

        This is the error element from the file jetspeed.log.

        Show
        Eivinn Hustveit added a comment - This is the error element from the file jetspeed.log.

          People

          • Assignee:
            David Sean Taylor
            Reporter:
            Eivinn Hustveit
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development