Use FTP inside java app.

Hi folk
i have two unix servers , and i am developing java application to filter some data in the second server by rules specified in the first server .
iam trying to use Runtime.getRuntime().exec("ftp 111.111.111.111" );
but it doesn't work !
how to call FTP inside my code ?
Thanx

georgemc wrote:
sabre150 wrote:
Google for Jakarta Commons FTP .Or follow the link I posted :-):-) Yeh yeh!

Similar Messages

  • Problems with CR used by a Java app when converting from WebSphere v5 to v6

    Background:  I have been assigned support of an old Java app, currently running just fine in a WebSphere v5 environment.  It uses CR to produce 4 reports.  Running the app in the WebSphere 6 environment, 2 work and 2 don't.  (!?!?)
    I don't know what version of CR the reports were originally designed in - nor do the people who produced them 6 years ago.  I have tried installing (and uninstalling) various versions of CR on my PC (v7, v8, v8.5, v9, v10, v11) to see if I can find one that would work with the .RPT files.  None do.  Either I get a warning that the report file is in an old format and saving it will prevent its use by the older version - whatever that may be...; or it opens the report, but when I click on the Database tab on the menu bar, CR locks up my machine.
    It has been decided by my management that it would be best to just upgrade to CR vXI and continue from there.  The XI 'developers edition' is what I am currently running.  However, when I open the .RPT file (one of the ones that work), it takes about 5 minutes; then when I click on the Database menu item, it locks-up my pc.
    I have other experience using (back-versions of) CR, but have never run into anything like this.  Has anyone had any experience with upgrading reports designed for Java to the vXI?  Can you provide me with any information, hints, suggestions about how I might proceed?
    Thank you, in advance, for any assistance you might be able to render.  Regards,
    Jeff Emslie.

    Hi, Jadie.
    Thanks for the quick response.  It may be the original report definition was designed pointing to SQL/Server v7, then was being overriden by the Java code to SQL v2k - which we are about to convert away from...  I have no experience integrating CR into a Java app.  I don't know how the data source specification works with Java.  That is why the first thing I'm trying to do is to look at the Database connection: to see how its done.
    As for the version it was originally written in; I don't know what it is.  No one here knows.  I have tried every (old) version of CR we have in the shop (list above).  None seem to work correctly with these .RPT files.  Do you know of a way to determine the CR version of an unknown .RPT file?
    Thanks,
    Jeff.

  • Pdf file transfer using ftp in java

    Hi,
    I am tried to get a pdf file from ftp. I am using the following code. This code works fine with .txt files but not with .pdf files. The pdf file generated is empty.
    import java.awt.Desktop;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import org.apache.commons.net.ftp.FTPClient;
    public class FTPConn {
           public static void main(String[] args) throws FileNotFoundException {
            FTPClient f = new FTPClient();
            try {
                f.connect(ip);
                f.login("username", "password");
                File dir = new File("dir");
                dir.mkdir();
                File myFile = new File(dir, "myfile19.pdf");
                myFile.createNewFile();
                FileOutputStream fout = new FileOutputStream(myFile);
                String content= fout.toString();
                boolean success = f.retrieveFile("/location on ftp/ftp.pdf", fout);
                System.out.println("Content :"+content);
                if (success) {
                    fout.flush();
                    fout.close();
                } else {
                    System.out.println("Reterive failure");
                Desktop d = Desktop.getDesktop();
                d.open(myFile);
            }catch(Exception e){
                e.printStackTrace();

    Hi,
    I am tried to get a pdf file from ftp. I am using the following code. This code works fine with .txt files but not with .pdf files. The pdf file generated is empty.
    import java.awt.Desktop;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import org.apache.commons.net.ftp.FTPClient;
    public class FTPConn {
           public static void main(String[] args) throws FileNotFoundException {
            FTPClient f = new FTPClient();
            try {
                f.connect(ip);
                f.login("username", "password");
                File dir = new File("dir");
                dir.mkdir();
                File myFile = new File(dir, "myfile19.pdf");
                myFile.createNewFile();
                FileOutputStream fout = new FileOutputStream(myFile);
                String content= fout.toString();
                boolean success = f.retrieveFile("/location on ftp/ftp.pdf", fout);
                System.out.println("Content :"+content);
                if (success) {
                    fout.flush();
                    fout.close();
                } else {
                    System.out.println("Reterive failure");
                Desktop d = Desktop.getDesktop();
                d.open(myFile);
            }catch(Exception e){
                e.printStackTrace();

  • Problem running my Java apps in my LG phone. Please help!

    Hi all!!
    I am quite new to the world of J2me, altough I've been coding Java for quite a few years now.
    Recently I bought a LG u 8120 phone with Java-support so I decided it was time to step into the mobile Java-world.
    Now I have written my first small app, a simple timer application which my phone (strangely enough) does not already have.
    So what happens is this : I create my app on my PC and package it with the WTK into a jar -file and a jad-file which i transfer to the phone.
    After this I can see the name of my app in the list of available programs in the phone. But when I try to run it: Nothing. The Java logo shows up for a few seconds and then I am tossed back to the menu.
    I have thought of the following as possible problems:
    1. the 8120 does not support MIDP2.0
    2. I am doing something wrong transfering the files
    3. I have missed out on one or several necessary steps in the process
    Anyone who have developed Java apps for LG phones who can give me some hints?
    I've used the Sun J2ME Wireless Toolkit 2.2 with MIDP2.0 and CLDC1.1 .
    The apps works fine in the emulator. The problem starts when I want to run it in the phone. The phone I've tried is an LG u8120. LG apparently does not want to make life easy for its customers, so there is no support for transfering Java apps in the vendor-supplied software. I suppose that's because they want you to only download stuff from their site. However, after surfing around on some discussion forums for a while I found a program called G-thing which can be used to upload Java apps to LG-phones via USB.
    Any help is very appreciated!
    Thanks,
    Sarah

    Thanks,
    I have tried this and ruled out some of the possible causes.
    When I added some more exception handling, I could see that a "java.lang.IllegalArguenException" is thrown.
    When I ran the AudioDemo package that came with WTK2.2 I noticed that the examples that uses WAV-files do not work while the rest works fine.
    My new theory is now that the u8120 does not support the WAV-format, so I will try with an mp3 instead and see what happens.
    Anyone who knows if LG-phones support WAV-format?
    /Sarah

  • Q: FTP through java?

    Hello,
    I am trying to do an FTP through java. Does anybody know how I can spawn an FTP process and send ftp commands to it from my java program?
    I am on a Solaris system BTW.
    Thankyou in advance...

    I see you haven't assigned any duke dollars to your question. Let me tell you how does the Duke Dollar system work. Observe the following example...
    I know the answer.
    My rates are as follows:
    zero duke dollars - vague hint
    one to five duke dollars - +definite answer
    six to ten duke dollars - +full file/package name
    ten to fiteen duke dollars - +URL information
    more than fifteen duke dollars - +full URL with download information
    Pick your choice and select the appropriate answer:
    0 - There are premade classes that allow you to use FTP in Java.
    1 - 5 IBM have created a package that will allow you to do things that you desire.
    6-10 You should be looking for the FTP Beans Suite by IBM It comprises of two beans - the FTPProtocol bean and the FTPUI bean, both are very useful, especially in your situation.
    11-15 You can find this suite at http://www.alphaworks.ibm.com
    16+ go here http://www.alphaworks.ibm.com/ab.nsf/bean/FTP to add file transfer functions to your applications... without writing a line of code.

  • How do I run multiple java apps in one JVM to reduce memory use?

    Hi all,
    I saw an article either on the web or in a magazine not too long ago about how to "detect" if the app is already running, and if so, it hands off the new instance to the already running JVM, which then creates a thread to run the Java app in. As it turns out, my app will be used in an ASP environment, through Citrix. We may have as many as 50 to 100 users running the same app, each with their own unique user ID, but all using the same one server to run it on. Each instance eats up 25MB of memory right now. So the question is if anybody knows of a URL or an app like this that can handle the process of running the same (or even different Java) apps in one JVM as separate threads, instead of requring several instances of the JVM to run? I know this article presented a fully working example, and I believe I know enough to do it but I wanted ot use the article as a reference to make sure it is done right. I know that each app basically would use the same one "launcher" program that would on first launch "listen" to a port, as well as send a message through the port to see if an existing launcher was running. If it does, it hands off the Java app to be run to the existing luancher application and shuts down the 2nd launching app. By using this method, the JVM eats up its normal memory, but each Java app only consumes its necessary memory as well and doesn't use up more JVM instance memory.
    Thanks.

    <pre>
    import java.util.Properties;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import java.util.Enumeration;
    import java.util.NoSuchElementException;
    public class RunProg implements Runnable, Cloneable
    private String iProg;
    private String iArgs[];
    public static void main(String args[])
    new RunProg().main();
    // first step is to start main program itself
    private void main()
    Properties properties = System.getProperties();
    try
    properties.load(new FileInputStream("RunProg.properties"));
    catch(IOException e)
    System.setProperties(properties);
    int i = 0;
    System.out.println("enter main, activeCount=" + Thread.activeCount());
    while(true)
    String program = properties.getProperty("Prog" + i);
    if(program == null)
    break;
    StringTokenizer st = new StringTokenizer(program);
    String[] args = new String[st.countTokens() - 1];
    try
    RunProg rp = (RunProg)this.clone();
    rp.iProg = st.nextToken();
    for(int j = 0; st.hasMoreTokens(); j++)
         args[j] = st.nextToken();
    rp.iArgs = args;
    Thread th = new Thread(rp);
    th.setName("prog" + i + "=" + program);
    th.start();
    System.out.println("prog" + i + "=" + program + ", started");
    catch(CloneNotSupportedException e)
    System.out.println("prog" + i + "=" + program + ", can't start");
    i++;
         System.out.println("end of main, activeCount=" + Thread.activeCount());
    // next step is to start all others one by one
    public void run()
    try
    Class c = Class.forName(iProg);
    Class p[] = new Class[1];
    p[0] = String[].class;
    Method m = c.getMethod("main", p);
    Object o[] = new Object[1];
    o[0] = iArgs;
    m.invoke(null, o);
    catch(ClassNotFoundException e)
    System.out.println(iProg + "ClassNotFoundException");
    catch(NoSuchMethodException e)
    System.out.println(iProg + "NoSuchMethodException");
    catch(InvocationTargetException e)
    System.out.println(iProg + "NoSuchMethodException");
    catch(IllegalAccessException e)
    System.out.println(iProg + "NoSuchMethodException");
    System.out.println(Thread.currentThread().getName() + ", ended");
    System.out.println("exit run, activeCount=" + Thread.activeCount());
    // setup SecurityManager to disable method System.exit()
    public RunProg()
         SecurityManager sm = new mySecurityManager();
         System.setSecurityManager(sm);
    // inner-class to disable method System.exit()
    protected class mySecurityManager extends SecurityManager
         public void checkExit(int status)
              super.checkExit(status);
              Thread.currentThread().stop();
              throw new SecurityException();
    * inner-class to analyze StringTokenizer. This class is enhanced to check double Quotation marks
    protected class StringTokenizer implements Enumeration
    private int currentPosition;
    private int maxPosition;
    private String str;
    private String delimiters;
    private boolean retTokens;
    * Constructs a string tokenizer for the specified string. All
    * characters in the <code>delim</code> argument are the delimiters
    * for separating tokens.
    * <p>
    * If the <code>returnTokens</code> flag is <code>true</code>, then
    * the delimiter characters are also returned as tokens. Each
    * delimiter is returned as a string of length one. If the flag is
    * <code>false</code>, the delimiter characters are skipped and only
    * serve as separators between tokens.
    * @param str a string to be parsed.
    * @param delim the delimiters.
    * @param returnTokens flag indicating whether to return the delimiters
    * as tokens.
    public StringTokenizer(String str, String delim, boolean returnTokens)
    currentPosition = 0;
    this.str = str;
    maxPosition = str.length();
    delimiters = delim;
    retTokens = returnTokens;
    * Constructs a string tokenizer for the specified string. The
    * characters in the <code>delim</code> argument are the delimiters
    * for separating tokens. Delimiter characters themselves will not
    * be treated as tokens.
    * @param str a string to be parsed.
    * @param delim the delimiters.
    public StringTokenizer(String str, String delim)
    this(str, delim, false);
    * Constructs a string tokenizer for the specified string. The
    * tokenizer uses the default delimiter set, which is
    * <code>"&#92;t&#92;n&#92;r&#92;f"</code>: the space character, the tab
    * character, the newline character, the carriage-return character,
    * and the form-feed character. Delimiter characters themselves will
    * not be treated as tokens.
    * @param str a string to be parsed.
    public StringTokenizer(String str)
    this(str, " \t\n\r\f", false);
    * Skips delimiters.
    protected void skipDelimiters()
    while(!retTokens &&
    (currentPosition < maxPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) >= 0))
    currentPosition++;
    * Tests if there are more tokens available from this tokenizer's string.
    * If this method returns <tt>true</tt>, then a subsequent call to
    * <tt>nextToken</tt> with no argument will successfully return a token.
    * @return <code>true</code> if and only if there is at least one token
    * in the string after the current position; <code>false</code>
    * otherwise.
    public boolean hasMoreTokens()
    skipDelimiters();
    return(currentPosition < maxPosition);
    * Returns the next token from this string tokenizer.
    * @return the next token from this string tokenizer.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    public String nextToken()
    skipDelimiters();
    if(currentPosition >= maxPosition)
    throw new NoSuchElementException();
    int start = currentPosition;
    boolean inQuotation = false;
    while((currentPosition < maxPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) < 0 || inQuotation))
    if(str.charAt(currentPosition) == '"')
    inQuotation = !inQuotation;
    currentPosition++;
    if(retTokens && (start == currentPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) >= 0))
    currentPosition++;
    String s = str.substring(start, currentPosition);
    if(s.charAt(0) == '"')
    s = s.substring(1);
    if(s.charAt(s.length() - 1) == '"')
    s = s.substring(0, s.length() - 1);
    return s;
    * Returns the next token in this string tokenizer's string. First,
    * the set of characters considered to be delimiters by this
    * <tt>StringTokenizer</tt> object is changed to be the characters in
    * the string <tt>delim</tt>. Then the next token in the string
    * after the current position is returned. The current position is
    * advanced beyond the recognized token. The new delimiter set
    * remains the default after this call.
    * @param delim the new delimiters.
    * @return the next token, after switching to the new delimiter set.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    public String nextToken(String delim)
    delimiters = delim;
    return nextToken();
    * Returns the same value as the <code>hasMoreTokens</code>
    * method. It exists so that this class can implement the
    * <code>Enumeration</code> interface.
    * @return <code>true</code> if there are more tokens;
    * <code>false</code> otherwise.
    * @see java.util.Enumeration
    * @see java.util.StringTokenizer#hasMoreTokens()
    public boolean hasMoreElements()
    return hasMoreTokens();
    * Returns the same value as the <code>nextToken</code> method,
    * except that its declared return value is <code>Object</code> rather than
    * <code>String</code>. It exists so that this class can implement the
    * <code>Enumeration</code> interface.
    * @return the next token in the string.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    * @see java.util.Enumeration
    * @see java.util.StringTokenizer#nextToken()
    public Object nextElement()
    return nextToken();
    * Calculates the number of times that this tokenizer's
    * <code>nextToken</code> method can be called before it generates an
    * exception. The current position is not advanced.
    * @return the number of tokens remaining in the string using the current
    * delimiter set.
    * @see java.util.StringTokenizer#nextToken()
    public int countTokens()
    int count = 0;
    int currpos = currentPosition;
    while(currpos < maxPosition)
    * This is just skipDelimiters(); but it does not affect
    * currentPosition.
    while(!retTokens &&
    (currpos < maxPosition) &&
    (delimiters.indexOf(str.charAt(currpos)) >= 0))
    currpos++;
    if(currpos >= maxPosition)
    break;
    int start = currpos;
    boolean inQuotation = false;
    while((currpos < maxPosition) &&
    (delimiters.indexOf(str.charAt(currpos)) < 0 || inQuotation))
    if(str.charAt(currpos) == '"')
    inQuotation = !inQuotation;
    currpos++;
    if(retTokens && (start == currpos) &&
    (delimiters.indexOf(str.charAt(currpos)) >= 0))
    currpos++;
    count++;
    return count;
    </pre>
    RunProg.properties like this:
    Prog1=GetEnv 47838 837489 892374 839274
    Prog0=GetEnv "djkfds dfkljsd" dsklfj

  • What path to use to access network files from Java app running on Mac

    I have a Java app running on a Mac with OS X that I'm using to check for files that exists on Windows servers within our network.
    Using a path like /Volumes/<Share>/ works because I've already connected to the drive using Finder. If I try to use a fully qualify the path with "smb://<Server>/<Share>" then my app doesn't see anything. Is there any way that I can get Java to connect to a directory without first having mapped or made the connection via some external tool like Finder?
    Here's the code I'm testing with:
    package FileImports;
    import java.io.File;
    import java.util.Arrays;
    public class Dir {
    static int indentLevel = -1;
    static void listPath(File path) {
    File files[];
    indentLevel++;
    files = path.listFiles();
    if (!(files == null)){
    Arrays.sort(files);
    for (int i = 0, n = files.length; i < n; i++) {
    for (int indent = 0; indent < indentLevel; indent++) {
    System.out.print(" ");
    System.out.println(files.toString());
    if (files[i].isDirectory()) {
    listPath(files[i]);
    indentLevel--;
    } else System.out.println("Directory not accessible!");
    public static void main(String args[]) {
    // this path works where <share> = the directory where my files exist.
    listPath(new File("/Volumes/<share>"));
    // this path returns a null result in files
    // listPath(new File("smb://<Server>/<Share>/"));
    Thanks,
    Alex
    Edited by: agates on Sep 25, 2008 11:14 AM

    agates wrote:
    Thanks for the response. I'll have to dig a little deeper into JCIFS. It looks like it would work great windows to windows. I haven't been able to find in the documentation where it would work on OS X without having to mount the targeted file system first. Has anyone had success creating a connection to a windows file system from OS X with JCIFS?Since jCIFS is written in pure Java and implements the entire SMB/CIFS protocoll on it's own it doesn't require any support from the OS (apart from a normal JVM runnig). Thus it should work exactly the same in OS X and Windows (and Linux and Solaris and ...).

  • Java Errors when using my Java App via Remote Desktop

    I have a Java App that runs fine if I invoke it and run it on a windows xp machine "x".
    If I remote desktop connect to machine "x" from another windows machine "y"
    I get the errors and the Java App is not displayed correctly. It becomes unusable.
    While remotely connected if I terminate the Java App and restart it the App
    will run just fine and not generate any errors.
    Specifically the steps are:
    Open a cygwin shell.
    invoke the app...java -jar xxx.jar
    use the app on the machine, works fine without any exceptions.
    Leave the app running and go home...eat dinner...then
    VPN into the office
    Startup Windows Remote Desktop to the pc running the app.
    Start to use the app. Now the exception occur as I click on buttons/enter data into fields.
    Then I terminate the App.
    Then I restart the app... java -jar xxx.jar
    It works fine without exceptions.
    This app was developed using NetBeans 6.5
    The errors are:
    in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.sun.java.swing.plaf.windows.XPStyle$Skin.getWidth(Unknown Source)
    at com.sun.java.swing.plaf.windows.XPStyle$Skin.getWidth(Unknown Source)
    at com.sun.java.swing.plaf.windows.WindowsIconFactory$CheckBoxIcon.getIc
    onWidth(Unknown Source)
    at javax.swing.SwingUtilities.layoutCompoundLabelImpl(Unknown Source)
    at javax.swing.SwingUtilities.layoutCompoundLabel(Unknown Source)
    at javax.swing.plaf.basic.BasicRadioButtonUI.getPreferredSize(Unknown So
    urce)
    at com.sun.java.swing.plaf.windows.WindowsRadioButtonUI.getPreferredSize
    (Unknown Source)
    at javax.swing.plaf.basic.BasicButtonUI.getMinimumSize(Unknown Source)
    at javax.swing.JComponent.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedMinimumSize
    (Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculateMinimumSize(Unknown
    Source)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculatePreferredSize(Unknow
    n Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$ParallelGroup.calculateMinimumSize(Unknown So
    urce)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ParallelGroup.calculateMinimumSize(Unknown So
    urce)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ParallelGroup.calculateMinimumSize(Unknown So
    urce)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ParallelGroup.calculateMinimumSize(Unknown So
    urce)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout.calculateAutopadding(Unknown Source)
    at javax.swing.GroupLayout.prepare(Unknown Source)
    at javax.swing.GroupLayout.minimumLayoutSize(Unknown Source)
    at java.awt.Container.minimumSize(Unknown Source)
    at java.awt.Container.getMinimumSize(Unknown Source)
    at javax.swing.JComponent.getMinimumSize(Unknown Source)
    at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateSi
    ze(Unknown Source)
    at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.minimumLayo
    utSize(Unknown Source)
    at java.awt.Container.minimumSize(Unknown Source)
    at java.awt.Container.getMinimumSize(Unknown Source)
    at javax.swing.JComponent.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedMinimumSize
    (Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculateMinimumSize(Unknown
    Source)
    at javax.swing.GroupLayout$Spring.getMinimumSize(Unknown Source)
    at javax.swing.GroupLayout$ComponentSpring.calculatePreferredSize(Unknow
    n Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
    at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
    at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
    at javax.swing.GroupLayout$SequentialGroup.setValidSize(Unknown Source)
    at javax.swing.GroupLayout$Group.setSize(Unknown Source)
    at javax.swing.GroupLayout.calculateAutopadding(Unknown Source)
    at javax.swing.GroupLayout.layoutContainer(Unknown Source)
    at java.awt.Container.layout(Unknown Source)
    at java.awt.Container.doLayout(Unknown Source)
    at java.awt.Container.validateTree(Unknown Source)
    at java.awt.Container.validateTree(Unknown Source)
    at java.awt.Container.validate(Unknown Source)

    Crossposted
    [http://forums.sun.com/thread.jspa?threadID=5421349&messageID=10892967#10892967]

  • Java.lang.NoSuchMethodError: getSocket using JavaMail inside JBoss

    Hi,
    i built a library to easily send emails with JavaMail, via SMTP. When i use my lib in a stand-alone java application, it works fine, but when i need to use it inside my web application, deployed on JBoss AS, i get the following error:
    Servlet.service() for servlet action threw exception
    java.lang.NoSuchMethodError: getSocket
         at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
         at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
         at javax.mail.Service.connect(Service.java:233)
         at it.compit.mail.helper.send.SMTPSender.send(SMTPSender.java:39) where it.compit.mail.helper.send.SMTPSender.send is the method i use to send email in my lib. SMTPSender.java at line 39 is
    SMTPTransport tr = (SMTPTransport) session.getTransport("smtp"); I don't want to use SessionBean to send email from JBoss AS. I did not include mail.jar in server/default/lib dir because JBoss has got a built-in implementation of JavaMail. Using javamail debugging, i've noticed that javamail inside my JBoss is "JavaMail version 1.3.1", while i used version 1.4ea to build my lib.
    So, any ideas to solve my problem?
    Thanks in advance.
    Elisa Distefano a.k.a Etha

    Hi bshannon,
    i looked for other javamail libs in my JBoss dir: found nothing but the only mail.jar located in server/default/lib/ (provided by default installation). I tried to specify the classpath into mail-service.xml without success.
    I also noticed that when JBoss starts, logs print "DEBUG: JavaMail version 1.3.1 " while the MANIFEST.MF inside my mail.jar contains "Implementation-Version: 1.4".
    My JBoss version is 4.0.4 GA. Any idea?!?

  • Sql_trace does not work for Java app using Oracle JDBC thin driver

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

  • Nokia c7 - how to use keypad in games or java apps...

    Hi,
    In some jars (java apps) I downloaded would be useful to use keypad buttons. I wonder if nokia c7 have a function that show a keypad that emulates keys. I have seen with other mobiles but I can't find a way to do with this mobile. Thank you for help.

    OADBTransaction tx = (OADBTransaction)getDBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    Connection conn = (Connection)oapagecontext.getApplicationModule(oawebbean).getOADBTransaction().getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(conn);http://oracleanil.blogspot.com/2009/04/itemqueryvoxml.html
    Thanks
    --Anil
    http://oracleanil.blogspot.com

  • Can I create a java app for my palm zire 71 that uses floating point calc

    I am an eclipse user that is looking at studio creator 2 and was wondering if I could create a java app for my palm zire 71. I have read alot about no floating point support in midp... is that true for java on the palm? If so, how does one calculate with floats and doubles to do sqrt functions etc?
    Thanks in advance for your time
    Dean-O

    I looked at netbeans and it does not support floating points in midlets. Not good for palm app if no floating point ability. J2ME supports floating point but in netbeans... is uses midlets and there are no floating points. Now what does one do? Not that dreaded C++
    THanks in advance
    Dean-O

  • Make java app. NOT use ".bat","sh","exe"-jar get params from manifest!!

    Right now a jar file's manifest can have a "main-class" which makes the jar truly executable - you can double-click it. The problem is, if you need environment variables, there is no way to pass them in to your main-class' "args."
    So why don't we make it so when the jar's manifest is read, that in addition to "main-class" you can have "main-args"?
    That would mean everyone would no longer need to bundle java apps with ".exe" or ".bat" or ".sh" files!!! We could have truly Java applications, that are executables!!!
    Just package them in a jar, have a main class and the args for it!!
    what does everyone think?

    Unfortunatly, it won't happen.....
    Sun has been pushing property files ever since they disabled getEnv. You are probably better off designing some sort of Runtime.exec("echo $VARIABLE") or such to catch the environment variables during init. Or you could just start using property files like sun would want.

  • Trying to Access Website using SSL running JAVA from inside ORACLE DB

    Hi,
    I am trying to access website using SSL and running JAVA code from inside Oracle 10g DB server using SSL and Java. I have loaded my java code into Oracle data base. My problem is when I am running same code from outside the DB it is running perfectly fine but when the same code is loaded into DB and trying to run from DB under these environment I am using for running my code:-
    JDK 1.4.2_06
    JSSE 1.4
    Database :- Oracke 10G
    I am getting following Exception:-
    CALL testssl_http_mar20_New();
    java.io.IOException: Unable to tunnel through 123.456.789.123:80. Proxy returns "HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.)
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
    at
    com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect(DashoA12275)
    at
    com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer(DashoA12275
    at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l(DashoA12275)
    at com.sun.net.ssl.internal.www.protocol.https.HttpClient.<init>(DashoA1
    2275)
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.<init>(DashoA
    12275)
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
    at
    com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(DashoA122
    75)
    at
    com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(Da
    shoA12275)
    at java.net.URL.openStream(URL.java:924)
    at SecureURLhttp_Mar20_New.SecureURLhttp_Mar20_New(
    source code is below :-
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.util.*;
        public class SecureURLhttp
              public static void main(String[] args) throws Exception
                  SecureURLhttp r = new SecureURLhttp();
                  r.SecureURLhttp();
        public static void SecureURLhttp() throws IOException
                System.setProperty("java.protocol.handler.pkgs","oracle.aurora.rdbms.url|com.sun.net.ssl.internal.www.protocol");
                System.setProperty("https.proxySet","true");
                Authenticator.setDefault(new MyAuthenticator());
                System.setProperty("https.proxyHost","123.456.789.123");
                System.setProperty("https.proxyPort","80");
               //  URL verisign = new URL("https://login.oracle.com/");
                URL verisign = new URL("https://www.verisign.com");
                BufferedReader in = new BufferedReader(new InputStreamReader(verisign.openStream()));
                String inputLine;
                while ((inputLine = in.readLine()) != null)
                System.out.println(inputLine);
                in.close();
                 /* Code Newly Add for checking the system property   */
                java.util.Properties props = System.getProperties();
                java.util.Enumeration propNames = props.propertyNames();
                 while (propNames.hasMoreElements ())
                 Object o=  propNames.nextElement();
                 String name = (String ) o;
                 String val =  props.getProperty(name)   ;
                 System.out.println ( name +  "  = "  + val );
        private static class MyAuthenticator extends Authenticator {
              protected PasswordAuthentication getPasswordAuthentication() {
                   return new PasswordAuthentication("<USERNAME>",new String("<USER_PASSWORD>").toCharArray());
         }Please help me out:
    Thanks a lot in advance.

    0- the fact the ISA server logs an 'anonymous' seems logical, since it answers by HTTP 407. I will say it's even a "good log" :) but I had preferred a good old "security exception" but it's not the case..
    1- The code for checking the properties (your debugging) should be placed BEFORE trying to connect to the url if you want to see what's happening
    2- The 'normal' way to set the proxy is to set the following properties
    System.setProperty("http.proxySet","true"); // and NOT https.proxyset as ejp said
    System.setProperty("http.proxyHost","123.456.789.123");
    System.setProperty("http.proxyPort","80");
    3- what's the behavior if you change 123.456.789.123 by the real name (hostname) of the server ?
    4- You can try setting up the proxy in the java control panel instead of in your code (easy to do under Windows, you look for the networking settings, and you find the proxy settings for http/https there. Otherwise look for all files called net.properties and edit them).
    5- to help debbuging, we can rely on several methods of Authenticator :
    protected PasswordAuthentication getPasswordAuthentication() {
    System.err.println(".\tgetRequestingHost: " + getRequestingHost());
    System.err.println("..\tgetRequestingSite: " + getRequestingSite());
    System.err.println("...\tgetRequestingPort: " + getRequestingPort());
    System.err.println("....\tgetRequestingProtocol: " + getRequestingProtocol());
    System.err.println(".....\tgetRequestingPrompt: " + getRequestingPrompt());
    System.err.println("......\tgetRequestingScheme: " + getRequestingScheme());
    return new PasswordAuthentication("<USERNAME>",new String("<USER_PASSWORD>").toCharArray());
    Try all this and let us see the output messages.
    Please remember to give some 'duke stars' if it helped resolving the problem ;)
    NephYliM

  • Windows Macro Engine for use with Java Apps

    Does anyone know of a macro engine that can be used under windows for interaction with a Java app? None of the ones I've tried will work with Java Apps. Work great with everything else I've tried, just not Java apps.
    Will

    What exactly is a macro engine? What do you want it to do? Do you want to add scripting to your application? Or do you want to script third party applications, that don't support it themselves?

Maybe you are looking for

  • Selectively mark Excel columns in MDS as Read-Only

    Is there an internally supported feature in MDS 2012 Excel add-in wherein we can set some columns (e.g Code column) as Read-Only? The use case we're trying to evaluate is to not allow users to make changes to the Business Key column of an entity (pop

  • Playing video

    hi, I am developing a media player for my project using jmf, and I have completed with my audio part. But when I wrote the code for playing video, it gave me the following errors. The below is the code, with the errors. if(p!=null){             p.sto

  • [11i] Forms Perso : Updating a DFF at PO_LINES level in the PO screen

    Hello In the PO screen (POXPOEPO), I'd like to maintain some consistency between 3 dates fields at PO_LINE level, according to some business rules, with Forms Perso. 2 dates fields are the standard ones, PROMISED_DATE and NEED_BY_DATE, the third one

  • Sales order & Billing document  ( VBAK & VBRK )

    Hello All, What is the link between table VBAK and VBRK? I have requirement where I need to find out the sales document number from the billing document number. I can see the relation in the relationship browser but I couldn't find the columns which

  • FCKEditor error 500

    Hi All, We have a domain that is running in CF8.0.1 (shared server with lots of domains) and the FCKEditor has started to throw a strange error, when a user clicks the 'browse server' button it returns the following: The server didn't send back a pro