Is it a path problem, or what is it?? Please...

Hi every one! I am just trying to open a Serial Port
This is my code
package demo2;
* Titre :
* Description :
* Copyright : Copyright (c) 2002
* Soci�t� :
* @author
* @version 1.0
import java.io.*;
import java.util.*;
import javax.comm.*;
public class Alert
static CommPortIdentifier portId;
static Enumeration portList;
PrintStream out=null;
BufferedReader in=null;
SerialPort serialPort;
int n=0;
byte[] data=new byte[100];
public static void main(String[] args)
System.out.println("Main running OK");
Alert app=new Alert();
} // main
public Alert()
System.out.println("AlertClass OK");
portList=CommPortIdentifier.getPortIdentifiers();
if (portList==null)
System.out.println("No Port Found");
return;
}// if
System.out.println(portList.hasMoreElements());
System.out.println("Port List Avalaible:");
while (portList.hasMoreElements())
portId=(CommPortIdentifier)portList.nextElement();
System.out.println("Owner : "+portId.getCurrentOwner()
+"("+portId.isCurrentlyOwned()+")");
System.out.println("Port : "+portId.getName());
if (portId.getPortType()
==CommPortIdentifier.PORT_SERIAL)
if (portId.getName().equals("COM1"))
System.out.println("Opening Serial Port "+portId.getName());
try
serialPort=(SerialPort)
portId.open("Yeeehaaa!!!",2000);
out=new PrintStream
(serialPort.getOutputStream());
in=new BufferedReader(new InputStreamReader
(serialPort.getInputStream()));
serialPort.notifyOnDataAvailable(true);
serialPort.setSerialPortParams
(57600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
out.println("ATZ");
in=new BufferedReader(new InputStreamReader
(serialPort.getInputStream()));
System.out.println("Received :"+in.readLine());
System.out.println("Received :"+in.readLine());
String jgf=in.readLine();
System.out.println("Real one"+jgf);
}// try
catch (Exception e)
System.err.println
("Alert : "+e);
}// catch
}// if
}// if
} // while
}// Alert
This is the results
C:\PROGRAM FILES\JDK1.3\bin\javaw -classpath "C:\Program Files\demo2\bak;C:\Program Files\jdk1.3\jre\lib\ext\comm.jar;C:\PROGRAM FILES\JDK1.3\demo\jfc\Java2D\Java2Demo.jar;C:\PROGRAM FILES\JDK1.3\jre\lib\i18n.jar;C:\PROGRAM FILES\JDK1.3\jre\lib\jaws.jar;C:\PROGRAM FILES\JDK1.3\jre\lib\rt.jar;C:\PROGRAM FILES\JDK1.3\jre\lib\sunrsasign.jar;C:\PROGRAM FILES\JDK1.3\lib\dt.jar;C:\PROGRAM FILES\JDK1.3\lib\tools.jar" demo2.Alert
Main running OK
AlertClass OK
false
Port List Avalaible:
No port List, nothing I've been here for 3 days... Badly need help!! please...

Hi, (here edo)
its� right now my prog. works good.
But what i have done? By following the instruction there was no success:
win32comm.dll put in <jdk>\bin\
javax.comm.properties put in <jdk>\jre\lib
comm.jar put in <jdk>\jre\lib\ext
I put the javax.comm.properties and comm.jar file into the folder where MyApplication is in it.
than:(change in the folder where your Application is)
-javac -classpath .;<jdk>\jre\lib\ext\comm.jar MyApplication.java
-java -cp .;comm.jar MyApplication
and TATA it works :)
First i think i have to tell my conditions:
WinNT 4.0 Sp 6
Jdk 1.3.0
Comm Package 2.0
(I think what also important is by this problem)
WinNT is on device C:\
JDK is on device D:\Programm\jdk...
and my prog. is on device e:\...
(i think the source of all my problems was this wide spreed stuff)
maybe there are some links in the classes of the javax.comm where do not match,
but i don't know (can somebody explain this?)
by the way can somebody tell me
what is the "java -cp ..." -cp option for?
And it is possible to read from the ParallelPort?
When i try it, this is the result:
E:\...\TEST>java -cp .;comm.jar KommParallel
java.io.IOException: Unsupported operation. Output only mode
at com.sun.comm.Win32ParallelPort.getInputStream(Win32ParallelPort.java:102)
at KommParallel.main(KommParallel.java:19)
Thnax by edo

