Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8042723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:40:51+00:00 2026-06-05T04:40:51+00:00

I am trying to use a custom principal class in a JBoss 6.1 Final.

  • 0

I am trying to use a custom principal class in a JBoss 6.1 Final. From the JBoss documentation it looks like that I must add the line

    <principalClass="es.caib.gesma.browseldap.LdapPrincipal"/>

into the login-config.xml file, but it is not clear exactly where. I have tried at a few location in my application policy definition but it always causes an exception to be thrown.

The places where I have tried (one at a time) are:

<application-policy name="GesManPolicy">
                                          <----- Here
  <authentication>
                                          <----- Here
    <login-module code="es.caib.gesma.browseldap.BrowseLdapLoginModule" flag="required">
                                          <----- And here
    <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option> 
    ...

The exception that I get each time is

10:17:05,359 WARN  [XMLLoginConfigImpl] End loadConfig, failed to load config: vfs:/C:/desarrollo/jboss-6.1.0.Final/server/default/conf/login-config.xml:
org.jboss.security.auth.login.ParseException: Encountered " <ANY> "<?xml "" at line 1, column 1. Was expecting one of:
<EOF>
<IDENTIFIER> ...
at org.jboss.security.auth.login.SunConfigParser.generateParseException(SunConfigParser.java:415) [:3.0.0.CR2]
at org.jboss.security.auth.login.SunConfigParser.jj_consume_token(SunConfigParser.java:352) [:3.0.0.CR2]
at org.jboss.security.auth.login.SunConfigParser.config(SunConfigParser.java:99) 
....

Any idea of where/how I should setup the custom principal?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:40:52+00:00Added an answer on June 5, 2026 at 4:40 am

    In the end, JBoss documentation is wrong. Using the module-option of a module (does that mean that the principal is not passed to the module by the container, but created by the module?) it works.

    <module-option name="principalClass">es.caib.gesma.browseldap.LdapPrincipal</module-option>
    

    In case you are checking this, the next trouble you will be getting to get the JBoss container with this object (instead of a SimplePrincipal copy). To do that, your module must add your principal object to the RolesSets, like this:

    protected Group[] getRoleSets() throws LoginException {
      SimpleGroup callerPrincipal = new SimpleGroup("CallerPrincipal");
      callerPrincipal.addMember(this.getIdentity()); <--- YOUR PRINCIPAL OBJECT
      Group[] roleSets = { userRoles , callerPrincipal };
      return roleSets;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to simply use a custom view helper that is located in
Trying to use Powershell to script the removal of specific custom errors from an
I'm trying to use a custom event in my WxWidgets C++ application, like described
I'm trying to use custom notifications in my Android application using Google's sample from
I'm trying to use a custom textfield background. The problem is that the text
I'm trying to use a custom ClaimsAuthorizationManager based on the excellent work from Dominic
I would like to use custom @Html.ActionLink I am trying to use the following
I'm trying to use a custom class (be.myname.rssreader.util.Global) extending android.app.Application, but when I try
I am trying to use custom sorting in Doctrine 2 (using MySQL). Code looks
I'm trying to use a custom SocketImpl with SSL in Java. Because of that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.