3
votes

We are working with WSO2 IS, v5.1.0. When testing, we got the following results:

  1. When running one suite of tests, all works ok.
  2. When running concurrent tests, meaning - concurrent requests are being sent, we got NPE. Moreover, We got "200" on adding two users, for example, but then when trying to query and get both of them, we got a message that 2 values were expected but only 1 is returned.

Any idea how can I solve this issue? what is causing it? Let me know if any further info is required.

Thanks!

1
Do you have any stacktrace for this NPE?Chamila Wijayarathna
No stacktrace is written, but I'll attach a few lines prior to the NPE: Entering deleteAttachments() {org.apache.axis2.transport.TransportUtils} Exiting deleteAttachments() {org.apache.axis2.transport.TransportUtils} Reading Role Mapping of Application 2816 {org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl} Setting config system registry instance. {org.wso2.carbon.context.PrivilegedCarbonContext} Setting governance system registry instance. {org.wso2.carbon.context.PrivilegedCarbonContext} {org.apache.axis2.transport.http.AxisServlet} java.lang.NullPointerExceptionNitz
To give you any reasonable hint, more information is needed. Is it a single node / clustered environment? What datastore is used? Did you upate any claim definitions? Do you run the IS as a (wrapper) service? And the most important - the stacktrace.gusto2
@GabrielVince It's a single node environment. We're using MySQL as our datastore. We didn't configured the default claim (we use the default..should we configure?). We run the IS as a service. Regarding the stacktrace, we don't get any when the NPE happens, I attached in the above comment the prior messages from the log (the log was in TRACE mode). Thanks !!Nitz
I want to mention one more important thing - We get this error in one specific case - when trying to attach permissions to a role. We're trying, for example, to attach 2 permissions to a single role. Sometimes both are added, sometimes one is added and the other isn't, and sometimes both are not added. In all cases, we got "200" messages. Moreover, adding permissions is also causing some problems - sometimes when adding a new permission to the system it DELETES all existing ones.Nitz

1 Answers

1
votes

Now I see..

there are two issues in the WSO2 IS 5.1.0 you can / have to fix.

Use of the embedded JSP pages

First - see there's a difference in the parameters of the wso2server.bat/.sh and the bin/yajsw/wrapper.conf. In the wrapper.conf add:

wrapper.java.additional.27 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

please change the parameter order to fit your parameter list

StringUtil bundle dependency

Here comes the NPE stacktrace in play and without it, you cannot pinpoint the exact problem. Apparently the some UI bundles are having invalid dependencies specified, particularly there's no dependency specified to the Commons-Lang StringUtil package which is used.

We have solved it by following actions:

  • download and copy commons-lang-2.6.jar into the repository/components/dropins
  • create a new OSGi bundle (assuming you know Java and how to create OSGi bundle fragments) which imports org.apache.commons.lang;version="[2.6,3)" and is a fragment to the org.wso2.carbon.identity.mgt.ui bundle. Copy this bundle to the dropins folder.
  • create a new OSGi bundle which imports org.apache.commons.lang;version="[2.6,3)" and is a fragment to the org.wso2.carbon.identity.application.mgt.ui bundle. Copy this bundle to the dropins folder.

Edit:

part of the maven plugin to generate the bundles

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.7</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Fragment-Host>org.wso2.carbon.identity.application.mgt.ui</Fragment-Host>
                    <Import-Package>org.apache.commons.lang.*</Import-Package>
                    <!--
                    <Export-Package>org.apache.commons.lang.*</Export-Package>
                    <Embed-Dependency>commons-lang</Embed-Dependency>
                    -->
                </instructions>
            </configuration>
        </plugin>

There are multiple bundles having this issue, but to get the IS 5.1.0 usable, at least these bundles were necessary to fix.

In all cases, this answer is still based on assumptions and our experience rather than evidence (the stacktrace).

g