0
votes

I get this error after deploying a new war through the server configuration tool. I tried to revert back to the original war error persist.

Tomcat 7.0.30 Worklight Server 6.1.0.2

   javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception:     java.lang.RuntimeException: conf/authenticationConfig.xml contains duplicated realm named: wl_anonymousUserRealm
    com.worklight.core.auth.impl.AuthenticationFilter.verifyServletInitialized(AuthenticationFilter.java:317)
    com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)

The xml is built by default my realm is defined in the context.xml for server.

    <!-- Licensed Materials - Property of IBM
         5725-G92 (C) Copyright IBM Corp. 2006, 2013. All Rights Reserved.
         US Government Users Restricted Rights - Use, duplication or
         disclosure restricted by GSA ADP Schedule Contract with IBM Corp. -->  

<!-- Uncomment the next element to protect the worklight console and the first section in securityTests below. -->
 <staticResources>
<!-- <resource id="worklightConsole" securityTest="WorklightConsole">
        <urlPatterns>/console*</urlPatterns>
     </resource> 
    -->
    <resource id="subscribeServlet" securityTest="SubscribeServlet">
        <urlPatterns>/subscribeSMS*</urlPatterns>
    </resource>
</staticResources> 
test below , element must be added to application-descriptor.xml as well. -->
 <securityTests>
    <!-- 
    <customSecurityTest name="WorklightConsole">
        <test realm="WorklightConsole" isInternalUserID="true"/>
    </customSecurityTest>

    <mobileSecurityTest name="mobileTests">
        <testAppAuthenticity/> 
        <testDeviceId provisioningType="none" />
        <testUser realm="myMobileLoginForm" />
    </mobileSecurityTest>

    <webSecurityTest name="webTests">
        <testUser realm="myWebLoginForm"/>
    </webSecurityTest>

    <customSecurityTest name="customTests">
        <test realm="wl_antiXSRFRealm" step="1"/>
        <test realm="wl_authenticityRealm" step="1"/>
        <test realm="wl_remoteDisableRealm" step="1"/>
        <test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/>
        <test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/>
    </customSecurityTest>
    -->
    <customSecurityTest name="SubscribeServlet">
        <test isInternalUserID="true" realm="SubscribeServlet"/>
    </customSecurityTest>


    <customSecurityTest name="AgentSecurityTest">
        <test isInternalUserID="true" realm="FbitnAgentRealm"/>
    </customSecurityTest>

</securityTests> 

<realms>
    <!--realm name="ConsumerRealm" loginModule="AnonymousLoginModule" >
        <className>com.worklight.integration.auth.AdapterAuthenticator</className>
        <parameter name="login-function" value="ConsumerPolicy.onAuthRequired"/>
        <parameter name="logout-function" value="ConsumerPolicy.onLogout"/>
    </realm-->
    <realm loginModule="StrongDummy" name="SampleAppRealm">
        <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
    </realm>

    <realm loginModule="requireLogin" name="WorklightConsole">
        <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
        <onLoginUrl>/console</onLoginUrl>
    </realm>

    <realm loginModule="rejectAll" name="SubscribeServlet">
        <className>com.worklight.core.auth.ext.HeaderAuthenticator</className>          
    </realm>
    <!-- For websphere -->
    <!-- realm name="WASLTPARealm" loginModule="WASLTPAModule">
        <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
        <parameter name="login-page" value="/login.html"/>
        <parameter name="error-page" value="/loginError.html"/>
    </realm -->
    <realm name="FbitnAgentRealm" loginModule="FbitnAgentLogin">
        <className>com.fbitn.WorklightCustomAuthenticator</className>
    </realm>
</realms>

<loginModules>
    <loginModule name="FbitnAgentLogin">
        <className>com.fbitn.WorklightCustomLogin</className>
    </loginModule>
    <!--loginModule name="AnonymousLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule-->

    <!--loginModule name="HeaderLoginModule" canBeResourceLogin="true" isIdentityAssociationKey="true" audit="true"-->

    <loginModule name="StrongDummy">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule>

    <loginModule name="requireLogin">
        <className>com.worklight.core.auth.ext.SingleIdentityLoginModule</className>
    </loginModule>

    <loginModule name="rejectAll">
        <className>com.worklight.core.auth.ext.RejectingLoginModule</className>
    </loginModule>

    <!-- For websphere -->
    <!-- loginModule name="WASLTPAModule">
        <className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
    </loginModule -->

    <!-- For enabling SSO with no-provisioning device authentication -->
    <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceNoProvisioningLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule> -->
    <!-- For enabling SSO with auto-provisioning device authentication -->
    <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceAutoProvisioningLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule> -->
</loginModules>

1
@IdanAdar Yes but noboby had answer for this guy. - Justin Cox
Yes, I didn't mean that there is an answer yet. - Idan Adar
I recently updated the server with fix packs 2, and then I updated my studio with the fix packs. Built a new war and this happen, tried to revert back to the old war and it still happens. - Justin Cox
I'm not yet convinced it's related to the fix pack, but to what is on the server when deploying. Try clear the existing war before deploying the newer war? - Idan Adar

1 Answers

1
votes

There was two versions on the server. Tomcat/Worklight/app and Tomcat/webapps/app. I'm not sure the the server config tool was used to deploy the first one, but was on the second deploy. I removed the app contents from the Worklight folder and left the original folder under webapps, the server.xml is configured to read both directories, only one is needed.

I found out this was because of the worklight-jee-library.jar was install under the tomcat/lib and in the tomcat/Worklight/app. I believe the one in the lib was placed there by the installation manager when Worklight 6.1 was installed.