Similar Messages

  • File paths problems on Mac OS X  - Please Help

    public static void initLangList() throws IOException {
    final InputStreamReader isr = DataAccess.getRessourceStream("/lang.txt");
    final Vector stringList = new Vector();
    String lang;
    while ( (lang = DataAccess.readString(isr)) != null) {
    //at least one language assumed
    stringList.addElement(lang);
    langList = new String[stringList.size()];
    stringList.copyInto(langList);
    I put the file "lang.txt" next to the compiled folder like i do in windows, but it is not working.
    I am new to make tho.. so please help me... =)
    Thanks &sect; GuYs &sect;

    public static InputStreamReader getRessourceStream(final String resPath)
                throws IOException {
            final InputStream is = (new Object()).getClass().getResourceAsStream(
                    resPath);
            if (is != null) {
                is.skip(BOM_LENGTH);// skip 3 bytes UTF-8 Byte Order Mark
                return new InputStreamReader(is, DICT_CHARSET);
            throw new IOException("Error finding a resource " + resPath);
        }

  • Path problem during  Change of Original

    Hello,
    I am facing path problem while changing the Original file in a DIR.
    let say i created a DIR x and attached file a.txt from c:\ and  saved the DIR.
    Now if i use cv02 and select a original for change the popup window comes with data carrier and original file path  the path is shown as c:\a.txt which is actual original path.
    if i click on continue it is opening the c:\a.txt files and  changes are done on the original file on my pc.
    This way my original file is changed on pc and in DIR also.
    I want to know how to avoid this?.
    Regards
    Shiv

    That is why they call it document "Management".  The Original File is in the "Vault" where it can be managed, not on the desktop.  If you want to protect/save the file on your desktop, set the flag in the config of the workstation application to not allow "rename" of the temporary file.  You are just attempting to circumvent the intended design of the system. What you should really do is set the flag to "delete" the file after check-in.

  • File path problem

    I have looked an read through almost all the file path problem post possible and I am still having issues maybe one of you guys can help me, here are my files
    I am doing this as an example so that I can apply it to all of my file problems....
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    pathexample.zip ‏122 KB

    First of all, to troubleshoot the problem it would help to put some filepath indicators at each point so that you can see what is going on. Also, in your exe having an error dialog "Simple Error Handler.vi" to let you know what LabVIEW didn't like in the exe.
    Now, when you run a top level ("Main.vi") and use the "Current VI's Path " in the development mode it returns <Filepath>\"Current path"\Main.vi. So stripping once will get you to  <Filepath>\"Current path" .    Now if you make it into an exe the "Current VI's Path" returns <Filepath>\"Current path"\"Name.exe"\Main.vi so you are "nested" one deeper.
    I use the following construct to determine whether the vi is being used as in the development environment or as an exe, the parse the path accordingly, although in this instance it is used to supply different directory names to a little more complex file system.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Shortest path problem in ABAP

    Hi experts,
    Is it possible to write the code for the "Shortest path problem" in ABAP?If yes, what is the code?
    Moderator Message: Don't expect members to spoon-feed you
    Edited by: Suhas Saha on Jul 25, 2011 11:13 AM

    Hi munish,
    I dont think there is any thing wrong with the ABAP code.
    Try testing your ABAP mapping using transaction code SXI_MAPPING_TEST in XI.
    Enter the Details asked and then enter TEst data in XML format.. 
    Also, you can make use of the Trace element to find out if there is any thing wrong with the code.
    Include the following Statements after every step in the ABAP code to ensure that the particular step is completed successfully.
    data : l_trace type string.
    concatenate l_trace '<Message you want to display>' into l_trace.
    trace->trace(level = '<level>'
    message =l_trace).  
    The trace is visible in SXMB_MONI (click on "Trace" in the left pane to view).
    using this you will get to know i the code is functioning as desired.
    Regards,
    Yashaswee.

  • Mail sieve filter and Return-path problem

    I want replace return-path header for one particular user when receive email. I use only sun convergence for send mail.
    imta.cnf
    ! ims-ms
    ims-ms defragment notices 1 7 14 21 28 backoff "pt5m" "pt10m" "pt30m" "pt1h" "pt2h" "pt4h" maxjobs 2 pool IMS_POOL fileinto $U+$S@$D destinationfilter /opt/sun/comms/messaging/config/imta.filter
    ims-ms-daemon imta.filter
    require ["editheader"];
    if header :contains "from" ["[email protected]"] {
            deleteheader "Return-path";
            addheader "Return-path" "[email protected]";
    }When I send email from anonymous i want delete old Return-path and add new return-path. The problem is that i see on header the new return-path but i see the old also.
    It's possible delete the default return-path ?
    Thank's
    Giovanni

    giovanni.romaneghi wrote:
    I want replace return-path header for one particular user when receive email.Why do you want to replace the Return-Path header? What is the actual problem you are trying to solve?
    Also what is the exact version of Messaging Server that you are using (./imsimta version)?
    imta.cnf
    ! ims-ms
    ims-ms defragment notices 1 7 14 21 28 backoff "pt5m" "pt10m" "pt30m" "pt1h" "pt2h" "pt4h" maxjobs 2 pool IMS_POOL fileinto $U+$S@$D destinationfilter /opt/sun/comms/messaging/config/imta.filter
    ims-ms-daemon
    You should not use "imta.filter" as the destinationfilter file-name. imta.filter is the reserved for the MTA-wide sieve filter file-name:
    http://wikis.sun.com/display/CommSuite/Mail+Filtering+and+Access+Control#MailFilteringandAccessControl-ToCreateMTAWideFilters
    When I send email from anonymous i want delete old Return-path and add new return-path. The problem is that i see on header the new return-path but i see the old also. The "Return-Path:" header is automatically added by the MTA after the sieve filter has been evaluated which is why you get two Return-Path: headers in the resultant message.
    Regards,
    Shane.

  • Mirrored volumes pathing problems

    mirrored volumes pathing problems        
    I am running Windows 2008 Server Datacenter.
    I created some mirrored volumes with disk administrator.
    These disk are in a fibre channel fabric.
    All paths go down so disk administrator losses the disks.
    All paths come up and disk administrator recovers the disks.
    The mirrors all show as failed.
    There are disks that show as failed, and disks that show as foreign.
    When I import the foreign disks. 
    One of the mirrored volume starts resyncing, and the other mirrored volume comes up as 2 simple volumes.
    Both mirrored volumes were in sync when the paths went down.
    So I expected them to come back up as mirrored volumes when the paths come back up.
    There is no I/O running at the time of the path failures.

    So let me see if I understand correctly.
    2 volumes presented to 2008 Datacenter via fibre channel
    Volumes are then mirrored via windows
    Disks drop off line and then the second mirror is 2 simple volumes but the first is rebuilding.
    So question 1 - Is it for read performance that the disks are mirrored?
    Question 2 - what disk errors appear in the event log when this happens
    Question 3 - whats the HBA used in the server
    Question 4 - Whats the backend staorage
    Question 5 - Is MPIO being used?
    Do we know the reason that the paths became unavailable? That would be probably my biggest concern.
    Also when the simple volumes came back up was the data available?
    Brad Held http://windorks.wordpress.com

  • Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    Ok, I have deleted EVERYTHING off my 16gb ipad. Photos, music, apps. All I have are the standard apps. It says I have used 11gb and only have 1.6 left. When I first bought it I had up to 4 movies and lots of apps, no problems. What's going on please!?

    How much space is used by your Other? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
     Cheers, Tom

  • I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    Apple ID FAQ   http://support.apple.com/kb/HE37

  • HT201365 I just I just updated to iOS 7 and now my calendars are not keeping the information on the days that should be marked.  The info is there in my iCloud on my computer, just not on the iPhone.  Has anyone had the same problem and what can I do abou

    I just update to iOS 7 on my iPhone 4s. The calendars on my iPhone are not keeping the information on the days that should be marked.  The info is there in my iCloud on my computer, just not on my phone.   Has anyone else had the same problem and what can I do about it?  Is it at bug in the iOS 7 update?

    What do you mean by "on the days that should be marked"?  Are you calendar events displayed on the wrong days?

  • Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?

    You might find useful information in item D1 of Time Machine Troubleshooting.

  • My MacBook Pro with Lion 10.7.2, only audio on the headset, and speaker mute. With Windows, the audio works in speaker and headphone jack. What is the problem? What's the solution?

    My MacBook Pro with Lion 10.7.2, only audio on the headset, and speaker mute. With Windows, the audio works in speaker and headphone jack. What is the problem? What's the solution?

    There is probably a red light on inside your headphone port, indicating that the analog/digital switch in there is stuck in the digital position. Insert a headphone plug and wigle it around, especially in the horizontal plane, as you insert and remove it several times. This will usually unstick the switch and restore normal operation. If it doesn't, the machine will need to be repaired.
    This has been a fairly common problem, but in most cases it is easily cured as described above.

  • My firefox wont load any page. Says it cant find the server of any of them. I can view the same pages in safari. I just updated to 3.6.7 and now having this problem. What is happening?

    My firefox wont load any page. Says it cant find the server of any of them. I can view the same pages in safari. I just updated to 3.6.7 and now having this problem. What is happening?
    == This happened ==
    Every time Firefox opened
    == Today ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

    Read this somewhere else: Can't find it again so can't reference - apols.
    fixed by entering
    about:config into the nav bar
    toggle dom.storage.enabled to 'true'
    worked for me - but don't know what it does or why :)

  • When i do file, save for web, i get an error that says " the operation could not be completed. The system cannot find the path specified." What can fix this?

    when i finish a file and try to "save for web", i get an error box saying The operation cannot be completed. The system cannot find the path Specified.
    What can i do or where do i look?

    ELEMENTS 12 AND ELEMENTS 13
    Upgraded to 13 Thinking might resolve the issue.
    Was working fine up until we had "Tech" come in the office and "up grade some stuff"
    then all of a sudden i started getting this message, something happened but i don't have a clue what.

  • After installing the new Yosemite OS on my iMac I can no longer send email. I can receive email, but not send. I use gmail and can send email on the gmail (google) site, but not on "mail" on my iMac. Any others with this problem? What should we do?

    After installing the new Yosemite OS on my iMac I can no longer send email. I can receive email, but not send. I use gmail and can send email on the gmail (google) site, but not on "mail" on my iMac. Any others with this problem? What should we do?

    My gmail, which is correctly configured for Mail with gmail SMTP and Google IMAP, works for awhile on Mail, which I leave open while working on other applications. But several times a day I get msg from Google: "We recently blocked a sign-in attempt to your Google Account" . . . and requiring me to verify my account details, re-enter passwords, confirm security settings (or change them from "disable" to "enable less secure methods" and so on). In Mail I also have tried "taking all accounts online", and re-entering my gmail password inside Mail account settings. These steps successfully re-set comms between gmail and Mail ... for awhile, then it happens again. Enough occurrences over a work day that I just quit Mail and revert to accessing gmail directly. Apple Care advisor and an Apple knowledge base article say that Apple can't deal with this, as gmail is third-party app, and they refer me to gmail, and so far I've found nothing helpful there.
    From today I also have several instances of a window saying "Mail has unexpectedly closed" and asking me to Re-open it.
    I also use Yahoo mail, which stops working with Mac Mail at the same time as gmail, but I do not receive notices to re-verify from Yahoo.
    I recently upgraded from Mavericks to Yosemite. The Mail problem happened occasionally with Mavericks but is far more frequent with Yosemite.

Maybe you are looking for

  • Configuring NWAPI in PI 7.1

    Hi All, We have installed PI 7.1, we need to configure http://<hostname>:<port no.>/nwapi monitoring. let me know how to configure (blogs, link appreciated)

  • DirectAccess NLS error

    WS2012 R2 Std. with Essentials Experience installed. Essentials is configured to provide Remote Web App. We are now adding DirectAccess. I can't post URLs with my "unverified" account, so these URLs are all intentionally incorrect, but I followed thi

  • Why is an email that I sent through gmail repeatedly being sent to the recipient?

    I replied to an email recently and the recipient said she has been getting the reply over and over again.

  • SOS !!! Export from Discoverer to Excel problem

    Hi everyone, My reports, exported from Discoverer to Excel look quite different from what Discoverer format is. The date in Excel is shifted, column names are missing and report is broken into several tabs. Any idea why it is happening? Thanks lot, S

  • Time machine backups failing

    Hi, I have been backing up my iMac wirelessly to an external network drive using Time Machine without any problems. Just recently I have bought a Western Digital My Passport for Mac USB drive and tried to set up Time Machine to use that too. The init