3.1EA3 Code parser bug + File - New...

Hello guys,
I was creating new package yesterday, because it was just some testing package, I didn't need to store the source code in a file. Keeping it in database only was enough for me...
So I used File -> New and chose Package. Ok, this created a package specification template. But how to create package body? There is nothing like that in the File -> New window. So this is first thing I wanted to mention.
So I created empty file, opened it in SQL Developer with current connection and started typing package body. The source code looked like this:
CREATE OR REPLACE PACKAGE BODY AS TEST_PACKAGE2
END TEST_PACKAGE2;Yes, there is a bug in this code "AS" should be on the end...
I wrote planty of code in the package body and when I finished, saved it and wanted to compile, nothing happened. The only thing what will happen after you try to compile this, is that the file name in the tab is changed to italic, like when you do some change.
Why is the filename on the tab changing to italic?
Why compilator doesn't report any error message in this case?
Edited by: xxsawer on 11.1.2012 23:44

Hello Vadim,
I think you are missing the point. The point is that you make a mistake in declaring new package body or spec and when trying to compile it, you don't get any warning or error. The procedure how you create new spec is irelevant...
So once again.
1) Create new empty file with name TEST_PACKAGE.pks
2) Open it in SQL Developer and paste there exactly this:
CREATE OR REPLACE PACKAGE AS TEST_PACKAGE
FUNCTION TEST RETURN BOOLEAN;
END TEST_PACKAGE;Try to compile it. You get nothing as compilation output. Yes in this case is part of first line underlined indicating there is some problem...
3) Correct the mistake and use this as package spec
CREATE OR REPLACE PACKAGE TEST_PACKAGE AS
FUNCTION TEST RETURN BOOLEAN;
END TEST_PACKAGE;4) Compile it -> You get "Compiled" as a message from the compilator
5) Create new empty file TEST_PACKAGE.pkb
6) Open it in SQL Developer and paste there exactly this:
CREATE OR REPLACE PACKAGE BODY AS TEST_PACKAGE
FUNCTION TEST RETURN BOOLEAN IS
BEGIN
  NULL;
END;
END TEST_PACKAGE;Try to compile it. Nothing happens. No compilator output at all... Why???
In this case even first line isn't underlined, but part of the function declaration is.
So the point is, when you do mistake in package declaration like I did here (I moved keyword "AS" before name of package) you don't get any message from the compilator.

