Help coderanch get a
new server
by contributing to the fundraiser
  • 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error while updating login-config.xml

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to edit login-config.xml file of JBOSS(${JBOSS_HOME}/server/default/conf ) through other java program(using DOM parser)

but i m not able to access that file boz of xml specification i.e

<!DOCTYPE policy PUBLIC
"-//JBoss//DTD JBOSS Security Config 3.0//EN"
"http://www.jboss.org/j2ee/dtd/security_config.dtd">


can DOM or sax have some feature so i can edit that file

please reply.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you are trying to do. What exception are you seeing when you try to edit it through Java program? Also, why do you want it to edit it through Java program? I guess, you are trying to add a login module dynamically. If so, then you have API's for doing that, which you can use. If you explain what you are trying to achieve, maybe we can point you to a better solution.
 
pravin karne
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Actually i m going to cofigure coonnection pool.
i m doing this using InstallJammer Installer (i want to cofigure connection pool before installation of application)

for that i want change the following conf files of JBOSS

1.standardjboss.xml
2.login-config.xml
3.standardjbosscmp-jdbc.xml

for changing this file i m calling java program from InstallJammer
but i m not able to edit that files

I think this is because of dtd type of that xml file.
Thanks in advance
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by pravin karne:
Actually i m going to cofigure coonnection pool.
i m doing this using InstallJammer Installer (i want to cofigure connection pool before installation of application)

for that i want change the following conf files of JBOSS

1.standardjboss.xml
2.login-config.xml
3.standardjbosscmp-jdbc.xml



The connection pool settings are done in a *-ds.xml file. The login-config.xml file is used for security related stuff.


Originally posted by pravin karne:
for changing this file i m calling java program from InstallJammer
but i m not able to edit that files

I think this is because of dtd type of that xml file.



What is the exception/error you are seeing? Also, can you post the piece of code which is reading/editing these files?
 
pravin karne
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
code sample for it is


DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File("C:\\standardjbosscmp-jdbc.xml"));// this statement is not executing because of some <DOCTYPE .. Tag in same file
NodeList nl1 = doc.getElementsByTagName("datasource");



this code is working if i remove that <DOCTYPE tag...

i didnt get what is connection between <DOCTYPE tag and parsing that file


please reply...i have already west lot of time on it


Thanks in advance
 
pravin karne
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
code sample for it is


DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new File("C:\\standardjbosscmp-jdbc.xml"));// this statement is not executing because of some <DOCTYPE .. Tag in same file
NodeList nl1 = doc.getElementsByTagName("datasource");



this code is working if i remove that <DOCTYPE tag...

i didnt get what is connection between <DOCTYPE tag and parsing that file


please reply...i have already west lot of time on it


Thanks in advance
 
Your mother was a hamster and your father was a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic