Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

login-config.xml: ParseException when adding a policy

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I spent the whole day trying to solve this problem, without success. Now I ask the experts... I am using JBoss 4.0.0 with Tomcat.

When I add a new application policy to login-config.xml, I get the following exception at server startup:

Here is the part that I added in login-config.xml:

Unlike the error message suggests, it is not a parsing exception. The XML file is valid.
Am I missing something obvious?
Could it be something missing in other files (auth.conf?)?

It seems that I am almost the only one getting this problem, so it must be blindingly stupid.
Please help!
 
Bruno Collet
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the problem: there was an "�" (French character) in a comment that I added. So now when removing the comment the parsing succeeds.
This is really a tricky error. I am not sure whether it is a JBoss bug or not.
From now on I promise to use only English in comments
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes even i faced similar problem.

I was using JAAS & had CustomLoginModule and authenticating the user against the database.

I had the following entry in login-config.xml which was not getting parsed

<application-policy name="Example">
<authentication>
<login-module code="com.manish.jaas.RdbmsLoginModule" flag="required">
<module-option name="url">
jdbc:mysql://localhost:3306/db1?user=root&password=pass
</module-option>
<module-option name="driver">
com.mysql.jdbc.Driver
</module-option>
</login-module>
</authentication>
</application-policy>

after wasting the whole day in investigating about the problem, I tried my hands to alter the value of url. I removed the query string and added another module-option tag for user name & password.

It successfully parsed the login-config.xml. The ampersand ('&') was creating the problem.

I altered it in this way

<application-policy name="Example">
<authentication>
<login-module code="com.manish.jaas.RdbmsLoginModule" flag="required">
<module-option name="url">
jdbc:mysql://localhost:3306/db1
</module-option>
<module-option name="driver">
com.mysql.jdbc.Driver
</module-option>
<module-option name ="username">root</module-option>
<module-option name ="password">pass</module-option>
</login-module>
</authentication>
</application-policy>
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic