Java and XML Configuration Files

Hi,
Can anyone tell me the best way to read information stored in an XML configuration file into my Java program? I have a factory class which I want to instantiate classes from at runtime and I want to be able to read in the class names from a XML configuration file to make it extensible..
Many thanks....

Depends on what the OP means by XML configuration files.
Spring reads Spring application context files. Those can help to configure objects, no doubt.
If the OP meant reading in XML serializations of Java objects and turning them back into Java objects, then XStream is the right thing to do.
%

Similar Messages

  • Loading XML Configuration File into Java

    I have a stored procedure wrapper to a Java method (within a jar file) that has been loaded into the database. I need to load an XML configuration file in this method and parse it but get the following error.
    <Line 2, Column 192>: XML-24538: (Error) Can not find definition for element 'LODConfigs'
    When I run the method standalone through netbeans it parses fine and is able to load the file. I've confirmed that it is able to read the file but I am lost as to what could be the problem. Any suggestions would be welcome.
    The header of the file is
    <?xml version="1.0" encoding="UTF-8" ?>
    <LODConfigs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.oracle.com/spatial/network/lodLODConfigs.xsd"
    xmlns="http://xmlns.oracle.com/spatial/network">
    <LODConfig globalNetworkName="$DEFAULT$" networkName="$DEFAULT$">
    <networkIO>
    </networkIO>
    </LODConfig>
    </LODConfigs>

    Just a guess really, (and this is an old question now - so you may have moved on).. is your XML parser attempting to use the schema location to pull the XML schema from the internet?
    If so, that might run fine in netbeans, but hit java permission limits in Oracle. Have you tried running it in netbeans with the network cable unplugged.
    If that fails with the same error as the Oracle JVM, that might give a clue as to the problem and you can troubleshoot the permissions from there.

  • Single XML configuration file for all the SSIS packages(including parent and child packages)

    Hi
    I have some 16 ssis packages. source Db and destination Db for these packages are common. I am calling these child packages in a master package.
    I want to use only one XML config file for this master.
    How do i use same for all child packages?
    and can i do it with parent package variable?

    I created a master package with a variable master, and in value i have entered the configuration file path.
    Hi vjp dinu,
    You should create variables in the parent package to pass values to variables in each child package rather than pass the file path of the XML Configurations file of the parent package.
    As Visakh mentioned, you can achieve your goal by creating corresponding variables in the parent package for each child package, and enable Package Configurations for the parent package so that you can control the values through the XML Configurations file
    for the variables of the parent package.
    Supposing there is a variable FilePath in child package 1, a variable ServerName in child package 2, then, we need to create two variables pFilePath, pServerName in the parent package. After configuring the Parent package variable in each child package (e.g.
    mapping pFilePath to FilePath, pServerName to ServerName), you can enable XML Configurations for the parent package, and expose the value property for both pFilePath and pServerName variables. In this way, you can modify the XML Configurations file of the
    parent package and the specified values will passed to the child packages.
    Reference:
    http://microsoft-ssis.blogspot.com/2011/06/passing-variables-from-parent-package.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • How to generate an XML Configuration File for EBS Source Type

    Hi,
    We have installed SES, I want to integrate it to enable for searching repository contracts.
    In the sources I have selected oracle.apps.okc.repository.textsearch.server.RepHeaderSearchExpVO.
    For this source I need to specify the Configuration URL.
    Here I need to provide the path for configuration XML file. But before that I need to generate the XML Configuration file.
    Is there any steps on how we can create this XML file.
    like I would want to know how we can create the XML file and on which folder on the server should I be putting it
    Thanks

    Hi there,
    We are running into same issue and need the exact same information. Can someone help with this question on priority?
    Thanks,
    Darshan

  • Log4j: XML configuration file problem

    Hello,
    I set up some logging in my existing application with log4j and an xml configuration file. Now I made some changes to my package structure, and some problems occured. So I thougt of setting the logging level of one of my loggers (named myapp.iointerface.DBAccess in the config file). So the only change I did was adding a <param name="Level" value="TRACE"/> to my logger. Now, log4j complains when it reads the configruation file:
    log4j:WARN Continuable parsing error 36 and column 11
    log4j:WARN The content of element type "logger" must match "(level?,appender-ref*)".My config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
         <appender name="RootConsole" class="org.apache.log4j.ConsoleAppender">
              <param name="Threshold" value="DEBUG"/>
              <param name="Target" value="System.err"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %nIn Zeile Nummer: %L %m %n%n"/>
              </layout>
         </appender>
         <appender name="LoginInfo" class="org.apache.log4j.FileAppender">
              <param name="Threshold" value="TRACE"/>
              <param name="File" value="${user.dir}/login_info.log"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %nIn Zeile Nummer: %L %m %n%n"/>
              </layout>
         </appender>
         <appender name="DBConnectionInfo" class="org.apache.log4j.FileAppender">
              <param name="Threshold" value="TRACE"/>
              <param name="File" value="${user.dir}/db_connection.log"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %n%m %n%n"/>
              </layout>
         </appender>
         <logger name="myapp.windows.MainFrameController" additivity="false">
              <appender-ref ref="LoginInfo"/>
         </logger>
         <logger name="myapp.iointerface.DBAccess" additivity="false">
              <param name="Level" value="TRACE"/>
              <appender-ref ref="DBConnectionInfo"/>
         </logger>
         <root>
              <param name="Level" value="DEBUG"/>
              <appender-ref ref="RootConsole"/>
         </root>
    </log4j:configuration>Does anybody know what's wrong with that? I don't understand and found nothing googling it netiher. The strange thing is, that logging messages with level TRACE are recorded in the destination file, but the level id DEBUG.
    Thx,
    Julien

    If you look at the error, the parser expects level and not Level
    So :
    <param name="Level" value="TRACE"/>should be :
    <param name="level" value="TRACE"/>Same goes for :
    <param name="Level" value="DEBUG"/>That will solve the problem (even though it is not a critical error)!

  • Setting time in  adf-faces-config.xml configuration file

    Hello check this link
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_convertDateTime.html
    this specifies "Timezone can be set per web-app in adf-faces-config.xml configuration file. If timeZone is not set on the converter, then timezone will be defaulted to the value set in adf-faces-config.xml configuration file. If it is not set in the configuration file, then it will be defaulted to GMT."
    how to set timezone in adf-faces-config.xml configuration file please specify
    Regards
    Mayur Mitkari

    where in adf-faces-config.xml i can add this line , and howThis might help: http://docs.oracle.com/cd/E24382_01/web.1112/e16181/af_global.htm#BJECDDDE

  • XML configuration file does not show entry for PI_BASIS for PREPARE

    Hello SAP Gurus,
    We are doing ECC 6.0 SR3 upgrade including EHP3 SP3
    We generated XML configuration file for EHP3 from MOPZ
    But during XML file does not contains any information for PI_BASIS target level or source level
    current level is 2006_1_620
    We tried that XML file in PREPARE during EHP_INCURSION phase
    but failed all time.
    Let me know what we have to generate XML file with proper information including PI_BASIS
    Even PI_BASIS not appearing in MOPZ list for selection, its surprising for us.
    Any idea/direction would be highly appreciated.
    Thanks,
    Amit Lal

    Hi,
    I forwarded my query to AGS Dev support, They verified Solution manager and found no problem since it was up to date SPS15 ST400
    Problem was in SAPup, they provide the lastest sapup tool that was again released for this specific problem. See notes for SAPup with keyword EHP
    thanks,
    Amit

  • XML configuration file to link to frames in Flash - As2.0

    How can I set the url or link attribute from the XML configuration file to link to frames in my movie instead opening a HTML page? I am using Actionscript 2.0
    Thank you.

    What type of file is using this xml data?  If it is being read by the AS2 file, then your data should resemble either frame labels or frame numbers.

  • Can somebody explain to me how java and xml are related?

    Hi guys
    im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it...
    the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml
    I have absolutely NO IDEA why i must convert my java to xml and have no idea how to do that.I been reading on the net that xml is a exten~ markup language and it is better and useful.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?
    2)why do ppl want to convert java to xml when they can just stick to java
    3)what is actually xml...
    4)Do i need a program to create xml like i need jcreater to create java application
    5)How do we actually convert?is there any links that you guys could tell me?
    thank you
    tomleo

    im new to java and xml.Been reading a lot regarding
    java and don't seem to have a problem with it...Okay.
    the problem is the xml part...im doing a simple GUI
    project using swing(online store) and i have to
    o convert it to xmlYou have to? So presumably somebody in a position of authority told you that?
    I have absolutely NO IDEA why i must convert my java
    to xml and have no idea how to do that.I been reading
    on the net that xml is a exten~ markup language and
    it is better and useful.I have no idea either (besides which, it doesn't make sense). But why ask us? Somebody told you to do that, ask them why.
    Sure, XML is useful. But it isn't a programming language so it can't be used as a substitute for Java.
    Can somebody explain to me in layman terms
    1)how is java and xml related in?They aren't related, except perhaps in that they are both used in computers.
    2)why do ppl want to convert java to xml when they
    can just stick to javaThey don't.
    3)what is actually xml...Start here for numerous definitions:
    http://www.google.ca/search?hl=en&lr=&oi=defmore&q=define:XML
    4)Do i need a program to create xml like i need
    jcreater to create java applicationNo, XML is just text. But then Java code is just text too.
    5)How do we actually convert?is there any links that
    you guys could tell me?You don't convert Java to XML. My guess is that because you don't know much about Java or XML, you have misinterpreted something that somebody told you.

  • Server.xml configuration files

    Hi all,
    The server.xml configuration files have a common defintion for different servers? or each server has its own definition.
    Thanks.

    each has its own.

  • Java and XML or XHTML Journey Planner Project

    Hello chaps,
    I need some help with a project I am doing.
    This project will be focusing on the area of information visualisation and the phenomena surrounding how data can be optimised in a confined space. Expanding on this, confined space can be a mobile phone screen, and personal organisers where information is shown in a limited area.
    I plan to use Java and XML. (or XHTML)
    I want to have a running application where raw data is transformed into a combination of graphics and information. To achieve this, I will be looking at route planning for mobile phones and how route instructions can be represented in a visual but a sophisticated way.
    My focus will be on the London transport.
    Here is a link to the London transport journey planner
    http://www.tfl.gov.uk/journeyplanner
    Using WAP, I surfed the website on my phone and there seems to be a lot of writing and there is a lot to process before understanding what is going on. I want to transform words into pictures e.g., the word underground or bus into a logo of a red bus or underground logo or Instead of ?walk?, a picture of a walking pedestrian. Picture are good connotations as we can easily recognise rather than processing words. I would also like to represent the time taken in a graph format, again, to easily visualise.
    The application can be on a phone or on Windows simulating a mobile phone.
    Can anyone help me with this mammoth task or at least point me out in the correct direction?
    Looking forward to your reply.

    1st, ) Raw Data e.g, journey time, journey distance
    2nd, ) I would want the system to recognise the 'raw data' mentioned before and transform this into graphical image(s).
    3rd ) a complete visualisation would look like,
    modes of transport represented by pics or logos, showing the time to get to from A to B.
    Showing various routes, eg, walking, and/or bus and/or tube

  • Java and xml option necessary?

    Hi,
    first when i build the repository database, i choose java and xml option, is this necessary or i waste my time.
    When i read Building a Help Desk Connector, i'm not sure, do i need the Diagnostic Pack.
    Best regards
    Thomas
    (Narri, Narro)

    This is the defacto site for xpath stuff for java
    http://xml.apache.org/xalan-j/

  • Java and XML Doc

    I am new to Java and XML, I want to know the steps i should follow to work with XML document using XPATH. also the APIs and Technologies i shoud work. If possible guide me any examples or tutorials for that.

    This is the defacto site for xpath stuff for java
    http://xml.apache.org/xalan-j/

  • XML Configuration Files Batch Processing

    Greetings All,
    I have configuration file in XML as follow:
    <property>
    <name> world.wide.web.complexity.level </name>
    <value> 10 </value>
    <description> describes how complex the web is getting, see exitement for related values</description>
    </property>
    So, I would like to write a java program, that will generate several copies of the above file but with different values for one or several properties.
    I have discovered JDOM, SAX, apache configuration and so many technologies but didn't find a simple solution to this simple problem at a first pass.
    Many thanks in advance for your help

    Here is a way to set global container properties.
    You can get your container to read a properties file by modifying opmn.xml as follows:
    <process-type id="ct01" module-id="OC4J">
    <module-data>
    <category id="start-parameters">
    <data id="oc4j-options" value="-p /filepath/properties.file"/>
    These can then be read in with a System.getProperty() command.

  • Question about  Java and XML  rendering for Word 97 upwards.

    Without using the apache POI library, and by sticking to non-pay products,
    is it possible to use java or XSLT/XML to turn
    an xml formatted file into a
    Microsoft Word/Excell/PDF file within one framework?

    Look into Apache FOP. But be warned: it will most likely use POI to do any excel conversions. That's how (sane) software development works: you don't reinvent the wheel, you effectively reuse what is already there.

Maybe you are looking for

  • Replication of BP from CRM to R/3

    Hi all,       I got a problem in moving the business partner form CRM 4.0 to R/3 backend. In doing so, a mBDoc gets generated with the status 'sent to receivers ( not all have confirmed )' and when i see the error detail, it says 'Make an entry in al

  • How to deploy EUS  using OVD with existing active directory ?

    Hi, I am new in Oracle FMW and want to explore more into it, I have existing MS active directory with users and group policies defined there  and I need to implement the solution for  all users  to authenticate in oracle Database (11gR2) via AD. and

  • Grayed out songs on iTunes despite "Manage music and videos manually" being checked.

    I had to restore my iPod, and when I synced it after the restore, the songs were gone on my iPod like it is supposed to be, but on iTunes they are still there but grayed out. I have already done the "manage music and videos manually" thing, I delete

  • Can't delete duplicated desktop folders

    I somehow duplicated the few folders I have on my desktop, including the Macintosh HD and TimeMachine backup. The duplicated folders are empty but I cannot drag them and drop them into the trash. When I right click on those folders, they show much fe

  • What are Channel counts and how do I get rid of them

    Hi. I'm using a program called Processing in Linux and it has trouble reading some of my QuickTime files that I created on my mac. I've been trying to figure out what coses it, the only thing I could find is that when I open up "Get Info" there is so