aspose file tools*
The moose likes JBoss/WildFly and the fly likes Error while updating login-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Error while updating login-config.xml" Watch "Error while updating login-config.xml" New topic
Author

Error while updating login-config.xml

pravin karne
Ranch Hand

Joined: Jul 26, 2007
Posts: 31
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.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

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.


[My Blog] [JavaRanch Journal]
pravin karne
Ranch Hand

Joined: Jul 26, 2007
Posts: 31
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
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

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

Joined: Jul 26, 2007
Posts: 31
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

Joined: Jul 26, 2007
Posts: 31
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while updating login-config.xml