Similar Messages

  • 3.1EA3 Worksheet parser bug

    Hello, I found this bug yesterday while writing this thread:
    3.1EA3 Members of package body not listed in the tree - Still not fixed!!!
    Simply put this into your worksheet
    CREATE LIBRARY TEST_DLL AS '/a/b/c/x.dll';
    SELECT * FROM USER_LIBRARIES;
    DROP LIBRARY TEST_DLL;Part of first line is underlined highlighting there is some error in this statement even there isn't.
    Place the cursor on the first line and pres Ctrl + Enter. The parser is probably confused by those slashes and "executes" whole worksheet... Now highlight second line and press Ctrl + Enter and look what was created.

    Hello Vadim,
    I think you are missing the point. The point is that you make a mistake in declaring new package body or spec and when trying to compile it, you don't get any warning or error. The procedure how you create new spec is irelevant...
    So once again.
    1) Create new empty file with name TEST_PACKAGE.pks
    2) Open it in SQL Developer and paste there exactly this:
    CREATE OR REPLACE PACKAGE AS TEST_PACKAGE
    FUNCTION TEST RETURN BOOLEAN;
    END TEST_PACKAGE;Try to compile it. You get nothing as compilation output. Yes in this case is part of first line underlined indicating there is some problem...
    3) Correct the mistake and use this as package spec
    CREATE OR REPLACE PACKAGE TEST_PACKAGE AS
    FUNCTION TEST RETURN BOOLEAN;
    END TEST_PACKAGE;4) Compile it -> You get "Compiled" as a message from the compilator
    5) Create new empty file TEST_PACKAGE.pkb
    6) Open it in SQL Developer and paste there exactly this:
    CREATE OR REPLACE PACKAGE BODY AS TEST_PACKAGE
    FUNCTION TEST RETURN BOOLEAN IS
    BEGIN
      NULL;
    END;
    END TEST_PACKAGE;Try to compile it. Nothing happens. No compilator output at all... Why???
    In this case even first line isn't underlined, but part of the function declaration is.
    So the point is, when you do mistake in package declaration like I did here (I moved keyword "AS" before name of package) you don't get any message from the compilator.

  • CS5 - trying to load a new style .asl file - keep getting "error, because no parser or file format can open the file."  what gives?

    trying to load a new style for a project.  CS5 PSD.  the .asl file when dragged into the doc, gives the the following "error, because no parser or file format can open the file."  what gives?

    .asl files are layer styles
    You can go to Window>Styles and then load the styles from the styles panel fly-out menu

  • How to compare after parsing xml file

    Hi,
    following code, parse the input.xml file, counts how many nodes are there and writes the node name and its value on screen.
    1) i am having trouble writing only node name into another file instead of writing to screen.
    2) after parsing, i like to compare each node name with another .xsd file for existence.
    Please keep in mind that, input.xml is based on some other .xsd and after parsing i have comparing its tag with another .xsd
    Need you help guys.
    thanks
    * CompareTags.java
    import java.io.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    /** This class represents short example how to parse XML file,
    * get XML nodes values and its values.<br><br>
    * It implements method to save XML document to XML file too
    public class CompareTags {
    private final static String xmlFileName = "C:/input.xml";
         int totalelements = 0;
    /** Creates a new instance of ParseXMLFile */
    public CompareTags() {
    // parse XML file -> XML document will be build
    Document doc = parseFile(xmlFileName);
    // get root node of xml tree structure
    Node root = doc.getDocumentElement();
    // write node and its child nodes into System.out
    System.out.println("Statemend of XML document...");
    writeDocumentToOutput(root,0);
                   System.out.println("totalelements in xyz tag " + totalelements);
              System.out.println("... end of statement");
    /** Returns element value
    * @param elem element (it is XML tag)
    * @return Element value otherwise empty String
    public final static String getElementValue( Node elem ) {
    Node kid;
    if( elem != null){
    if (elem.hasChildNodes()){
    for( kid = elem.getFirstChild(); kid != null; kid = kid.getNextSibling() ){
    if( kid.getNodeType() == Node.TEXT_NODE ){
    return kid.getNodeValue();
    return "";
    private String getIndentSpaces(int indent) {
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < indent; i++) {
    buffer.append(" ");
    return buffer.toString();
    /** Writes node and all child nodes into System.out
    * @param node XML node from from XML tree wrom which will output statement start
    * @param indent number of spaces used to indent output
    public void writeDocumentToOutput(Node node,int indent) {
    // get element name
    String nodeName = node.getNodeName();
    // get element value
    String nodeValue = getElementValue(node);
    // get attributes of element
    NamedNodeMap attributes = node.getAttributes();
    System.out.println(getIndentSpaces(indent) + "NodeName: " + nodeName + ", NodeValue: " + nodeValue);
    for (int i = 0; i < attributes.getLength(); i++) {
    Node attribute = attributes.item(i);
    System.out.println(getIndentSpaces(indent + 2) + "AttributeName: " + attribute.getNodeName() + ", attributeValue: " + attribute.getNodeValue());
    // write all child nodes recursively
    NodeList children = node.getChildNodes();
              //int totalelements = 0;
    for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
                   //     System.out.println("child value.."+child);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
    writeDocumentToOutput(child,indent + 2);
                             if(node.getNodeName() == "DATA"){
                             totalelements = totalelements+1;}
                        //System.out.println("totalelements in DATA tag " + totalelements);
    /** Parses XML file and returns XML document.
    * @param fileName XML file to parse
    * @return XML document or <B>null</B> if error occured
    public Document parseFile(String fileName) {
    System.out.println("Parsing XML file... " + fileName);
    DocumentBuilder docBuilder;
    Document doc = null;
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    docBuilderFactory.setIgnoringElementContentWhitespace(true);
    try {
    docBuilder = docBuilderFactory.newDocumentBuilder();
    catch (ParserConfigurationException e) {
    System.out.println("Wrong parser configuration: " + e.getMessage());
    return null;
    File sourceFile = new File(fileName);
    try {
    doc = docBuilder.parse(sourceFile);
    catch (SAXException e) {
    System.out.println("Wrong XML file structure: " + e.getMessage());
    return null;
    catch (IOException e) {
    System.out.println("Could not read source file: " + e.getMessage());
    System.out.println("XML file parsed");
    return doc;
    /** Starts XML parsing example
    * @param args the command line arguments
    public static void main(String[] args) {
    new CompareTags();
    }

    hi,
    check out the following links
    Check this blog to extract from XML:
    /people/kamaljeet.kharbanda/blog/2005/09/16/xi-bi-integration
    http://help.sap.com/saphelp_nw04/helpdata/en/fe/65d03b3f34d172e10000000a11402f/frameset.htm
    Check thi link for Extract from any DB:
    http://help.sap.com/saphelp_nw04s/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
    regards
    harikrishna N

  • Error parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="generator" content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Transform</title>
    <link type="text/css" rel="stylesheet" href="css/CascadeMenu.css">
    </head>
    <body id="Bdy">
    Hello all, I've run into a perplexing problem with a new and unexptected error on a web application that resides in a JDeveloper 11g environment. I just run it from JDeveloper on my laptop. No deployement other than to the default server at run time Integratedweblogicserver. I am doing an XML transform using XSLT and it has been working fine until I tried to use the page yesterday. I get the following error. javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:417) at jsp_servlet.__transform._jspService(__transform.java:109) at weblogic.servlet.jsp.JspBase.service(JspBase.java:34) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94) at java.security.AccessController.doPrivileged(Native Method) at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313) at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413) at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138) at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Caused by: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). at oracle.xml.jaxp.JXSAXTransformerFactory.reportConfigException(JXSAXTransformerFactory.java:759) at oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:371) at oracle.xml.jaxp.JXSAXTransformerFactory.newTransformer(JXSAXTransformerFactory.java:272) at weblogic.xml.jaxp.RegistryTransformerFactory.newTransformer(RegistryTransformerFactory.java:209) at org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:145) at jsp_servlet.__transform._jsp__tag2(__transform.java:223) at jsp_servlet.__transform._jspService(__transform.java:102) ... 25 more Caused by: java.lang.ClassCastException: weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser at oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:357) ... 30 more ------------------------------------------------ I changed no code or moved any XML or XSLT file. I do see an error in the log regarding a bad URL ----------------------------------------------- XML-22108: (Error) Invalid Source - URL format is incorrect. XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser). &lt;[ServletContext@10343785[app:QSBQAR module:QSBQAR-QSBQAR-context-root path:/QSBQAR-QSBQAR-context-root spec-version:2.5], request: weblogic.servlet.internal.ServletRequestImpl@699744[ GET /QSBQAR-QSBQAR-context-root/Transform.jsp?reqtype=1 HTTP/1.1 Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Accept-Language: en-us User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; . ------------------------------ Here is the XML ------------------------------ <?xml version="1.0" encoding="windows-1252" standalone="no"?>
    ACME Bird Seed Co. Capture the Road Runner using a boulder, rope and bird seed. Quinn Brian 00 00 00 00 00 00 00 00 00 11 08 08 08 08 00 43 43 Hours have been approved. APPROVED Smart Jean 00 00 00 00 00 00 00 00 00 Hours approved. APPROVED --------------------------------------------------------------------------------------- Here is the XSL --------------------------------------------------------------------------------------- <?xml version="1.0" encoding="windows-1252"?>
    <!-- Root template -->
    <h2>Project Hours Worked</h2>
    ----------------------------------------------------------------------------------------- Here is the JSP with the transform ----------------------------------------------------------------------------------------
    <table>
    <tr>
    <td>Week Ending Date:--</td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <th>Client</th>
    <td></td>
    <th>Project</th>
    <td></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <th>Last Name</th>
    <th>First Name</th>
    <th>Task</th>
    <th>---</th>
    <th>Sun</th>
    <th>Mon</th>
    <th>Tue</th>
    <th>Wed</th>
    <th>Thu</th>
    <th>Fri</th>
    <th>Sat</th>
    <th>---</th>
    <th>Ttl</th>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>---</td>
    <td>---</td>
    <td></td>
    <td>---</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td>---</td>
    <td></td>
    </tr>
    <tr>
    <td>Total Hours: </td>
    <td></td>
    <td></td>
    </tr>
    <%@ page contentType="text/html;charset=windows-1252"%><%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %></table>
    <script type="text/javascript" src="scripts/CascadeMenu.js">
    </script>
    <% int bad = 1; %>
    <div id="menuBar" class="menuBar">
    <div id="Bar1" class="Bar">Home</div>
    <div id="Bar3" class="Bar">Accounting</div>
    <div id="Bar4" class="Bar">Help</div>
    </div>
    <div style="background:#84ffff; color:Aqua; "><br>
    <br>
    <p style="color:Orange; font-size:x-large; font-style:italic; font-weight:bold;
    font-family:Arial, Helvetica, sans-serif; "><img src="images/logoqsq.jpg" style="border:1" height="120" width="120" alt="Q Squared">
    </p>
    </div>
    <div>
    <p style="color:Black; font-size:x-large; font-style:italic; font-weight:bold; font-family:Arial, Helvetica, sans-serif;"><img src="images/dilbert.gif" alt="Dilbert" height="100" width="100">
    ? ? Welcome to Q Squared-Brian Quinn Consulting - Manager Time Approval</p>
    </div>
    <div>
    <table width="100%" class="table1">
    <tr>
    <td style="width:15%; border-width:medium; background-color:silver ">
    <h3>Contractor Resources</h3>
    <ul style="list-style-type:circle; ">
    <li>Time Entry</li>
    <li>Profile</li>
    </ul>
    <h3>Manager Resources</h

    LOL - I didn't think about the forum message area having trouble displaying my XML XSLT problem
    It seemed to mix the code with the site XML.
    Oh brother
    The deal is this.
    The XML XSLT transform was working and now it is not and I think it has something to do with
    the HTTP links for either the Oracle core and/or XML TAGLIBs. Either that or the W3.org has
    outdated XSLT http links.
    Anyone know if changes have been made to any of these taglib links?
    This in the JSP
    <!--
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked3.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}" />
    -->
    This in the XSL
    <!--
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    -->
    And the other JSP having the same problem.
    <!--
    <%@ page contentType="text/html;charset=windows-1252"
    import="java.util.List, qsbqar.XMLHandler, org.w3c.dom.NodeList,
    javax.xml.transform.*, javax.xml.transform.stream.*,
    org.w3c.dom.Node, oracle.xml.parser.v2.*, java.io.File,
    java.io.FileReader " %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <xsl:param name="employeeID" value="2"/>
    <%session.setAttribute("employee_ID", request.getParameter("consultantID")); %>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked4.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}">
    <x:param name="employeeID" value="${sessionScope.employee_ID }"/>
    </x:transform>
    -->
    Edited by: B of Carbon on Dec 19, 2010 12:25 AM

  • Server Side Includes for Apache and parsing text files

    I have an old website I used to do zipped up and I decided to set it up on my personal webserver in OS X . I got apache configured to allow server side includes (edited the httpd.conf to all them:
    <Directory />
    Options FollowSymLinks Indexes MultiViews Includes
    AllowOverride None
    </Directory>
    But I can't get the pages to come up. See I have this .shtml page which loads fine and a part of it has this line:
    <!--#include file="news/news.txt" -->
    But it won't parse that txt file and show the html that its formatted in.
    Anyone have any ideas on how to get it to parse that txt file? Even if I load just that txt file it shows raw code not it formatted. Please help.

    Ignore that first reply. I thought I was dealing with server.
    As usual, I fogot to make sure that Includes was in the Options directive for the DOCUMENT_ROOT or VirtualHost. After 10 years, you'd think I'd remember that. I just configged one of my macs to do SSI. Here's the 3 lines that I changed:
    Line 399 (the DOCUMENT_ROOT definition): Options Indexes FollowSymLinks MultiViews Includes
    Line 887 (To use server parsed HTML): AddType text/html .shtml
    Line 888: AddHandler server-parsed .shtml
    apachectl restart
    and off it went!
    Roger

  • Parse owl file using jena

    please, if anyone can help me... i am pretty desperate..
    i have to find a parser for an owl file using jena and i can't manage it. PLease if anyone can help me with some detailed code and how to use it(how to make java recognize jena,etc...)
    thank you in advance
    poli

    A lot of the information needed to parse a file can be found @ http://jena.sourceforge.net/
    I have also added an example of how to create the parse below to create the ontology model.
    OntDocumentManager mgr = new OntDocumentManager("file:/[destination]/ont-policy.rdf");
    OntModelSpec s = new OntModelSpec(OntModelSpec.OWL_DL_MEM);
    s.setDocumentManager(mgr);
    OntModel m = ModelFactory.createOntologyModel(s, null);
    m.read("file:/" + [file to be read], null);Hope this helps

  • Parse log file using powershell

    Hi,
    Am pretty new to Powershell and would require anyone of your assistance in setting up a script which parse thru a log file and provide me output for my requirements below.
    I would like to parse the Main log file for Barra Aegis application(shown below) using powershell.
    Main log = C:\BARRALIN\barralin.log
    Model specific log = C:\BARRALIN\log\WG*.log
    Requirements :
    1. scroll to the bottom of the log file and look for name called "GL Daily" and see the latest date which in the example log below is "20150203"
    note : Name "GL Daily" and date keep changing in log file
    2. Once entry is found i would like to have a check to see all 3 entries PREPROCESS, TRANSFER, POSTPROCESS are sucess.
    3. If all 3 are success i would like to the script to identify the respective Model specific log number and print it out.
    E.g if you see the sample log below for "GL Daily", it is preceded by number "1718" hence script should append the model log path with "WG00" along with 1718, finally it should look something like this  C:\BARRALIN\log\WG001718.log.
    4. If all 3 items or anyone of them are in "failed" state then print the same log file info with WG001718.log
    Any help on this would be much appreciated.
    Thank You.
    Main log file :
    START BARRALINK            Check Auto Update                                                1716  
    43006  20150203 
        Trgt/Arch c:\barralin                                               
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  43105  20150203 
    START Aegis                GL Monthly                                                    
      1716   43117  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  44435  20150203
    START Aegis                UB Daily                                                    
      1717   43107  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  44435  20150203 
    START Aegis                GL Daily                                                    
        1718   44437  20150203 
        Trgt/Arch K:\barraeqr\aegis\qnt\gleqty                              
        PREPROCESS           success   0 preprocessor: no error                   
        TRANSFER             success   1 Host success: files received             
        POSTPROCESS          success   0 Postprocessor: no error                  
        CONFIRMATION         success   2 No Confirm needed                        
    STOP  50309  20150203 
     

    Hi All,
    I was writing a function in power shell to send email and i was looking to attach lines as and when required to the body of the email. but am not able to get this done..Here's my code
    Function Email ()
    $MailMessage = New-Object System.Net.Mail.MailMessage
    $SMTPClient = New-Object System.Net.Mail.SmtpClient -ArgumentList "mailhost.xxx.com"
    $Recipient = "[email protected]"
    If ($MessageBody -ne $null)
    $MessageBody = "The details of Barra $strsessionProduct model is listed below
    `rHostName : $localhost
    `r Model Run Date : $Date
    `r Model Data Date : $DateList1
    `r`n Click for full job log"+ "\\"+$localhost+"\E$\Local\Scripts\Logs "
    $MailMessage.Body = $MessageBody
    If ($Subject -ne $null) {
    $MailMessage.Subject = $Subject
    $Sender = "[email protected]"
    $MailMessage.Sender = $Sender
    $MailMessage.From = $Sender
    $MailMessage.to.Add($Recipient)
    If ($AttachmentFile -ne $null) { $MailMessage.Attachments.add($AttachmentFile)}
    $SMTPClient.Send($MailMessage)
    $Subject = "Hello"
    $AttachmentFile = ".\barralin.log"
    $MessageBody = "Add this line to Body of email along with existing"
    Email -Recipient "" -Subject $Subject -MessageBody $MessageBody -AttachmentFile $AttachmentFile
    as you can see before calling Email function i did add some lines to $MessageBody and was expecting that it would print the lines for $MessageBody in Email Function along with the new line. But thats not the case.
    I have tried to make $MessageBody as an Array and then add contents to array
    $MessageBody += "Add this line to Body of email along with existing"
    $MessageBody = $MessageBody | out-string
    Even this didnt work for me. Please suggest me any other means to get this done.
    THank You

  • Parser - CSV files to Oracle database

    Hello all,
    I wrote a csv parser that parse csv files to micorsoft access database. Now I need to parse the dataset to oracle database. This is part of my exporter class
    class MdbExporter : IExporter
    /// <summary>
    /// Exportiert das DataSet in eine Mdb-Datei.
    /// </summary>
    /// <param name="ds">Zu exportierendes DataSet.</param>
    public void Write(DataSet ds, string[] names)
    string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=" + names[0] + ";";
    Console.WriteLine("Exporting to database {0} ...", names[0]);
    Any ideas how can I do that?
    Thanks for any replay in advance.

    I wrote a parser that goes through several folders containing csv files, reads them and creates a dataset that contains 15 tables ( which I need for an intranet application after that). I succeed to write a MDB exporter that export this dataset to microsoft access database. Now I need an exporter that will export my dataset to ORACLE database. Below is the full code for my MDB exporter:
    public void Write(DataSet ds, string[] names)
    string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=" + names[0] + ";";
    Console.WriteLine("Exporting to database {0} ...", names[0]);
    DbConnection connection = new OleDbConnection(conStr);
    try
    connection.Open();
    catch (DbException e)
    ConsoleEx.WriteException(true, e, "Unable to open database: {0}", names[0]);
    throw;
    DbCommand command = connection.CreateCommand();
    foreach (DataTable table in ds.Tables)
    Console.WriteLine("\tDeleting table: {0}", table.TableName);
    // delete old tables
    command.CommandText = string.Format("drop table {0}", table.TableName);
    TryExecute(command, false);
    // create new
    Console.WriteLine("\tCreating new table: {0}", table.TableName);
    string[] columnStrings = new string[table.Columns.Count];
    for (int i = 0; i < table.Columns.Count; i++)
    columnStrings[i] = "`" + table.Columns.ColumnName + "`" + " varchar";
    command.CommandText = string.Format("create table {0} ({1})",
    table.TableName, string.Join(", \n", columnStrings));
    TryExecute(command, true);
    // add rows
    for (int row = 0; row < table.Rows.Count; row++)
    for (int col = 0; col < table.Columns.Count; col++)
    columnStrings[col] = "'" + Convert.ToString(table.Rows[row].ItemArray[col]) + "'";
    command.CommandText = string.Format("insert into {0} values ({1})",
    table.TableName, string.Join(", \n", columnStrings));
    TryExecute(command, true);
    connection.Close();
    I need similar exporter to Oracle database. Starting with SQL LOADER from the beginning its really not a good in my opinion since I am almost done with this approach.
    Any help would be appreciated.
    Regards,
    Sven

  • Parsing Larg files

    Has anyone tried parsing large XML files. I need parse a fiel
    about 70M+. When I try and parse this file I get
    java.io.UTFDataFormatException: Invalid UTF8 encoding
    When I break the file down into smaller size about 2M it has no
    problems. Also the sample data I am using was created using
    OracleXMLQuery. Anyone have the same problem, solutins,
    suggestions?
    Any help is appricated
    Thanks
    null

    I wasn't using any kind of encoding but I did have problems
    parsing large files with the DOMParser. It seemed that whenever
    you attempt to use a reader or InputSource, it would throw some
    error...I think it was arrayoutofbounds error. I used the
    following code, and it seemed to work:
    xmlDoc is a String of xml
    byte aByteArr [] = xmlDoc.getBytes();
    ByteArrayInputStream bais = new ByteArrayInputStream
    (aByteArr, 0, aByteArr.length);
    domParser.parse(bais);
    This also works if you use the URL version of .parse as well,
    but I am under the contraint of not being able to write out a
    file, so I need to use some kind of memory-based buffer.
    ByteArrayInputStream works for me. I think the reason this
    works is that the actual length of the stream is specified.
    Hope this helps.
    Dan
    Arpan (guest) wrote:
    : Has anyone tried parsing large XML files. I need parse a fiel
    : about 70M+. When I try and parse this file I get
    : java.io.UTFDataFormatException: Invalid UTF8 encoding
    : When I break the file down into smaller size about 2M it has
    no
    : problems. Also the sample data I am using was created using
    : OracleXMLQuery. Anyone have the same problem, solutins,
    : suggestions?
    : Any help is appricated
    : Thanks
    null

  • JMSException : Failed to parse descriptor file : npx BasicRuntimeDescriptor

    I'm trying to implement my first jms queue using Weblogic and Eclipse and get an error message when I try to create a topic connection.
    I have a "Oracle WebLogic Server 12c (12.1.1) at localhost [base_domain]" server running. I run the following code using Debug As >>Java Application.
    public static void main(String[] args) throws Exception {
         Hashtable<String,String> env = new Hashtable<String,String>();
         env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
         env.put(Context.PROVIDER_URL, "t3://localhost:7001");
         env.put("weblogic.jndi.createIntermediateContexts", "true");
         InitialContext ic = new InitialContext(env);
    TopicConnectionFactory tconFactory = (TopicConnectionFactory)
         PortableRemoteObject.narrow(ic.lookup("weblogic.jms.ConnectionFactory"),
         TopicConnectionFactory.class);
    TopicConnection tcon = tconFactory.createTopicConnection();
    The failure occurs when the last statement about is executed. Thanks in advance for your help.
    \====================================================================
    Exception in thread "main" weblogic.jms.common.JMSException: [JMSClientExceptions:055053]Error creating connection to the server: java.rmi.MarshalException: failed to marshal connectionCreateRequest(Lweblogic.jms.frontend.FEConnectionCreateRequest;); nested exception is:
         java.rmi.UnexpectedException: Failed to parse descriptor file; nested exception is:
         java.lang.NullPointerException.
         at weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:258)
         at weblogic.jms.client.JMSConnectionFactory.createConnectionInternal(JMSConnectionFactory.java:285)
         at weblogic.jms.client.JMSConnectionFactory.createTopicConnection(JMSConnectionFactory.java:184)
         at examples.jms.topic.TopicReceive.main(TopicReceive.java:121)
    Caused by: java.rmi.MarshalException: failed to marshal connectionCreateRequest(Lweblogic.jms.frontend.FEConnectionCreateRequest;); nested exception is:
         java.rmi.UnexpectedException: Failed to parse descriptor file; nested exception is:
         java.lang.NullPointerException
         at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:92)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:453)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:272)
         at weblogic.jms.frontend.FEConnectionFactoryImpl_1211_WLStub.connectionCreateRequest(Unknown Source)
         at weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:224)
         ... 3 more
    Caused by: java.rmi.UnexpectedException: Failed to parse descriptor file; nested exception is:
         java.lang.NullPointerException
         at weblogic.rmi.internal.DescriptorManager.createRuntimeDescriptor(DescriptorManager.java:114)
         at weblogic.rmi.internal.DescriptorManager.getBasicRuntimeDescriptor(DescriptorManager.java:85)
         at weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:51)
         at weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:37)
         at weblogic.rmi.internal.OIDManager.makeServerReference(OIDManager.java:194)
         at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:175)
         at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceSmartStubInfo(RemoteObjectReplacer.java:117)
         at weblogic.rmi.utils.io.RemoteObjectReplacer.replaceObject(RemoteObjectReplacer.java:103)
         at weblogic.rmi.utils.io.InteropObjectReplacer.replaceObject(InteropObjectReplacer.java:62)
         at weblogic.utils.io.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:39)
         at weblogic.utils.io.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:142)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1140)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
         at weblogic.messaging.dispatcher.DispatcherWrapper.writeExternal(DispatcherWrapper.java:156)
         at weblogic.jms.frontend.FEConnectionCreateRequest.writeExternal(FEConnectionCreateRequest.java:98)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1443)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1414)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:623)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObjectWL(MsgAbbrevOutputStream.java:614)
         at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:38)
         at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:88)
         ... 7 more
    Caused by: java.lang.NullPointerException
         at weblogic.rmi.internal.BasicRuntimeDescriptor.createSkeletonClass(BasicRuntimeDescriptor.java:271)
         at weblogic.rmi.internal.BasicRuntimeDescriptor.<init>(BasicRuntimeDescriptor.java:157)
         at weblogic.rmi.internal.BasicRuntimeDescriptor.<init>(BasicRuntimeDescriptor.java:139)
         at weblogic.rmi.internal.DescriptorManager.createRuntimeDescriptor(DescriptorManager.java:106)
         ... 29 more

    I found another thread which indicates explicitly including the JARs in the class path clears up this issue. I tried that and it looks like it is working.

  • XML parsing huge file

    Hi,
    I have a 36M XML file i need to parse, I'm new to XML.
    I usually get a 200K file in CSV format from most of my client that they transfer into there account i then simply update the MSSQL database with the CSV file at midnight on my server. But now i have 74 clients that are regroup and they send me 1 XML file.
    When i run it using the sample they gave me it works fine but on the 36M file i get a Jrun error then i found out that :
    <CFFile action="READ" variable="xmlfile" file="c:\mypath\#clientfile#.xml" charset="utf-8">
    <cfset xmlObj = xmlParse(#xmlfile#)>
    Doesnt work on big files because it runs out of memory.
    I need a way to parse that file using Java i downloaded xmlsax.js but i dont know how to use it to parse then get my parsed var back from it can anyone help me please.
    I got the file here :  http://xmljs.sourceforge.net/website/sampleApplications-sax.html
    Thank you

    In response to Owain Norths' comments about DOM parsing.
    I'm not sure if the memory issues are the fault of the DOM parsing method being used or if the problem is in how CF converts XML text into CF objects (arrays, structs) that the XML text represents.  It possible that the CF objects are responsible for using excessive amounts of memory.  Either way it sounds like CF's XML parsing capabilities aren't appropriate for larger (large being a relative term) XML files.
    It might be an interesting experiment to use third party Java components (such as Xerces2) to parse some XML files and see what the performance and memory usage look like.
    I will re-state my original advice.  The poster needs to import data from XML files into tables on MS SQL Server.  Bulk import tasks, such as from XML or CSV files, are generally better handled in MS SQL Server.  Some options include: a job that executes T-SQL, an Integration Services package, or the Bulk Copy Program (BCP) utility. 
    From: Owain North [email protected]
    Sent: Fri 11/12/2010 8:57 AM
    To:
    Subject: XML parsing huge file
    Couldn't agree more, and to be honest I can't believe this hasn't come up before. To me, the thought that something like CF should have to be bypassed when you get to files of a few megs is utterly ridiculous. I haven't looked into the different methods of parsing XML as it's really not my thing, but are we saying that DOM parsing is necessary for CF to be able to perform the functions it does on  the resulting XML object? Or does one create the same result, just through a different method?
    Owain North
    Code Monkey
    Titan Internet Ltd
    http://www.titaninternet.co.uk <http://www.titaninternet.co.uk/>
    Owain North is a mildly overweight computer programmer who likes to sit in the corner of a darkened room tapping away on his keyboard whilst wearing a massive set of headphones to avoid human contact where possible. He particularly likes to avoid natural light and salad.
    In his spare time he likes to pet his dog and work on his track car: http://www.306gti6.com/forum/showthread.php?id=124722&page=1
    The other day he went up to the toilets upstairs and there were no hand towels left! Bad times.
    It's Filthy Friday, so we all got Dominos for lunch. Large (obviously) half and half Mighty Meaty and American Hot. Good it was, especially as one of the other guys didn't want his garlic & herb dip = win.
    At the moment, he's having to look into WCF for a new project on  server monitoring. He doesn't know anything about it yet but after a  quick session on Amazon with the company credit card and some  extortionate delivery fees he's well on his way to writing his first WCF  service.
    In case you're interested - in the end, he just had to dry his hands on his jeans.

  • How to parse binary files

    Hi All,
    I have one binary file (abc.dat) file I want to parse that file and need it in text format.
    Can anyone tell me how can I achieve that? is there any third party tools available?
    lines are like below:
    00000000h: 76 04 00 01 00 FF 0F 11 FF 09 07 03 15 ; v....
    can anyone have idea how can i resolve this?
    Thanks!!!

    Hi
    thanks for reply...
    actually what I want is a line that I have posted in first conversation the whole file has lines like that. Now, I want to convert that file in to text format.
    right now I am reading lines with the below code...
    try{
                   FileInputStream fstream = new FileInputStream("test.dat");
                   DataInputStream in = new DataInputStream(fstream);
                   BufferedReader br = new BufferedReader(new InputStreamReader(in));
                   //BufferedInputStream bufferedInputStream = new BufferedInputStream(in);
                   String strLine;
    //               Read File Line By Line
                   while ((strLine = br.readLine()) != null) {
    //                Print the content on the console
                   System.out.println (strLine);
    //               Close the input stream
                   in.close();
                   }catch (Exception e){//Catch exception if any
                   System.err.println("Error: " + e.getMessage());
                   }and I don't get output in the text format.
    So, after doing this can anyone please tell me how can I get decoded format file?
    what are the next steps I should go?
    For, example we can go for (index.dat) file.
    Thanks!!!

  • Xml parser problem------file not found!  urgent!!!

    I have write some codes to parse a xml file like this :
    File xml=new File(xmlpath,frame.statusXMLofEachSequence);
    if(xml.exists()){
    System.out.println("xml..."+xml.getAbsolutePath());
    try {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    System.out.println("statusFile1 is.."+xml.getPath());
    ��������
    It's ok in JBuilder and JCreater, but when I run it in Dos , it throws an exception .
    Although I print the name of the xml file before to parse it and get the right name of the xml file, just like this:
    statuseFile1 is..F:/JavaDebug/user/dwsun/seq1/config.status.xml
    the exception as follows:
    org.xml.sax.SAXParseException: File "file:///F:/JavaDebug/config.status.xml" not found.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1014)
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:512)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:304)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:899)
    ���� ����
    why???
    Hope to get your helps!!!
    Thanks a lot!!!

    Please try the following code.
    import java.io.*;
    public class MyFile {
      public static void main(String args[]) {
        File file = new File(args[0]);
        System.out.println("File is " + file.getAbsolutePath());
        System.out.println("File is " + file.getPath());
    }ex)
    $ java MyFile MyFile.java
    File is /home/ikeda/work/java/forum/MyFile.java
    File is MyFile.java
    What FILE_PATH occured wrong print?

  • Trying to parse a file with SAX

    Hi All,
    I have some code which takes a XML DTD and parses it, writing information to System.out. Or it's meant to - I cannot get the parser to see the DTD file.
    The code is:
    public static void main (String[] args)
    try
    Class loadedClass = Class.forName("com.ibm.xml.parser.SAXDriver");
    Parser xParser = (Parser)loadedClass.newInstance();
    CatalogueReader cr = new CatalogueReader();
    xParser.setDocumentHandler(cr);
    xParser.setErrorHandler(cr);
    xParser.parse("catalogue1.txt");
    catch(Exception e)
    {System.out.println("Problem: " +e.getMessage());}
    which produces the following message:
    Problem: catalogue1.txt (The system cannot find the file specified)
    I have added the text file to the project and tried putting it in various folders without success.
    I've been stuuck on this for a day now and would appreciate a nudge in the right direction.
    Many thanks.

    You might try creating a separate class and putting all your code in that class's constructor and seeing if that works. (have main() instansiate that class in order to run the code). I try to avoid putting code that parses directly in main(). You can also add the following to your main() and / or class's constructor to see what directory its is running from:
              File file=new File("");
              System.out.println(file.getAbsolutePath());
    Lets say your catalogue1.txt file is two directories 'up' from the path given from getAbsolutePath() above, and one level down in a package called 'books', then this
    might work:
    xParser.parse("../../books/catalogue1.txt");
    or
    xParser.parse("././books/catalogue1.txt");

Maybe you are looking for