Return file data

ok, I want to create a sub-routine in a spearate class that when I call it opens up a file and returns the file data result in a string.
so:
string = file.GetFile("filename.txt");
And that gives me the data contained in a file in one string varaible.
The annoying thing about it is I could do this in 20 seconds using Perl but for the life of me I can't figure out how to do it in java... being relativly new to the language. Web search have only turned up the same web pages and I'm getting desparte.

since it's a text file (.txt)..you can use this method
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.IOException;
public String fileToString(String filename) throws IOException{
    String newline = System.getProperty("line.separator");
    BufferedReader in = null;
    StringBuffer buffer = new StringBuffer();
    try{
        in = BufferedReader(new FileReader(new File(filename)));
        String line = null;
        while ((line = in.readLine()) != null)
            buffer.append(line).append(newline);
        return buffer.toString();
    catch (IOException e){ throw e; }
    finally{
        try{ if (in != null) in.close(); }
        catch(Exception e){ System.out.println("Cannot close inpput file: " + filename); }
// in your class..you call up this method like this
String strFile;   // the string that holds the content of the file.
try{
    strFile = fileToString(filename);
catch (IOException e){ e.printStackTrace(); }better yet, you can use Jakarta Common IO library.
They have a FileUtils class that have useful methods for you..such as copy file to another destination
File file = new File("filename.txt");
String fileContent = FileUtils.readFileToString(file, "UTF-8");  // you can specify the encoding

Similar Messages

  • Query for file version less than 10.0 does not return expected data

    I'm trying to build a query for all PCs that have a version of Iexplore.exe in c:\windows\program files\ that is less than 10.0 .  When I run the query it returns no data. When I change 10.0 in the query to 9.9 it returns files with version 10.xxx in
    the results.  Its as if it is seeing 10.0 as 1.0.   Is this expected ?
    select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath = "C:\\program files\\internet explorer\\" and SMS_G_System_SoftwareFile.FileVersion < "9.9"

    It is because the values are not integer, they are a string. And therefore 1 is smaller then 9.
    http://www.enhansoft.com/

  • Dreamweaver Template Error: Error reading file (Site Location/info) returned incomplete data

    Hello!
    I am working on new website we are creating for our company. I have never really had any Dreamweaver template file errors before...so this one has me really stumped! We purchased the site files from Template Monster and I have contacted their tech support, but I have not had much luck with them.
    I started out by creating the Dreamweaver template folder that includes the template files that I would like to use. I started creating some pages using the template. I placed all the html pages in the main folder of the website. When I go to update the template to those pages I get the following error: "Error reading file (Site Location\Folder name\Dreamweaver template name) returned incomplete data".
    I am not sure what I am doing wrong. Any help and advice would be greatly appreciated!
    The site is a CSS based site with a Flash navigation menu. Since it is in the production phase, I do not yet have it placed on a server so you can take a look at it at this time (although if really needed and we cannot find an answer, I may be able to get the test site on line - if someone thinks they can help me answer this problem by viewing the site). Right now the site is housed in the same place we house all of the other sites we have produced and all of our other templates on our other websites work just fine. The main difference with this site is that we did purchase files from Template Monster to help speed us along during the construction of the page structures and also this site has a Flash Navigation Menu and a few other Flash elements (something our other sites do not really have).
    I am using Abobe Dreamweaver CS5 and Windows 7
    Thanks again for taking the time to help find and answer to this problem!
    -J

    I am curious as to why no one likes them around here.
    They have spammed these forums in the past.
    The code on their pages is rarely 'best-practice' code.
    There are much better choices available.
    My co-worker and I have to share the files, since we are editing the site together. The files are not local on our computers, but on the company's f drive that have Novell on it.
    This arrangement is a recipe for disaster.  The correct way to collaborate on a site with a colleague is with the following setup:
    Each of you must have a LOCAL site (local to your workstation)
    You would use a single remote location as a staging area, so each of you would have a site definition that specifies your own workstation for the local site, and the same network shared location as the Remote site
    You will both need to enable Check In/ Check Out
    You will both have to agree to PLAY BY THE RULES!
    One (or both) of you will also need to have a second site defined that has the staging server as the local root folder, and would have the PRODUCTION server as the remote site.  I'll explain how to use this site soon.
    When you use CI/CO, your 'gold-standard files' are on the staging server.  To begin working, you would connect to the staging server, and double click on a file, which will a) fetch the file from the staging server to your local site, and b) CHECK OUT the file to you.  As long as you have the file checked out, it cannot be edited by your colleague.  When you are done with your edit, you would CHECK IN the file (which uploads it to the staging server).  It can now be edited by your colleague.
    When you add templates to this scenario, things get even more complicated, although manageable.  If you ever need to make a change to a template you must use the following procedure:
    ALL FILES MUST BE CHECKED IN - this includes both you and your colleague.
    One of you would connect with the SECOND SITE, open and edit the template, and save it propagating the changes to all "LOCAL" files (i.e., on the staging server).
    Each of you would then need to return to the FIRST SITE, and again check out any files you want to work on.
    When changes are done, and files are ready to publish, connect to the SECOND SITE, and upload the files from STAGING to PRODUCTION.
    Does that make sense?  It's important that it does.
    I need to add in one more tab/link to the Flash nav bar.
    Using Flash for navigation is a VERY POOR CHOICE, unless you also have redundant, text-based navigation on the pages.  By using Flash to navigate, you guarantee: a) your pages will not be spiderable by search engines, b) your pages will not be navigable by iPlatforms, and c) your pages will be inaccessible to anyone browsing with screen assistive devices.  Someone is making bad decisions about this site, in my opinion.

  • Report Script returns no data and "java.io.FileNotFoundException" error

    When attempting to write to a new file (Eg: C:\TEST.txt), Report Script returns no data and "java.io.FileNotFoundException" error occurs.
    This error occurs only in Essbase 9.3.1.3 release, however it works fine in release 9.3.1.0.
    After running the report the script, it pops up the follwing message:
    "java.io.FileNotFoundException: ..\temp\eas17109.tmp (The system cannot find the file specified): C:\TEST.txt"
    When checked the TEST.txt, it was empty.

    Sorry folks, I just found out the reason. Its because there was no data in the combination what I was extracting.
    but is this the right error message for that? It should have atleast create a blank file right?

  • CSV spreadsheet returning "no data found"

    Hi,
    In one of the reports, I enabled CSV Output so the report can be downloaded.
    When I download it, using Excel 2000, I have no problem, I can see all the right data.
    However, one of my user, who uses Excel 2002, when saves the file and opens it, returns "no data found" on screen.
    Is this an Excel issue? Is Apex not compatible with Excel 2002? Please advise.
    Thanks!

    Do you have any items on your report page, which you use as a condition for the report? Eventually, you need to compute those items on load. If I remember correctly that was the problem I had before.
    Denes Kubicek

  • Strange error in requests returning huge data

    Hi
    Whenever a request returns huge data, we get the following error, which is annoying because there is no online source or documentation about this error:
    Odbc driver returned an error (SQLFetchScroll).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46073] Operation 'stat()' on file '/orabi/OracleBIData/tmp/nQS_3898_715_34357490.TMP' failed with error: (75) ¾§ . (HY000)
    Any idea what might be wrong?
    Thanks

    The TMP folder is also "working" directory for the cache management (not exclusively). OBIEE tries to check if the report can be run against a cache entry using the info in this file.
    Check if MAX_ROWS_PER_CACHE_ENTRY , MAX_ROWS_PER_CACHE_ENTRY and MAX_CACHE_ENTRY_SIZE are set correctly.
    Regards
    John
    http://obiee101.blogspot.com

  • How to consume the webservice if it returns the data in dataset format

    Dear All,
    We have a requirement to consume webservice created in .NET platform. In that webservice they are returning data in dataset format. In this case i am not able to create a proxy. It is showing the following information.
    Cannot generate proxy (object schema mis
    WSDL, see long text)                   
      <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:import namespace="http://www.w3.org/2001/XMLSchema" />
    - <s:element name="getTaskEffort">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="SPRProjectId" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="getTaskEffortResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="getTaskEffortResult">
    - <s:complexType>
    - <s:sequence>
      <s:element ref="s:schema" />
      <s:any />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>
      </wsdl:types>
    - <wsdl:message name="getTaskEffortSoapIn">
      <wsdl:part name="parameters" element="tns:getTaskEffort" />
      </wsdl:message>
    - <wsdl:message name="getTaskEffortSoapOut">
      <wsdl:part name="parameters" element="tns:getTaskEffortResponse" />
      </wsdl:message>
    - <wsdl:portType name="OntimeWSSoap">
    - <wsdl:operation name="getTaskEffort">
      <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">This method.</documentation>
      <wsdl:input message="tns:getTaskEffortSoapIn" />
      <wsdl:output message="tns:getTaskEffortSoapOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="OntimeWSSoap" type="tns:OntimeWSSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="getTaskEffort">
      <soap:operation soapAction="http://tempuri.org/getTaskEffort" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="OntimeWS">
      <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    - <wsdl:port name="OntimeWSSoap" binding="tns:OntimeWSSoap">
      <soap:address location="http://hts-pcs-0808/OntimeData/Ontime.asmx" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    I tried to consume webservice http://student.ohecampus.com/projects/group95/stud17/assignment7/validateEmail.asmx, which will return the data in boolean format. In this case, i am able to create a proxy and it is working fine. Can anyone help me out.
    Thanks in advance.
    Regards,
    Karthick

    Dear Raja,
    I checked with webservice owner who created the webservice. They are telling that there is no problem in XML file which they gave. The webservice they provided is consumed in many application and it is working fine. When in SAP, i tried to create a proxy it is showing the in information which i mentioned in earlier posted forum message.
    Kindly advice.
    Regards,
    Karthick

  • Returning XML Data from a database

    Ok, just got the new DW CS3 and really want to begin using
    the built in Spry capabilitites. All of the examples I've seen for
    populating the datasets with XML data are based on referencing a
    static XML file. I want to query my database and return XML data to
    a Spry Table. How do I accomplish this? I know how to perform the
    query and retrun the data in an XML format (ColdFusion) but I can't
    tell the spry dataset to use this. HELP!!

    Well, that's the trick... I can't point to a testing server
    (i.e. Application interface) because we aren't permitted to have
    the RDS login where I work. (They haven't bothered to configure the
    CF server for restricting access) I have to manually create all
    connections and queries. I'm currenlty using the exact format in
    the example page you provided to return the data in an XML format
    but when I point to that file as my datasource I get nothing
    displayed on the page. The file that performs the query and returns
    the data is in a separate file from the one I'm trying to use the
    Spry table in. When I use this same query file for an Ajax call to,
    say, populate a listbox or pulldown menu it works fine, but I can't
    get it to work with the Spry dataset.

  • JSObject returns wrong date. How can I extract correct date from digital signature?

    I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and minute are correct, but only day is incorrect.
    Here is my code. I'm using Acrobat 8.1.3.
    Please tell me what's wrong with this code and how I can extract correct date from digital signatures.
    Public Sub sbTest()
    Dim oApp As Acrobat.acroApp
    Dim oPDDoc As Acrobat.AcroPDDoc
    Dim jso As Object
    Dim f As Object
    Dim sig As Object
    Dim strFileName As String
    Set oApp = CreateObject("AcroExch.App")
    Set oPDDoc = CreateObject("AcroExch.PDDoc")
    strFileName = "C:\Test.pdf"
    If (oPDDoc.Open(strFileName)) Then
    Set jso = oPDDoc.GetJSObject
    Set f = jso.getField("Signature1.0")
    Set sig = f.signatureInfo()
    Debug.Print sig.Name
    Debug.Print sig.Date
    End If
    Call oPDDoc.Close
    Call oApp.Exit
    End Sub

    Hi
    You can use TDMS file format to save the data. I have attached a reference Vi.
    On button click you can log the data or remove the case structure and continuous log the complete acquisition data.
    Thanks and Regards
    Himanshu Goyal
    Thanks and Regards
    Himanshu Goyal | LabVIEW Engineer- Power System Automation
    Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
    It Only gets BETTER!!!
    Attachments:
    Data Save in File.vi ‏35 KB

  • Loading wave file data into array

    Greetings
    For starters, I'm still learning java, so forgive me if this is a trivial question. I've been using the documentation on the java sound api as a guide. What I am trying to do is to load a wav file data into a byte array and eventually I will need it to have it in an int array so I can pass the data into a demodulation algorithm to display as an image. This wave file is a recorded signal from a NOAA satellite. Here is my code thus far:
    public boolean loadFile(File soundFile) {
              int totalFramesRead = 0;
              boolean result=false;
              File fileIn = new File(soundFile.getPath());
              try {
                   AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
                   int bytesPerFrame = ais.getFormat().getFrameSize();
                   // Set an arbitrary buffer size of frames.
                   int numBytes = 1024*bytesPerFrame;
                   byte[] audioByte= new byte[numBytes];
                   try {
                        int numBytesRead = 0;
                        int numFramesRead = 0;
                        // Try to read numBytes bytes from the file.
                        while ((numBytesRead = ais.read(audioByte)) != -1) {
                             // Calculate the number of frames actually read.
                             numFramesRead = numBytesRead / bytesPerFrame;
                             totalFramesRead += numFramesRead;
                             return(result= true);
                   } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
                   ais.close();
                   throw ex;}
              } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
              return result;
         }

    You can find oracle documentation for sqlldr (11g) here:
    http://docs.oracle.com/cd/B28359_01/server.111/b28319/ldr_concepts.htm#SUTIL003
    If you have questions on details you should post your question in the special sqlldr forum:
    Export/Import/SQL Loader & External Tables
    hm

  • OneDrive stopped returning files with a "+" in its file name.

    Hi,
    My app creates a folder in OneDrive in the name of the app and saves a data file with the same name in it.  My app name contains a "+" in the name.  For example "Menu+ Inventory.dat"
    All was working well for last couple of years and suddenly OneDrive is not returning files with a "+" in its name for the last few days.  Many of my app users will loose data if the file couldn't be retrieved from OneDrive.
    // Runs a search query on SkyDrive to find a matching file.
    function searchForFile(path) {
    var whenFolderFound = _searchForFolder();
    var skyDriveSearchPath = "/me/skydrive/search?q=" + path;
    // Runs async search for the user-specified file.
    var whenFilesFound = WL.api({
    path: skyDriveSearchPath,
    method: "GET"
    }).then(function (response) {
    if (response != null) {
    return WinJS.Promise.wrap(response);
    } else {
    inMemoryFile = null;
    return WinJS.Promise.wrap(false);
    In the SkyDrive Roaming Data sample, in the above function, if the skyDriveSearchPath has the above mentioned filename, the response doesn't have the file.  The sample app will create the file, save data with that name, but does not read the file. It
    can read other files with no "+" in the file name.
    Is there a change in OneDrive naming specs recently? 

    Sorted. Well sort of. I still have the problem but I know why. Apparently O2 will not allow anyone to send an attachment which has a space in the name. They claim that this reduces spam - no idea why they think that will stop spam but there you go...

  • Commas in my CSV file data

    Hi everyone,
    I am trying to create a csv file.
    One field that I am trying to out put is the description and has commas, that is throwing my columns out of sync.
    I have tries putting the charactor ' around the data but all it does is output that charactor in the data.
    my code is this
         public File createFile(Vector downloadObject){
              Iterator iterator = downloadObject.iterator();
              String query ="";
              try {
                   Format formatter2 = new SimpleDateFormat("ddMMyyyy");
                   String fileName="DELIVERY" + ".csv";
                   File file = new File(fileName);
                   StringBuffer output = new StringBuffer();
                   while (iterator.hasNext()){
                        VODownloadObject downloadObject2 = (VODownloadObject)iterator.next();
                        query =
                             "'" +
                             downloadObject2.getStrokeNumber().trim()
                             + "','"+ downloadObject2.getJdeIdNumber()
                             + "','"+ downloadObject2.getRollNumber()
                             + "','"+ downloadObject2.getSupplier()
                             + "',"+ ",'"+ downloadObject2.getQuality()
                             + "','"+ downloadObject2.getColour()
                             + "','"+ downloadObject2.getSupplierRollNumber()
                             + "',"+ ",'"+ downloadObject2.getDeliveryDate()
                             + "','"+ downloadObject2.getFabricComposition()
                             + "',"+ ","+ ",'"+ downloadObject2.getTicketLength()
                             + "','"+ downloadObject2.getTicketWidth()
                             + "',"+ ","+ ","+ ",";
                        output.append(query + "\r\n");
                   BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                   out.write(output.toString());
                   out.close();
                   return file;
              } catch (IOException e) {
                   e.printStackTrace();
                   return null;
         }the output is this.
    'PA?????T','2/664659 ','153920','Menswear Formal, Shirts ',,'null','null',' ',,'11/07/2006','null',,,'-330000',' ',
    in the "'Menswear Formal, Shirts " field, this is one field but it is splitting up into 2 fields because there is a comma after Formal. Anyone know how I can keep this as one field but with a comma in it?
    thanks in advance

    I have abandoned my last appoach altogether
    I am using com.Ostermiller.util.CSVPrinter
    here is my final working class
         public File createFile(Vector downloadObject){
              Iterator iterator = downloadObject.iterator();
              String query ="";
              try {
                   Format formatter2 = new SimpleDateFormat("ddMMyyyy");
                   String fileName="DELIVERY" + ".csv";
                   File file = new File(fileName);
                   BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                   ExcelCSVPrinter ecsvp = new ExcelCSVPrinter(
                             out
                   while (iterator.hasNext()){
                        VODownloadObject downloadObject2 = (VODownloadObject)iterator.next();
                        String quality = " ";
                        if (downloadObject2.getQuality()!=null){
                             quality = downloadObject2.getQuality().trim();
                        String colour = " ";
                        if (downloadObject2.getColour()!=null){
                             colour = downloadObject2.getColour().trim();
                        String fabricComposition = " ";
                        if (downloadObject2.getFabricComposition()!=null){
                             fabricComposition =downloadObject2.getFabricComposition().trim();
                        ecsvp.writeln(new String [] {
                                   downloadObject2.getStrokeNumber().trim(),downloadObject2.getJdeIdNumber().trim(),
                                   downloadObject2.getRollNumber(), downloadObject2.getSupplier().trim(), " " ,
                                   quality , colour , downloadObject2.getSupplierRollNumber().trim() , " ",
                                   downloadObject2.getDeliveryDate().trim(), fabricComposition , " ", " ",
                                   downloadObject2.getTicketLength(), downloadObject2.getTicketWidth().trim(),
                   out.close();
                   return file;
              } catch (IOException e) {
                   e.printStackTrace();
                   return null;
         }

  • Fillable PDF returned with data, can't see on screen or print

    Hi
    Help!
    I have created a fillable PDF.  Client has sent out to their client. Form has been returned. Data is in the fields. However, cannot see the data on screen, or print the data.
    Was able to save as / export to an fdf file, then open the fdf file and all details were visible. When printing, an error message popped up, however, everything on the page did print out as expected.
    Not sure how the client sent out the original PDF, however, the buttons on the returned PDF have been stripped of their functions !!  Somewhere along the process (not sure where/how) the function of the PDF changed!!! ?

    No, there are a number of PDF viewers that don't support JavaScript at all. Preview is odd in that it removes a lot of things when it saves, including all JavaScripts, (field, page, document) actions, digital signatures, layers, and many other things. Other PDF viewers are less pernicious, but still don't have much or any support for either form fields or JavaScript. Even Adobe Reader on mobile devices has significantly less support than the desktop versions (Win/Mac) of Reader do.
    It is possible to set up a form so that it is essentially unusable if the PDF viewer being used does not have sufficient support for JavaScript. This way the user is prevented from filling in the form and thinking that everything is OK. They will instead be warned to use Adobe Reader, or be allowed to proceed if using some other PDF viewer that is sufficient, such as PDF Expert on iOS, qPDF Notes on Android, or somethig like Foxit Reader or Nitro PDF Reader on Windows.

  • Ibots not returning any data

    Hi,
    I have some ibots that I scheduled to run on a daily basis and which were working perfectly.
    Suddenly the same ibots, they run but the content of the attachment says "The specified criteria did not return any data".
    I checked the log files and could not see any relavant error.
    If I go back in the report that I am sending through the ibot, it runs without any problem.
    I tried to send it in different formats and run as different users, but the results are still the same!
    Any idea what else I could check?
    Type: Warning
    Severity: 50
    Time: Wed May 15 14:10:19 2013
    File: project/webodbcaccess/odbcconnectionimpl.cpp Line: 199
    Properties: RptPath-/shared/MICROS/giuliano/cube_build_verification;SID-btilnnapkfo2omg91a71b9m6n2;bindID-1;connID-31;ThreadID-4640;statementID-364;RSP-o:go~r:report
    Location:
         saw.odbc.statement.fetch
         saw.subsystem.portal.pdf
         saw.delivers.rpc.getDeviceContent
         saw.rpc.server.responder
         saw.rpc.server
         saw.rpc.server.handleConnection
         saw.rpc.server.dispatch
         saw.threadPool
         saw.threads
    SQLFetchScroll returned code SQL_NO_DATA_FOUND

    Thanks it solved the issue.
    But One more thing Now I have placed the parameters in the where clause of the query
    Query-
    select field1,field2,field3,field4,field5,job_name,candidate_name,interview_date from etc.ethr_irc_int_details
    where field1 is not null
    and job_name = :1
    and candidate_name = :2
    and interview_date = :3
    in the VO I am executing
    public void iniQuery(String S1, String S2,String S3)
    System.out.println("insdie ini query of the VO");
    System.out.println("S1 "+S1);
    System.out.println("S2 "+S2);
    System.out.println("S3 "+S3);
    this.setWhereClauseParams(null);
    this.setWhereClauseParam(0,S1);
    this.setWhereClauseParam(1,S2);
    this.setWhereClauseParam(2,S2);
    executeQuery();
    and in AM
    ETHRIntDetailsVOImpl IDVO = (ETHRIntDetailsVOImpl)this.getETHRIntDetailsVO();
    // IDVO.executeQuery();
    // OAViewObject IDVO = (OAViewObject)findViewObject("ETHRIntDetailsVO");
    IDVO.iniQuery(S1,S2,S3);
    Row row = IDVO.first();
    again I am not getting any data in the row??
    Any idea if I am doing any thing wrong..
    Please help urgently.
    Thanks
    Ashish

  • OracleVM and paravirtualized guest - "Boot loader didn't return any data!"

    Hi folks,
    we're having a problem here: We have installed the latest version of Oracle VM Server on a machine that does not provide hardware virtualization support (i.e., no Intel VT or similar). As a result, we will not be able to make use of hardware virtualized VMs, but according to the Oracle docs, we should be able to set up virtual machines of the paravirtualized domain type. So far, so good.
    Also according to the docs, when setting up a PVM, one cannot use an ISO image located in a storage repository in order to start the installation, but instead one would have the mount the installation ISO somewhere, make available it's contents via NFS (or HTTP / FTP), and then set up the newly created virtual machine to attempt a PXE boot, specifying the location where the contents of the ISO have been placed (i.e.: nfs:host:/path/to/mounted/iso). All of this is decribed very well in the Oracle VM Server docs (chapter 8), but somehow it still doesn't seem to work for us.
    What happens is this: When we attempt to boot our PVM via PXE, specifying the NFS location where we've made the contents of the ISO available, we always get this:
    Job Construction Phase
    begin()
    Appended operation 'Virtual Machine Start' to object '0004fb0000060000ab1b8caa045cc7a8 (VMOEL6)'.
    commit()
    Completed Step: COMMIT
    Objects and Operations
    Object (IN_USE): [VirtualMachine] 0004fb0000060000ab1b8caa045cc7a8 (VMOEL6)
    Operation: Virtual Machine Start
    Object (IN_USE): [Vnic] 0004fb0000070000797b4c17ae1154dd (00:21:f6:00:00:0a)
    Object (IN_USE): [StorageElement] 0004fb0000180000eb569988de92923e (SATA_WDC_WD5001ABYS-_WD-WCAS86231834)
    Object (IN_USE): [VirtualDisk] 0004fb0000120000cdbce172d90322c3.img (VMOEL6Disk1)
    Object (IN_USE): [VmDiskMapping] 0004fb0000130000aaa3f5eb57705a5b
    Object (IN_USE): [VmDiskMapping] 0004fb0000130000f1438eedcfee01de
    Job Running Phase at 18:11 on Fri, Oct 14, 2011
    Job Participants: [44:45:4c:4c:37:00:10:46:80:4b:b8:c0:4f:59:31:4a (ORAVM1)]
    Actioner
    Starting operation 'Virtual Machine Start' on object '0004fb0000060000ab1b8caa045cc7a8 (VMOEL6)'
    Job Internal Error (Operation)com.oracle.ovm.mgr.api.exception.FailedOperationException: OVMAPI_4010E Attempt to send command: dispatch to server: ORAVM1 failed. OVMAPI_4004E Server Failed Command: dispatch https://?uname?:[email protected]:8899/api/1 start_vm 0004fb00000300001d1619c621b16838 0004fb0000060000ab1b8caa045cc7a8, Status: org.apache.xmlrpc.XmlRpcException: exceptions.RuntimeError:Command: ['xm', 'create', '/OVS/Repositories/0004fb00000300001d1619c621b16838/VirtualMachines/0004fb0000060000ab1b8caa045cc7a8/vm.cfg'] failed (1): Error: Boot loader didn't return any data!
    We've used multiple different ISOs in order to test this, including Oracle Enterprise Linux (just like the example in the docs does), however, we never get any further than this error message.
    Any ideas what we might be doing wrong?
    Greetings,
    Nils

    Hi Avi,
    thanks for your reply! Actually, I believe I checked the NFS reachability already. Here's what I can do on the VM server:
    [root@ORAVM1 ~]# ls /mnt/test
    [root@ORAVM1 ~]# mount.nfs 10.0.0.220:/mnt/iso /mnt/test
    [root@ORAVM1 ~]# ls /mnt/test
    EFI eula.py images media.repo README-en.html RELEASE-NOTES-x86_64-en RELEASE-NOTES-x86-en.html RPM-GPG-KEY Server
    EULA GPL isolinux Packages RELEASE-NOTES-en RELEASE-NOTES-x86_64-en.html repodata RPM-GPG-KEY-oracle supportinfo
    eula.en_US HighAvailability LoadBalancer README-en RELEASE-NOTES-en.html RELEASE-NOTES-x86-en ResilientStorage ScalableFileSystem TRANS.TBL
    [root@ORAVM1 ~]#
    So, I seem to be able to mount the NFS export correctly (what we're seeing are the contents of an Oracle Enterprise Linux ISO). And when setting up the VM, I specify "nfs:10.0.0.220:/mnt/iso" as the PXE boot path. Still it doesn't seem to work. :-(
    ovs-agent.log doesn't seem to contain too many additinal information of value either. Here's a snippet of what seems to happen when I power up my VM, but I guess there's nothing really new in there:
    [2011-10-20 12:56:37 22423] ERROR (OVSServices:61) dispatch error: start_vm: <Fault 1: "exceptions.RuntimeError:Command: ['xm', 'create', '/OVS/Repositories/0004fb00000300001d1619c621b16838/VirtualMachines/0004fb0000060000ab1b8caa045cc7a8/vm.cfg'] failed (1): Error: Boot loader didn't return any data!\n ">
    [2011-10-20 12:56:37 22423] ERROR (OVSCommons:142) catch_error: <Fault 1: "exceptions.RuntimeError:Command: ['xm', 'create', '/OVS/Repositories/0004fb00000300001d1619c621b16838/VirtualMachines/0004fb0000060000ab1b8caa045cc7a8/vm.cfg'] failed (1): Error: Boot loader didn't return any data!\n ">
    Traceback (most recent call last):
    File "/opt/ovs-agent-3.0/OVSCommons.py", line 140, in wrapper
    return func(*args)
    File "/opt/ovs-agent-3.0/OVSServices.py", line 59, in dispatch
    return getattr(sp, func)(*args)
    File "/opt/ovs-agent-3.0/utils/xmlrpclib.py", line 1099, in __call__
    return self.__send(self.__name, args)
    File "/opt/ovs-agent-3.0/utils/xmlrpclib.py", line 1386, in __request
    verbose=self.__verbose
    File "/opt/ovs-agent-3.0/utils/xmlrpclib.py", line 1150, in request
    return self._parse_response(h.getfile(), sock)
    File "/opt/ovs-agent-3.0/utils/xmlrpclib.py", line 1289, in parseresponse
    return u.close()
    File "/opt/ovs-agent-3.0/utils/xmlrpclib.py", line 746, in close
    raise Fault(**self._stack[0])
    Fault: <Fault 1: "exceptions.RuntimeError:Command: ['xm', 'create', '/OVS/Repositories/0004fb00000300001d1619c621b16838/VirtualMachines/0004fb0000060000ab1b8caa045cc7a8/vm.cfg'] failed (1): Error: Boot loader didn't return any data!\n ">
    So, any further ideas where to look?
    Edited by: BadForGood on 21.10.2011 04:38

Maybe you are looking for