Listen for a file?

Hi, i am trying to implement a java program that processes a xml file in a virtual directory. I need to, some how, run a java program that listens for a xml file that is uploaded from one server to a virtual directory on another server where the code is listening. I don't really know where to start with the listening code, and needed some help in the general direction of how to do it. Also i was thinking that when a file is found it is processed using a new thread so that the main thread can carry on listening. Would this be feasible?

Is this more or less what you had in mind?import java.io.*;
public class Monitor1 extends Thread {
     private     static String path = "D:\\Ready";
     private static final int DELAY = 5000;               // 5 second delay
     public void run() {
          while(true) {
               try {
                    File f = new File(path);
                    File controls[] = f.listFiles();
                    for (int i=0; i<controls.length; i++) {
                         BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(controls)));
                         String s = "";
                         java.util.List al = new java.util.ArrayList();
                         while((s=br.readLine()) != null) {
                              al.add(s);
                         Thread c = new ProcessControl(al, path.substring(0, path.indexOf(File.separator)), controls[i].toString());
                         c.start();
                         al = null;
                         br.close();
                         controls[i].delete();
                    sleep(DELAY);
               catch (InterruptedException ie) {}
               catch (IOException ioe) {}
     public static void main(String[] args) {
/*     Sets the control file directory (if specified).               */
          if (args.length > 0) {
               path = args[0];
          Thread mon = new Monitor1();
          mon.start();
class ProcessControl extends Thread {
     private static final String fs = File.separator;
     private String[] values;
     private java.util.ListIterator li;
     private String drive = null;
     private java.util.List al;
     private String file;
     ProcessControl(java.util.List al, String drive, String file) {
          this.file = file;
          this.drive = drive;
          this.al = al;
          li = al.listIterator();
     public void run() {
values = new String[al.size()];
/*     Download the file to the server                                   */
          downloadFile();
     private void downloadFile() {
/*     Downloads the file using FTP protocol                         */
          String uid = "????????";
          String pswd = "????????";
          String server="host";
          try {
               sun.net.ftp.FtpClient client = new sun.net.ftp.FtpClient();
               client.openServer(server);
               client.login(uid, pswd);
               client.cd("path");
               sun.net.TelnetInputStream in = client.get("name of file to be retrieved");
               BufferedReader br = new BufferedReader(new InputStreamReader(in));
               String s;
               while((s=br.readLine()) != null) {
                    System.out.println(s);
               in.close();
          catch (IOException ioe) {
               ioe.printStackTrace();
Mark

Similar Messages

  • How to use download listener for xml files?

    Hi all,
    In my usecase I should write the xml contents to the file using Output Stream writer.
    As of now I am using the below lines of code in the download listener method.
    String s = myDoc.getContent().toString();
    w.write(s);
    myDoc is my xml document. I can see the file but there is no content.
    Kindly come out with your help in which I could achieve this.
    Thanks,
    Phani.

    Hi john,
    What all I am trying to ask is how could I write xml data to external file by clicking a button or a link etc.. which is in the JSF page.
    Now for that I created a button and dragged the <af:fileDownloadActionListener> into the button.
    I binded the listener with the backing bean method.
    public void sayHello(FacesContext context, OutputStream out) throws IOException
    OutputStreamWriter w = new OutputStreamWriter(out, "UTF-8");
    IDocument myDoc = new Document2004();
    myDoc.addEle("sai");
    w.write(myDoc.getContent().toString());
    w.flush();
    in the method you can see IDocument that is an interface which I have in the external JAR files that I am using to write data to MS Word.
    The myDoc which I created as an object of IDocument has lot of methods in which I am using addEle(String) which writes a string to word document.
    in the writer object writer I am getting the content of the myDoc inorder to convert that to string as it will be in xml format.
    When I am writing every thing I can download and save the document but unable to see the data that I have written that is "*sai*" instead a blank page is getting opened.
    When I do the same with Creating a file object in the local disc using File f = new File(path) rather than downloading it using the listener I can see the contents what I have written.
    This is what all I mean to ask. Kindly come up with your help
    Thanks,
    Phani.

  • Listener for Files?

    Hi
    is there a (kind of) Listener I can use to get notified when a File gets changed, i.e. when it's content is changed?
    Thanks for your help.

    I found an implementaion for such a kind of "File Listener" on the web. It's based on an interface and a class with inner class. Here's the linsting:
    public interface FileChangeListener
    public void fileChanged(String Filename);
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class FileMonitor
    private static final FileMonitor instance = new FileMonitor();
    private Timer timer;
    private Hashtable timerEntries;
    protected FileMonitor()
    // Create timer, run timer thread as daemon.
         timer = new Timer(true);
         timerEntries = new Hashtable();
    public static FileMonitor getInstance()
    return instance;
    /** Add a monitored file with a FileChangeListener.
    * @param listener listener to notify when the file changed.
    * @param fileName name of the file to monitor.
    * @param period polling period in milliseconds.
    public void addFileChangeListener(FileChangeListener listener, String fileName, long period) throws FileNotFoundException
    removeFileChangeListener(listener, fileName);
         FileMonitorTask task = new FileMonitorTask(listener, fileName);
         timerEntries.put(fileName + listener.hashCode(), task);
         timer.schedule(task, period, period);
    /** Remove the listener from the notification list.
    * @param listener the listener to be removed.
    public void removeFileChangeListener(FileChangeListener listener, String fileName)
    FileMonitorTask task = (FileMonitorTask) timerEntries.remove(fileName + listener.hashCode());
         if (task != null)
         task.cancel();
    protected void fireFileChangeEvent(FileChangeListener listener, String fileName)
         listener.fileChanged(fileName);
    class FileMonitorTask extends TimerTask
    FileChangeListener listener;
    String fileName;
    File monitoredFile;
         long lastModified;
    public FileMonitorTask(FileChangeListener listener, String fileName) throws FileNotFoundException
         this.listener = listener;
         this.fileName = fileName;
         this.lastModified = 0;
    monitoredFile = new File(fileName);
         if (!monitoredFile.exists())
    // but is it on CLASSPATH?
         URL fileURL = listener.getClass().getClassLoader().getResource(fileName);
              if (fileURL != null)
              monitoredFile = new File(fileURL.getFile());
              else
              throw new FileNotFoundException("File Not Found: " + fileName);
         this.lastModified = monitoredFile.lastModified();
    public void run()
         long lastModified = monitoredFile.lastModified();
         if (lastModified != this.lastModified)
         this.lastModified = lastModified;
              fireFileChangeEvent(this.listener, this.fileName);

  • How to configure multiple listeners to listen for the same instance.

    Hello everyone,
    I am running oracle database 11g and I want information regarding how to configure multiple listeners to listen for the same database instance. Actually I know how to configure more than one listener but the main thing that I am confused about is when we create listener.ora file, do we have to statically register the database instance with both the listeners or the instance will register itself with both the listeners.
    According to my knowledge the instance will register with the listener specified by LOCAL_LISTENER parameter and we cannot have more than one value for this parameter.
    Please only give detailed answers with example as I am tired of simple answers with details that I already know.

    Hello,
    Yes, it can make sense to have several listener for one Oracle instance. For instance you may have one listener for the applications another listener for DBA administration tasks as well as one listener dedicated to dataguard broker. It is not possible to have several listeners listening on the same IP and Port.
    By default the database try to automatically register to a listener on port 1521. To instruct the instance to register to a specifc list of listeners you can add in the init.ora the local_listener parameter with an alias definition:
    i.e
    local_listener=MY_SET_OFF_LISTENERS
    in your tnsname.ora add an entry called:
    MY_SET_OFF_LISTENERS_LOCAL= (ADDRESS_LIST=
    (ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1530))
    (ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1531))
    (ADRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1532))
    In this sample your instance will register to three listeners listening on respectively port 1530, 1531 and 1532
    If you want your clients can be balanced over the 3 listeners

  • Huge performance differences between a map listener for a key and filter

    Hi all,
    I wanted to test different kind of map listener available in Coherence 3.3.1 as I would like to use it as an event bus. The result was that I found huge performance differences between them. In my use case, I have data which are time stamped so the full key of the data is the key which identifies its type and the time stamp. Unfortunately, when I had my map listener to the cache, I only know the type id but not the time stamp, thus I cannot add a listener for a key but for a filter which will test the value of the type id. When I launch my test, I got terrible performance results then I tried a listener for a key which gave me much better results but in my case I cannot use it.
    Here are my results with a Dual Core of 2.13 GHz
    1) Map Listener for a Filter
    a) No Index
    Create (data always added, the key is composed by the type id and the time stamp)
    Cache.put
    Test 1: Total 42094 millis, Avg 1052, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 2: Total 43860 millis, Avg 1096, Total Tries 40, Cache Size 80000
    Update (data added then updated, the key is only composed by the type id)
    Cache.put
    Test 3: Total 56390 millis, Avg 1409, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 4: Total 51734 millis, Avg 1293, Total Tries 40, Cache Size 2000
    b) With Index
    Cache.put
    Test 5: Total 39594 millis, Avg 989, Total Tries 40, Cache Size 80000
    Cache.putAll
    Test 6: Total 43313 millis, Avg 1082, Total Tries 40, Cache Size 80000
    Update
    Cache.put
    Test 7: Total 55390 millis, Avg 1384, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 8: Total 51328 millis, Avg 1283, Total Tries 40, Cache Size 2000
    2) Map Listener for a Key
    Update
    Cache.put
    Test 9: Total 3937 millis, Avg 98, Total Tries 40, Cache Size 2000
    Cache.putAll
    Test 10: Total 1078 millis, Avg 26, Total Tries 40, Cache Size 2000
    Please help me to find what is wrong with my code because for now it is unusable.
    Best Regards,
    Nicolas
    Here is my code
    import java.io.DataInput;
    import java.io.DataOutput;
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
    import com.tangosol.io.ExternalizableLite;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.util.Filter;
    import com.tangosol.util.MapEvent;
    import com.tangosol.util.MapListener;
    import com.tangosol.util.extractor.ReflectionExtractor;
    import com.tangosol.util.filter.EqualsFilter;
    import com.tangosol.util.filter.MapEventFilter;
    public class TestFilter {
          * To run a specific test, just launch the program with one parameter which
          * is the test index
         public static void main(String[] args) {
              if (args.length != 1) {
                   System.out.println("Usage : java TestFilter 1-10|all");
                   System.exit(1);
              final String arg = args[0];
              if (arg.endsWith("all")) {
                   for (int i = 1; i <= 10; i++) {
                        test(i);
              } else {
                   final int testIndex = Integer.parseInt(args[0]);
                   if (testIndex < 1 || testIndex > 10) {
                        System.out.println("Usage : java TestFilter 1-10|all");
                        System.exit(1);               
                   test(testIndex);               
         @SuppressWarnings("unchecked")
         private static void test(int testIndex) {
              final NamedCache cache = CacheFactory.getCache("test-cache");
              final int totalObjects = 2000;
              final int totalTries = 40;
              if (testIndex >= 5 && testIndex <= 8) {
                   // Add index
                   cache.addIndex(new ReflectionExtractor("getKey"), false, null);               
              // Add listeners
              for (int i = 0; i < totalObjects; i++) {
                   final MapListener listener = new SimpleMapListener();
                   if (testIndex < 9) {
                        // Listen to data with a given filter
                        final Filter filter = new EqualsFilter("getKey", i);
                        cache.addMapListener(listener, new MapEventFilter(filter), false);                    
                   } else {
                        // Listen to data with a given key
                        cache.addMapListener(listener, new TestObjectSimple(i), false);                    
              // Load data
              long time = System.currentTimeMillis();
              for (int iTry = 0; iTry < totalTries; iTry++) {
                   final long currentTime = System.currentTimeMillis();
                   final Map<Object, Object> buffer = new HashMap<Object, Object>(totalObjects);
                   for (int i = 0; i < totalObjects; i++) {               
                        final Object obj;
                        if (testIndex == 1 || testIndex == 2 || testIndex == 5 || testIndex == 6) {
                             // Create data with key with time stamp
                             obj = new TestObjectComplete(i, currentTime);
                        } else {
                             // Create data with key without time stamp
                             obj = new TestObjectSimple(i);
                        if ((testIndex & 1) == 1) {
                             // Load data directly into the cache
                             cache.put(obj, obj);                         
                        } else {
                             // Load data into a buffer first
                             buffer.put(obj, obj);                         
                   if (!buffer.isEmpty()) {
                        cache.putAll(buffer);                    
              time = System.currentTimeMillis() - time;
              System.out.println("Test " + testIndex + ": Total " + time + " millis, Avg " + (time / totalTries) + ", Total Tries " + totalTries + ", Cache Size " + cache.size());
              cache.destroy();
         public static class SimpleMapListener implements MapListener {
              public void entryDeleted(MapEvent evt) {}
              public void entryInserted(MapEvent evt) {}
              public void entryUpdated(MapEvent evt) {}
         public static class TestObjectComplete implements ExternalizableLite {
              private static final long serialVersionUID = -400722070328560360L;
              private int key;
              private long time;
              public TestObjectComplete() {}          
              public TestObjectComplete(int key, long time) {
                   this.key = key;
                   this.time = time;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
                   this.time = in.readLong();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
                   out.writeLong(time);
         public static class TestObjectSimple implements ExternalizableLite {
              private static final long serialVersionUID = 6154040491849669837L;
              private int key;
              public TestObjectSimple() {}          
              public TestObjectSimple(int key) {
                   this.key = key;
              public int getKey() {
                   return key;
              public void readExternal(DataInput in) throws IOException {
                   this.key = in.readInt();
              public void writeExternal(DataOutput out) throws IOException {
                   out.writeInt(key);
              public int hashCode() {
                   return key;
              public boolean equals(Object o) {
                   return o instanceof TestObjectSimple && key == ((TestObjectSimple) o).key;
    }Here is my coherence config file
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>test-cache</cache-name>
                   <scheme-name>default-distributed</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>          
              <distributed-scheme>
                   <scheme-name>default-distributed</scheme-name>
                   <backing-map-scheme>
                        <class-scheme>
                             <scheme-ref>default-backing-map</scheme-ref>
                        </class-scheme>
                   </backing-map-scheme>
              </distributed-scheme>
              <class-scheme>
                   <scheme-name>default-backing-map</scheme-name>
                   <class-name>com.tangosol.util.SafeHashMap</class-name>
              </class-scheme>
         </caching-schemes>
    </cache-config>Message was edited by:
    user620763

    Hi Robert,
    Indeed, only the Filter.evaluate(Object obj)
    method is invoked, but the object passed to it is a
    MapEvent.<< In fact, I do not need to implement EntryFilter to
    get a MapEvent, I could get the same result (in my
    last message) by writting
    cache.addMapListener(listener, filter,
    true)instead of
    cache.addMapListener(listener, new
    MapEventFilter(filter) filter, true)
    I believe, when the MapEventFilter delegates to your filter it always passes a value object to your filter (old or new), meaning a value will be deserialized.
    If you instead used your own filter, you could avoid deserializing the value which usually is much larger, and go to only the key object. This would of course only be noticeable if you indeed used a much heavier cached value class.
    The hashCode() and equals() does not matter on
    the filter class<< I'm not so sure since I noticed that these methods
    were implemented in the EqualsFilter class, that they
    are called at runtime and that the performance
    results are better when you add them
    That interests me... In what circumstances did you see them invoked? On the storage node before sending an event, or upon registering a filtered listener?
    If the second, then I guess the listeners are stored in a hash-based map of collections keyed by a filter, and indeed that might be relevant as in that case it will cause less passes on the filter for multiple listeners with an equalling filter.
    DataOutput.writeInt(int) writes 4 bytes.
    ExternalizableHelper.writeInt(DataOutput, int) writes
    1-5 bytes (or 1-6?), with numbers with small absolute
    values consuming less bytes.Similar differences exist
    for the long type as well, but your stamp attribute
    probably will be a large number...<< I tried it but in my use case, I got the same
    results. I guess that it must be interesting, if I
    serialiaze/deserialiaze many more objects.
    Also, if Coherence serializes an
    ExternalizableLite object, it writes out its
    class-name (except if it is a Coherence XmlBean). If
    you define your key as an XmlBean, and add your class
    into the classname cache configuration in
    ExternalizableHelper.xml, then instead of the
    classname, only an int will be written. This way you
    can spare a large percentage of bandwidth consumed by
    transferring your key instance as it has only a small
    number of attributes. For the value object, it might
    or might not be so relevant, considering that it will
    probably contain many more attributes. However, in
    case of a lite event, the value is not transferred at
    all.<< I tried it too and in my use case, I noticed that
    we get objects nearly twice lighter than an
    ExternalizableLite object but it's slower to get
    them. But it is very intersting to keep in mind, if
    we would like to reduce the network traffic.
    Yes, these are minor differences at the moment.
    As for the performance of XMLBean, it is a hack, but you might try overriding the readExternal/writeExternal method with your own usual ExternalizableLite implementation stuff. That way you get the advantages of the xmlbean classname cache, and avoid its reflection-based operation, at the cost of having to extend XMLBean.
    Also, sooner or later the TCMP protocol and the distributed cache storages will also support using PortableObject as a transmission format, which enables using your own classname resolution and allow you to omit the classname from your objects. Unfortunately, I don't know when it will be implemented.
    >
    But finally, I guess that I found the best solution
    for my specific use case which is to use a map
    listener for a key which has no time stamp, but since
    the time stamp is never null, I had just to check
    properly the time stamp in the equals method.
    I would still recommend to use a separate key class, use a custom filter which accesses only the key and not the value, and if possible register a lite listener instead of a heavy one. Try it with a much heavier cached value class where the differences are more pronounced.
    Best regards,
    Robert

  • On starting WebLogic getting Error : Listening for transport dt_socket at address: 8453 Exception in thread "main" java.lang.NoClassDefFoundError: vXmx512m

    Hi,
    system i am using for Oracle SOA is :
    Windows 64 Bit
    i5 Processor
    6 GB RAM
    29 GB on C Drive is already free after installation of all SOA related products.
    I have installed wlserver_10.3 for SOA 11g Development purpose and followed exact installation sequence and procedure as mention in oracle documentation
    i created domain also and every thing look correct but after installation procedure there are "Additional actions required just after every thing installed" :
    setting memory limit
    starting weblogic server (Admin Server)
    starting weblogic managed server
    and so on
    now Problem is when i execute C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin startWebLogic.cmd
    as mention in oracle documentation i am getting following error message : (i have only included last error lines instead of complete console log)
    oConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\
    sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_oepe180\profiles\default\syse
    xt_manifest_classpath;C:\Oracle\MIDDLE~1\patch_ocp371\profiles\default\sysext_ma
    nifest_classpath;C:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manif
    est_classpath  weblogic.Server
    Listening for transport dt_socket at address: 8453
    Exception in thread "main" java.lang.NoClassDefFoundError: vXmx512m
    Caused by: java.lang.ClassNotFoundException: vXmx512m
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    Could not find the main class: ++Xmx512m.  Program will exit.
    Now to resolve this what i already tried are :
    I change JAVA_HOME and PATH to jdk6 which came with web logic installer
    Location is at :
    JAVA_HOME : C:\Oracle\Middleware\jdk160_29
    PATH : C:\Oracle\Middleware\jdk160_29\bin
    The above dose not include any space between path
    I ran the startWebLogic.cmd and got same error
    After that I also added
    CLASSPATH : C:\Oracle\Middleware\jdk160_29\lib\tool.jar;C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;C:\Oracle\Middleware\jdk160_29\bin
    WL_HOME:  C:\Oracle\Middleware\wlserver_10.3
    I ran the startWebLogic.cmd and got same error
    I also used earlier path which I used with eclipse when I was working on other java development.
    JAVA_HOME : C:\Program Files\Java\jdk1.7.0_21
    PATH : C:\Program Files\Java\jdk1.7.0_21\bin
    I ran the startWebLogic.cmd and got same error
    Then I also gave PATH: C:\Oracle\Middleware\wlserver_10.3\server\lib      (including the existing one using ; )
    I ran the startWebLogic.cmd and got same error
    Now may be there is a file called setSOADomainEnv.cmd in
    < C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin\ setSOADomainEnv.cmd>
    That include some values for memory set :
    set JAVA_OPTIONS=%JAVA_OPTIONS%
    set DEFAULT_MEM_ARGS=-Xms512m –Xmx512m
    set PORT_MEM_ARGS=-Xms512m –Xmx768m
    if "%JAVA_VENDOR%" == "Oracle" goto OracleJVM
    set DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=128m -XX:MaxPermSize=768m
    set PORT_MEM_ARGS=%PORT_MEM_ARGS% -XX:PermSize=256m -XX:MaxPermSize=768m
    now as I change the red highlighted value to 512 value because I have less memory resource and I checked in installation documentation to change the above red highlighted value to 512 original is 1024 which is too high and it was crating problem and showing memory space problem so I change it to 512 and now I am not getting that memory space problem error but may be the above error is related with change value in setSOADomainEnv.cmd file or not
    Following are my domain, weblogic and soa home directory path and all these path are exactly what it suppose to be according to Oracle Installation Documentation:
    WebLogic :
    C:\Oracle\Middleware\wlserver_10.3
    C:\Oracle\Middleware\coherence_3.7
    C:\Oracle\Middleware\oepe_11.1.1.8.0
    SOA Oracle Home Directory :
    C:\Oracle\Middleware\Oracle_SOA1
    OSB Home Location :
    C:\Oracle\Middleware\Oracle_OSB1
    Domain name : soa_div_domain
    Domain Location :       C:\Oracle\Middleware\user_projects\domains
    Application Location :  C:\Oracle\Middleware\user_projects\applications
    Domain Location:        C:\Oracle\Middleware\user_projects\domains\soa_div_domain
    form here i am trying to start weblogic : C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin\startWebLogic.cmd
    Please tell me any body want more details.
    Thanks.

    I think you are missing a character '-'
    USER_MEM_ARGS="Xms512m -Xmx512m -XX:MaxPermSize=128m"Add this character like follows
    "-Xms512m -Xmx512m -XX:MaxPermSize=128m"

  • ORA-27078: unable to determine limit for open files

    I installed Oracle XE on my Gengoooraclexe@ghost ~ $ lsnrctl
    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-JUN-2011 16:51:29
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Welcome to LSNRCTL, type "help" for information.
    LSNRCTL> status
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    Start Date 25-JUN-2011 10:03:30
    Uptime 0 days 6 hr. 48 min. 1 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
    Listener Log File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ghost.emacs.com)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LSNRCTL>
    Poraclexe@ghost ~ $ sqlplus "/as sysdba"
    SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jun 25 07:19:58 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to an idle instance.
    SQL> show user
    USER is "SYS"
    SQL> startup
    ORA-27078: unable to determine limit for open files
    Linux Error: 1: Operation not permitted
    Additional information: 1
    Additional information: 1
    Additional information: -2958340
    SQL> startup force
    ORA-27078: unable to determine limit for open files
    Linux Error: 1: Operation not permitted
    Additional information: 1
    Additional information: 1
    Additional information: -3378372
    SQL> startup
    ORA-03113: end-of-file on communication channel
    SQL> exit
    Disconnected

    unable to determine limit for open filessee http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm#BABJFAIA
    Is that a debian flavored distro?

  • Adcfgclone.pl dbTechStack on Target DB removes listener and tnsnames files

    Hello:
    I am doing a first-time clone from my PRD to my TST instance, and have undergone the following steps:
    1. perl adpreclone.pl dbTier on Source DB
    2. perl adpreclone.pl appsTier on Source AppTier
    3. Copy APPL_TOP, COMMON_TOP, ORACLE_HOME, IAS_ORACLE_HOME from Source AppTier to Target AppTier.
    4. Run perl adcfgclone.pl dbTechStack on Target DB.
    At this point is where I start running into issues. The dbTechStack deletes/recreates the tnsnames.ora, sqlnet.ora, and listener.ora files, and the DB can no longer startup. The below is in the logfiles. Am I doing something wrong? I guess the issue is not so much with it deleting/recreating the files, as it is with the values it puts into the files (i.e. DB port = 3001)
    Executing Technology Stack Configuration...
    Executing runAutoConfig...
    Deleting files of type INSTALL
    Checking for file: /u01/oracle/WMSTST/db/tech_st/11.1.0/network/admin/WMSTST_x07tst00/sqlnet.ora
    File exists
    File deleted
    Processing driver file: /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/template/addbtmpl.drv
    Checking for file: /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/install/WMSTST_x07tst00/txkConfigDbOcm.pl
    File exists
    File deleted
    Checking for file: /u01/oracle/WMSTST/db/tech_st/11.1.0/dbs/initWMSTST.ora
    File exists
    File deleted
    Checking for file: /u01/oracle/WMSTST/db/tech_st/11.1.0/network/admin/WMSTST_x07tst00/listener.ora
    File exists
    File deleted
    Checking for file: /u01/oracle/WMSTST/db/tech_st/11.1.0/network/admin/WMSTST_x07tst00/tnsnames.ora
    File exists
    File deleted
    Testing for RAC specific parameters before running autoconfig
    No RAC specific parameters were found, running with CVM
    Starting CVM in INSTE8_SETUP mode
         Using Context file : /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/WMSTST_x07tst00.xml
    Attempting to create a back up of the Context file
    Created back up file of name :
    /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/out/WMSTST_x07tst00/12111155/WMSTST_x07tst00.xml
    ===========================================================================
    Starting synchronization of file system Context file and its templates with those in the database
    Database connection : Failed
    OAM Context editing support feature: Unverified
    OAM Customization support feature : Unverified
    File system template : /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/template/adxdbctx.tmp
    Checking for customizations to Context template
    Warning: Unable to connect to Database.
    If the system is OAM enabled, this may result in loss of customizations.
    Looking for custom template at : /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/template/custom/adxdbctx.tmp
    Custom template : Not available
    Customizations found : None
    File system Context file :/u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/WMSTST_x07tst00.xml
    Checking the Context file for possible updates from the Database
    Warning: Unable to connect to Database.
    If the system is OAM enabled, this may result in loss of customizations and the Context files in DataBase and in the file system may be unsynchronized
    Thanks!
    Edited by: user4434301 on Dec 11, 2012 12:39 PM

    Excellent. I copied the template file from another instance and the following messages were at the end of the logfile:
    Skipping Profile Phase
    Skipping Apply Phase
    Completed runAutoConfig...
    ApplyDBTechStack Completed Successfully.
    However I'm not completely certain this is entirely correct preclone. Can you tell me why the Profile and Apply Phases were skipped and why the following was displayed upon the screen on completion?
    Completed Apply...
    Tue Dec 18 11:25:39 2012
    Starting database listener for WMSTST:
    Running:
    /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/scripts/WMSTST_x07tst00/addlnctl.sh start WMSTST
    Logfile: /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/log/WMSTST_x07tst00/addlnctl.txt
    You are running addlnctl.sh version 120.1.12010000.4
    Starting listener process WMSTST ...
    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 18-DEC-2012 11:25:39
    Copyright (c) 1991, 2008, Oracle. All rights reserved.
    Starting /u01/oracle/WMSTST/db/tech_st/11.1.0/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 11.1.0.7.0 - Production
    System parameter file is /u01/oracle/WMSTST/db/tech_st/11.1.0/network/admin/WMSTST_x07tst00/listener.ora
    Log messages written to /u01/oracle/WMSTST/db/tech_st/11.1.0/log/diag/tnslsnr/x07tst00/wmstst/alert/log.xml
    TNS-01151: Missing listener name, WMSTST, in LISTENER.ORA
    Listener failed to start. See the error message(s) above...
    addlnctl.sh: exiting with status 1
    addlnctl.sh: check the logfile /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/log/WMSTST_x07tst00/addlnctl.txt for more information ...
    That file shows the following:
    Starting database listener for WMSTST:
    Running:
    /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/scripts/WMSTST_x07tst00/addlnctl.sh start WMSTST
    Logfile: /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/log/WMSTST_x07tst00/addlnctl.txt
    You are running addlnctl.sh version 120.1.12010000.4
    Starting listener process WMSTST ...
    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 18-DEC-2012 11:25:39
    Copyright (c) 1991, 2008, Oracle. All rights reserved.
    Starting /u01/oracle/WMSTST/db/tech_st/11.1.0/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 11.1.0.7.0 - Production
    System parameter file is /u01/oracle/WMSTST/db/tech_st/11.1.0/network/admin/WMSTST_x07tst00/listener.ora
    Log messages written to /u01/oracle/WMSTST/db/tech_st/11.1.0/log/diag/tnslsnr/x07tst00/wmstst/alert/log.xml
    TNS-01151: Missing listener name, WMSTST, in LISTENER.ORA
    Listener failed to start. See the error message(s) above...
    addlnctl.sh: exiting with status 1
    addlnctl.sh: check the logfile /u01/oracle/WMSTST/db/tech_st/11.1.0/appsutil/log/WMSTST_x07tst00/addlnctl.txt for more information ...
    Should I have stopped the DB or listener before running the script?
    Edited by: user4434301 on Dec 18, 2012 9:18 AM

  • SD to USB adapter for MP3 Files

    I don't have USB port in my car but two SD slots whic allow to listen to MP3 files via car sound system. Please advise what kind of SD-USB adapter could be used for this purpose.

    Another option is an FM transmitter, Amazon sells lots of them: http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Delectronics&field-keyw ords=ipod+fm&x=0&y=0#/ref=nb_sb_noss?url=search-alias%3Delectronics&field-keywor ds=iphone+fm&rh=n%3A172282%2Ck%3Aiphone+fm
    My brother uses one, it's pretty good, but he has to switch frequencies every now and then to avoid interference.

  • Port of the TNS Listener for the second SAP system

    Hello!
    I had problems during the installation of the second SAP system with second Oracle DB on the same host (OP is SOLARIS).
    The error occurs was faced with TNS Listener.
    (> error: TNS Listener is started)
    Which settings are applied for the TNS Listener per default in SAPINST?
    (e.g. on the same port)
    Which settings should I apply in SAPINST for TNS Listener, e.g. configure an another port?
    Thank you very much!
    regards
    Thom

    Hello!
    Thank you very much!
    Even that is the question.
    1) If I have selected "ok" during the installation and no further values selected, will SAPINST check whether the Port 1527 is allocated by the first SAP System and create the second Port 1528?
    2) Do I have one TNS Listener with two file entries or two TNS Listener?
    Thank you very much!
    regards
    Thom

  • How can I Listen to the File changes?

    Hi all,
    I am confused in this problem.
    How can I make my program listen to the changes in a file. File is not opened in java program, but it is a outside file.
    User is not concerned with java program. User opens a file by double clicking and changes something in file. I want to make my java program listen to the file.So program keeps running. So whenever user changes data in that file, my java program should be notified.
    Please help me.
    Thanks

    I guess there are a couple of options.
    The full-java version is writing an application that opens said file every n seconds on a timer, and compares it against a cache for changes.
    Option two is jni.

  • What is a listener for/ especially in struts + tomcat + hibernate

    some example code sugguested that we should create a listener for the hibernate connection. i stil dont get it. anyone can explain this?

    The listener is the product that allows APEX to communicate with the App Server.. The supported App servers are WebLogic & GlassFish (for version 2.x of the listner, version 1.x allows the usage of Tomcat and OC4J)..
    In the prior database/app server setup you would use the HTTP server (Apache) with a mod called Mod_plsql to communicate between the app server and the database.
    With the APEX Listener 2.x you can use it to host RESTful web-services and allow your APEX apps to import Excel workbooks directly and also print PDF files similar to FOP.
    You really Can't share session state with other apps.. Why exactly would you want to do this??
    Re: Run java applets in APEX, No you can run them in the app server.. Apex can work with Oracle EBS, there is a posted whitepaper on this from Oracle:
    http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-ebs-extension-white-paper-345780.pdf
    Thank you,
    Tony Miller
    SmartDog Services
    Austin, TX

  • Problem listening for a customevent question

    I'm new to WLP and trying to setup a portlet to listen for a custom event.
    I'm using WLP 10.3.2 with two portlets on a page. Portlet 'A' fires a custom event when it is maximized. I verified the event is getting fired. Portlet 'B' is listening for my 'TestEvent' and should display a message if it receives the event. However portlet 'B' never receives the event. Portlet 'B' is a JSP portlet. Below is the code used to fire the event from portlet 'A', and the code from the 'B' portlet .portlet file. Can anyone tell me why portlet 'B' does not receive the event?
    thanks
    PORTLET A CODE TO FIRE EVENT:
    public void fireTestEvent(HttpServletRequest request,
                   HttpServletResponse response, Event event) {
              System.out.println("prepairing to fireTestEvent");
              PortletBackingContext context = PortletBackingContext.getPortletBackingContext(request);     
              context.fireCustomEvent("TestEvent", "test message");
              System.out.println("fired TestEvent");          
    PORTLET B CODE FROM .portlet file
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
    <netuix:portlet backingFile="backing.Listening" definitionLabel="bPortlet" title="Bportlet">
    <netuix:handlePortalEvent event="onMinimize" eventLabel="handlePortalEvent1"
    fromSelfInstanceOnly="false" onlyIfDisplayed="true" sourceDefinitionLabels="aPortlet">
    <netuix:invokeBackingFileMethod method="handlePortalEvent"/>
    </netuix:handlePortalEvent>
    <netuix:handleCustomEvent event="TestEvent" eventLabel="handleCustomEvent1"
    fromSelfInstanceOnly="false" onlyIfDisplayed="true" sourceDefinitionLabels="aPortlet">
    <netuix:invokeBackingFileMethod method="handleTestEvent"/>
    </netuix:handleCustomEvent>
    <netuix:titlebar>
    <netuix:maximize/>
    <netuix:minimize/>
    </netuix:titlebar>
    <netuix:content>
    <netuix:jspContent contentUri="/portlets/bPortlet.jsp"/>
    </netuix:content>
    </netuix:portlet>
    </portal:root>

    I figured out the issue. Portlet B only listens for the event if it is visible. The event gets fired when portlet A is maximized, so portlet B is no longer visible.
    thanks

  • Listening for HttpURLConnections ?

    hi,
    I have implemented a client opening a HttpURLConnection to send an image to a servlet.
    I would like to know how should be the code on the server, listening for httpURLconnections... can you give me some tip ?
    Here is the client code... What I need is the server code... I want to save the file to hard disk, when a post is performed.
    thanks
    URL url;
              HttpURLConnection connection = null;
              try {;
                   //Create connection
                   url = new URL("http://localhost:8080/Sender");
                   connection = (HttpURLConnection)url.openConnection();
                   connection.setRequestMethod("POST");
                   connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                   connection.setRequestProperty("Connection","Keep-Alive");
                   connection.setUseCaches (false);
                   connection.setDoInput(true);
                   connection.setDoOutput(true);
                   connection.connect();
                   //Send request
                   DataOutputStream dataStream = new DataOutputStream (connection.getOutputStream());
                   File uploadFile = new File("../toSend/file.png");
                   FileInputStream fileInputStream = new FileInputStream(uploadFile);
                   try
                   // create a buffer of maximum size
    int bytesAvailable = fileInputStream.available();
    int maxBufferSize = 1024;
    int bufferSize = Math.min(bytesAvailable, maxBufferSize);
    byte[] buffer = new byte[bufferSize];
    // read file and write it into form...
    int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
    while (bytesRead > 0)
    dataStream.write(buffer, 0, bufferSize);
    bytesAvailable = fileInputStream.available();
    bufferSize = Math.min(bytesAvailable, maxBufferSize);
    bytesRead = fileInputStream.read(buffer, 0, bufferSize);
    // closing CRLF
    dataStream.writeBytes("\r\n");
              catch(Exception e)
              System.out.println("Exception: " + e.getMessage());
                   //dataStream.writeBytes(urlParameters);
                   dataStream.flush ();
                   dataStream.close ();
    Edited by: aneuryzma on Jan 7, 2010 8:28 PM

    aneuryzma wrote:
    hi,
    I have implemented a client opening a HttpURLConnection to send an image to a servlet.
    I would like to know how should be the code on the server, listening for httpURLconnections... can you give me some tip ?
    Here is the client code... What I need is the server code... I want to save the file to hard disk, when a post is performed.And you want to use a servlet to do that? Then your google keywords are "file upload servlet". I recommend the links which recommend using Apache software in your servlet.

  • Listening for an event outside of the object...

    Hey, I spent a lot of my day trying to figure out how to
    listen for an event outside of an instantiated object of my own.
    I made my own class called
    Link. When my Link class is instantiated, a Loader object
    (var loader:Loader) is added and it loads a user-specified external
    PNG file. I want to track the Event.COMPLETE event OUTSIDE of my
    Link class, like in my FLA's Actionscript.
    So, I tried a few things without any luck, and by these you
    might get the idea of exactly what I'm trying to do:
    var link1:Link = new Link(...);
    link1.loader.addEventListener(Event.COMPLETE, handler);
    That didn't work, so I tried:
    var link1.Link = new Link(...);
    var loader = link1.getChildByName("loader") as Loader;
    loader.addEventListener(Event.COMPLETE, handler);
    ... that didn't work either. :(
    Any ideas?
    If I am taking the completely wrong approach please do let me
    know. If there's ANY way to know WHEN my loader has completed
    loading its image outside of my Link class...
    Thanks!
    ~ Andrew Merskin

    Let your Link class handle the Loader events. When
    Event.COMPLETE fires,
    just redispatch the event or dispatch a custom event.
    Example 1:
    link1.addEventListener("ALLDONELOADING", linkEventHandler);
    function linkEventHandler(event:Event)
    if(event.type == "ALLDONELOADING")
    // do something or nothing at all
    // Inside your link class you are listening for the load
    complete
    function loadCompleteHandler(event:Event)
    dispatchEvent(new Event("ALLDONELOADING")));
    Example 2:
    link1.addEventListener(Event.COMPLETE, linkEventHandler);
    function linkEventHandler(event:Event)
    if(event.type == Event.COMPLETE)
    // do something or nothing at all
    // Inside your link class you are listening for the load
    complete
    function loadCompleteHandler(event:Event)
    dispatchEvent(event);

Maybe you are looking for

  • Problem - C++ Compiler Installation on Solaris

    Hello: I am facing the following Software installation Problem. Any recomendations/tips ?? thanks, Salman. PIONEER DATA SYSTEMS, INC. E-mail: [email protected] Description: Space Available on the machine. Output of df -k command $ df -k Filesystem kb

  • N95 PC Suite 7.1 Image store issue

    I have upgraded my PC suite to 7.1 for my N95. Now when I tried to transfer photos and videos from Phone to PC using Store Images option, it says the status as all images and videos in the phone are new as if no photos/videos are ever transferred. It

  • ISA sales order -  org determination question

    Hello All, We have sales orders being created in CRM just fine using SAP GUI. The transaction type has a specific Org profile attached which has rule to determine the org unit, sales area, office, group based on sold to party's location. Now for the

  • Maxl Command to delete a dimension from a outline

    Hi All, What is the maxl command to delete a dimension from a outline. Thanks, Ram..

  • Preview and capture video

    Hi, I'm fairly new to Java and I just came accross JMF. I'm interested in creating an application that displays a live preview (upto 25fps) from a webcam (connected to a windows machine) and previews live audio from the mic. Below the video preview I