Unable to find XML document from class path resource

Hi,
I am trying to learn spring and wrote my first class today. I added all the jar files to the lib folder and created all the classes. When I try to run the client program I get
[INFO] XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [MorningGreeting.xml]
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [MorningGreeting.xml]; nested exception is java.io.FileNotFoundException: class path resource [MorningGreeting.xml] cannot be opened because it does not exist
     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:180)
     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
     at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
     at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
     at com.training.spring.greetCustomers.EnterTraining.main(EnterTraining.java:22)
Exception in thread "main"
I have my client, interface, XML file all in the same package com.training.spring.greetCustomers. I could not understand what I am doing wrong?? Can you please help me.

congratulations on deciding to learn spring. that's a smart thing to do.
stop assuming that you did it correctly. the xml file is not in the classpath. when you get it there correctly, spring will find it.
you have the source files and xml in that directory, but where do the .class files end up when you run them? does the xml config end up there, too?
remember, the xml config should be in the directory where the root of the package hierarchy begins, not down where the .class files are.
%

Similar Messages

  • Error loading XML Document from /analytics/saw.dll/common/privileges.xml

    I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
    The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
    How can I fix this?

    Hi All,
    You can face this issue with other versions of OBIEE 11.*
    Problem cab be solved as follows:
    Go to http://localhost:7001/em  > coreapplication > Capacity Management > Scalibility >
    1. Lock and edit
    2 .increase number of presentation services to 2
    3. restart opmn component.
    Go to coreapplication > Availibility > processes
    1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
    2. Take down your primary instance.
    3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
    If you want to run primary instance of presentation services
    Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
    except catalog and catalog manager > Copy all other files to coreapplication_obips1
    restart opmn component > problem solved.!!!
    Regards,
    Akshay S.
    please like if you find it helpful

  • Whenever I try to open a certain document on Microsoft word it keeps saying it is unable to find the document. How do I find it?

    I typed a 10 page paper. And when I went to submit it to my class online the document was grey and it had no information and it wouldn't let me open it; like it was corrupted. When I do click on it, it says that Microsoft Word is unable to find my document.
    When I click would you like to locate it yourself, it brings me to all my documents but it is no where to be found on my computer. How do I retrieve it? 

    Hi Jessica,
    From where did you open the file for editing originally? Have you saved it properly before you submit it?
    As Paul mentioned above, in some cases, corrupted documents are rarely recoverable. Do you have a backup of that file? Or elaborate a little bit about your situation for further assistance.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • Exception Description: Unable to process XML tag [driver-class] with value

    Hi
    I'm newbie with TopLink. I try to write a litle application with TopLink:
    - First, I create a session.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink-sessions version="11g Technology Preview 3 (11.1.1.0.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="database-session">
    <name>dbsession</name>
    <event-listener-classes/>
    <logging xsi:type="toplink-log"/>
    <primary-project xsi:type="xml">META-INF/tlMap.xml</primary-project>
    <login xsi:type="database-login">
    <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
    <user-name>dev</user-name>
    <password>F6A3DA7BA187330D4E11A713C42FF833</password>
    <sequencing>
    <default-sequence xsi:type="table-sequence">
    <name>Default</name>
    </default-sequence>
    </sequencing>
    <driver-class>oracle.jdbc.OracleDriver</driver-class>
    <connection-url>jdbc:oracle:thin:@//10.10.10.31:1521/devdb1</connection-url>
    <bind-all-parameters>false</bind-all-parameters>
    <struct-converters/>
    </login>
    </session>
    </toplink-sessions>
    - Second, I create a Java Application ( Application1.java):
    package project2;
    import java.sql.ResultSet;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Vector;
    import oracle.toplink.queryframework.DataModifyQuery;
    import oracle.toplink.queryframework.SQLCall;
    import oracle.toplink.queryframework.StoredProcedureCall;
    import oracle.toplink.sessions.DatabaseSession;
    import oracle.toplink.sessions.Session;
    import oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader;
    import oracle.toplink.tools.sessionmanagement.SessionManager;
    import oracle.toplink.util.SessionFactory;
    public class Application1 {
    public Application1() {
    public static void main(String[] args) {
    // new Application1();
    String statement = "SELECT motdepasse,login FROM bou_courtier";
    SessionManager sessionmanager = SessionManager.getManager();
    System.out.println("test");
    // SessionFactory sessionfactory = new SessionFactory("META-INF/sessions.xml","dbsession");
    DatabaseSession session = (DatabaseSession)sessionmanager.getSession(new XMLSessionConfigLoader(),"dbsession",Thread.currentThread().getContextClassLoader());
    // Session session = sessionfactory.acquireSession();
    System.out.println("test");
    SQLCall sqlcall = new SQLCall(statement);
    session.executeNonSelectingCall(sqlcall);
    ResultSet rs = sqlcall.getResult();
    try {
    while(rs.next()){
    String strPass = rs.getString(1);
    String strLogin = rs.getString(2);
    System.out.println("Password :"+strPass+"---"+"Login :"+strLogin);
    } catch (SQLException e) {
    // TODO
    - Third, I build and run Application1.java in Jdevelopper 11g preview 3. Sadly, the result is a error:
    Exception in thread "main" Local Exception Stack:
    Exception [TOPLINK-9003] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071207)): oracle.toplink.exceptions.SessionLoaderException
    Exception Description: Unable to process XML tag [driver-class] with value [oracle.jdbc.OracleDriver].
    Internal Exception: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at oracle.toplink.exceptions.SessionLoaderException.failedToLoadTag(SessionLoaderException.java:83)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildDatabaseLoginConfig(TopLinkSessionsFactory.java:408)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildLogin(TopLinkSessionsFactory.java:336)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildDatabaseSessionConfig(TopLinkSessionsFactory.java:182)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildSession(TopLinkSessionsFactory.java:168)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildTopLinkSessions(TopLinkSessionsFactory.java:117)
         at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:239)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:448)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:311)
         at project2.Application1.main(Application1.java:33)
    Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildDatabaseLoginConfig(TopLinkSessionsFactory.java:405)
         ... 8 more
    Process exited with exit code 1.
    Can you help me to debug this error. Many thanks
    user615555

    The internal error: "java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver"
    is stating it can't find your driver jar file on the classpath. You'll need to check that you've included your Database driver in the list of libraries on your classpath.
    Best Regards,
    Chris

  • Creating an XML document from a DTD in Java

    Hi All,
    I need help on the following requirement very badly. Pls help me.
    I have a requirement to implement with java and XML. I am quit new to XML.Can any of you pls help me.
    I have a DTD file. I need to generate XML document from it using java code. I have to use DTD as a template to generate my XML document.
    After going through WEB sites, I understtod that, we have to user Java API JAXB for my requirement. But I could not find JAXB.jar anywhere.
    I need to know the following inforamtion ....
    1. Is my understanding of using JAXB for my requirement is correct?
    2. Where can I get JAXB.jar?
    3. What are the steps to create XML document from a DTD in Java?
    If can give me a sample code for this would help me a lot.
    Pls pls reply me. Your help is greatly appreciated.
    Thanks in Advance.
    Regards,
    Gayathri.

    hi Gayathri,
    iam currently working in the same field.
    firs download jaxb from this link:
    http://java.sun.com/xml/downloads/jaxb.html
    first u need to marshall it.
    cheers
    shashi

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • Using "XML Document from XML Schema" in JDeveloper

    Hi Experts,
    I have a requirement to generate XML Document from XML Schema.
    For this I have used "XML Document from XML Schema" feature in JDeveloper. It is found in File->New->General->XML Document form XML Schema.
    I have registered a schema with jdev and got an XML document output for that successfully.
    Now, I want to implement this feature in my code for generating XML documents when XSD files are provided.
    Can any one please provide me with pointers to do that? I am sure there should be some libraries which can implement this feature.
    Thanks,
    Dilbagh

    Create an XML document from a Schema with the Oracle SchemaClassGenerator.
    import oracle.xml.classgen.SchemaClassGenerator;
    XMLSchema schema=new XMLSchema();
    XSDBuilder builder = new XSDBuilder();
    URL    url =  new URL(schemaUrl);     
    schema = (XMLSchema)builder.build(url);
    SchemaClassGenerator generator = new SchemaClassGenerator();
    Generate the Java classes from the example XML Schema.
    generator.generate(schema);With the java classes construct an XML document.

  • Error: Unable to find all subVIs from saved VIs.

    TestStand 2010 SP1, LabVIEW 2011, WinXP
    Trying to build a deployment in TestStand.
    During the build, I get the now-infamous popup:
    Title: "Save Modified VIs?"
    Text: "An error occured while trying to read the dependencies of your VIs; a possible cause for this problem is VIs not saved in the current version of LabVIEW. Would you like to save any modified VIs now?"
    I select "yes", and the build then fails with errors in the log pane of the "Build Status" window.  The error is:
    Error: Unable to find all subVIs from saved VIs, either a subVI is missing or the VI is not saved under the current LabVIEW version.
    The missing file path is:  etc, etc.
    I go to said missing path.  The VI is in fact present.  I open the VI and do "Save All", try again.  Same thing.  Then, I try a Mass Compile on the test VI directory.  Attempt to build again, same error.
    Note that I do call some VIs dynamically, but those are all present in my workspace, and are not found in this error.
    Is there a debugging option or log file or some kind of trace I can do to dig into this and find out the state of things causing the error?  Please help me out here.
    -Andy

    One quick way to narrow down the issue is to change your LabVIEW adapter to Run-Time engine and then try and run the sequence in the Sequence Editor.
    Also, triple check your search directories and make sure you're not pulling in VIs from an unexpected location.
    When you see that dialog it's already too late to save so trying to Save at that point never works.
    Another tip is to ignore which VIs it says are not saved in the current version and instead look at the subVIs that those VIs are calling. You can run into this if you have two subVIs loaded with the same name.
    CTA, CLA, MTFBWY

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • Heap space error while creating XML document from Resultset

    I am getting Heap space error while creating XML document from Resultset.
    It was working fine from small result set object but when the size of resultset was more than 25,000, heap space error
    I am already using -Xms32m -Xmx1024m
    Is there a way to directly write to xml file from resultset instead of creating the whole document first and then writing it to file? Code examples please?
    here is my code:
    stmt = conn.prepareStatement(sql);
    result = stmt.executeQuery();
    result.setFetchSize(999);
    Document doc = JDBCUtil.toDocument(result, Application.BANK_ID, interfaceType, Application.VERSION);
    JDBCUtil.write(doc, fileName);
    public static Document toDocument(ResultSet rs, String bankId, String interfaceFileType, String version)
        throws ParserConfigurationException, SQLException {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element results = doc.createElement("sims");
            results.setAttribute("bank", bankId);
            results.setAttribute("record_type", "HEADER");
            results.setAttribute("file_type", interfaceFileType);
            results.setAttribute("version", version);
            doc.appendChild(results);
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            String columnName="";
            Object value;
            while (rs.next()) {
                Element row = doc.createElement("rec");
                results.appendChild(row);
                for (int i = 1; i <= colCount; i++) {
                    columnName = rsmd.getColumnLabel(i);
                    value = rs.getObject(i);
                    Element node = doc.createElement(columnName);
                    if(value != null)
                        node.appendChild(doc.createTextNode(value.toString()));
                    else
                        node.appendChild(doc.createTextNode(""));
                    row.appendChild(node);
            return doc;
    public static void write(Document document, String filename) {
            //long start = System.currentTimeMillis();
            // lets write to a file
            OutputFormat format = new OutputFormat(document); // Serialize DOM
            format.setIndent(2);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            try {
                FileWriter writer = new FileWriter(filename);
                BufferedWriter buf = new BufferedWriter(writer);
                XMLSerializer FileSerial = new XMLSerializer(writer, format);
                FileSerial.asDOMSerializer(); // As a DOM Serializer
                FileSerial.serialize(document);
                writer.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            //long end = System.currentTimeMillis();
            //System.err.println("W3C File write time :" + (end - start) + "  " + filename);
        }

    you can increase your heap size..... try setting this as your environment variable.....
    variable: JAVA_OPTS
    value: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • XML Document from XML Schema Bug

    When an XML document is generated from an XML Schema the XML document does not have all the elements specified in the XML Schema. The XML document only has the root element.
    1. Register an XML Schema.
    2. Create an XML document with File>New>General>XML>XML Document from XML Schema. The "Generate only Required Elements" is unchecked.
    3. The XML document has only the root element.
    In JDeveloper 10.1.3 all the elements in the XML Schema get generated.

    Also, the component palette for the XML document generated from the XML Schema does not list all the elements in the XML Schema, only the root element is listed. Even if elements are specified as required in the XML Schema with minOccurs="1" and the "Generate only Required Elements" checkbox is selected only the root element gets generated.

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

Maybe you are looking for

  • Dell D410 wifi issues

    Howdy i installed the appropriate driver and did as per demand on wiki, but i still cant seem to activate wifi. fn+F2 is the required buttons to push. This does nothing To be fair, atm there is no wifi around, but it should be possible to activate it

  • Outbound buffering for idocs

    Hi, i've got data delivered as idocs. I'd like to read the data at a specific moment in our scheduling process. We already use the same functionality for file data. In this case we switch the specific CC on/off by our scheduler. Is there a possibilit

  • Internet Browser missing

    I bought phone from friend.... Its missing the internet browser app I think... I did a wipe out and everything there is no configuration for it is the problem i think. also missing the help app and the brickbreaker game and stuff.... do i need to get

  • ID CS5 Disable background printing when exporting pdf

    Is there a way to disable background printing when exporting to pdf in InDesign CS5? I really prefer the way pdf-export has been done in the foreground as it has been since InDesign 1.0. An option where you could choose between forground and backgrou

  • Moving Multiple Subtitles in DVDSP4

    Hi Folks Ive had a a job come in, a multi segment DVD. As is often the case someone wants a change and i've been asked to re-edit one of the sections into another. Normally of course this wouldn't be a problem. But for the fact that the original segm