• RELEVANCY SCORE 3.80

    DB:3.80:Problem In Transfer Many Files Using Single Instance Of Ftpclient cj





    Hi

    I am facing problem in transferring many files using single instance of FTPClient ( Apache commons ) simultaneously by spawning threads for each transfer. When I am trying to do this using storeFile method, it is throwing the error:

    Truncated server reply

    I dont how to handle this situation. On the otherhand, I can able to transfer many files having separate FTPClient instance for each file transfer. This is too expensive. I will end up in having too many FTP connections when doing this process. For example, to transfer 1000 files, it needs 1000 FTP connections with the server. I would like to do this using the single FTP connnection.

    Can anyone help me to handle this?

    Thanks,
    Mani

    DB:3.80:Problem In Transfer Many Files Using Single Instance Of Ftpclient cj

    ...the load on the server, the relative sizes of the files, the performance of the network between you and the server...

    Basically, it's an unanswerable question.

  • RELEVANCY SCORE 3.73

    DB:3.73:Help With Apache Ftp jx





    Hi all

    I am using the apache FTPClient to ftp files around. My problem is that I seem to be able to only send / retrieve 1 file before I need to reset the whole connection. I think that the answer may lie with this method

    http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html#setRestartOffset(long)

    ... that's what I need, right? A restart offset, I think. How do I do it?

    Does anyone have any experience with this package, or with programmatic FTP?

  • RELEVANCY SCORE 3.56

    DB:3.56:Incorporate Ftp In Servlet kf





    Hi i run my servlets in tomcat 5.0.25. I made a sample program (not a servlet) which uses FTP from within Java (using jakarta commons-net), it works fine and i am able to transfer files from server to client with no problem. but when i put this code in my servlet and run the servlet (to transfer file from server to client) i get an error:

    java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at comT1.Transfer.burn(Transfer.java:132)
    at comT1.Transfer.doGet(Transfer.java:100)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
    at java.lang.Thread.run(Thread.java:534)

    is it possible to use FTP in servlets?

    DB:3.56:Incorporate Ftp In Servlet kf

    ...
    at javax.servlet.http.HttpServletYou are apperently extending HttpServelt, which, as the name suggests, uses HTTP: HyperTextTransferProtocol, and not FTP, FileTransferProtocol. Not sure if this is the problem, but...
    1) It would probably be better to use the GenericServlet.service method rather than the HttpServlet's doGet method.
    2) The error seems to be saying that: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient. Which means that the class specified is not in the classpath. The JAR that contains this class should be in the web-app's WEB-INF/lib directory, or if the .class file is not in a JAR, it should be in the WEB-INF/classes directory.

  • RELEVANCY SCORE 3.55

    DB:3.55:Re: How To Set Ftpclient Timeout While Connect To Server? fc


    ejp wrote:
    Because, there's no FTP client command that allows to do such thing.Socket.setSoTimeout().I agree with you on this one but the OP is talking about the FTPClient API from Apache.

    To the OP,

    BTW, I have reread the Javadoc about the [*API*|http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html] : indeed, there's no setTimeout method, but there is a setDataTimeout method : +Sets the timeout in milliseconds to use when reading from the data connection+ .

  • RELEVANCY SCORE 3.48

    DB:3.48:Logging Entries Appearing Twice 8c


    Hi,

    I've a problem with log4j and Apache Commons Logging that I'm hoping someone can assist with. Logging appears twice in my application logs. I've a single log4j and a single commons-logging jar on my classpath. My log4j.properties simply contains the following:

    log4j.rootLogger=ERROR, A1

    log4j.appender.A1=org.apache.log4j.ConsoleAppender

    This writes to wrapper.log in my Tomcat logs directory, with duplicate entries for each log.

    Can anyone advise me on what the problem may be here?

    THanks

    DB:3.48:Logging Entries Appearing Twice 8c

    Turn off the log4j logging. If that reduces the number of copies in the log to 1 then you know that Commons logging is writing to the log as well as delegating to log4j.

  • RELEVANCY SCORE 3.43

    DB:3.43:Email Sending Error aa


    Hi all, I have some problem.
    I am using JDeveloper 10g for development, and Oracle Application Server 10.1.2.0.2 as a deployment server, I am using the apache commons package to send email, it works fine at development with JDeveloper 10g but with the app server it throws a runtime exception saying that no such method called validate() in the class InternetAddress.
    I am sure of the version of mail api package and apache package, also I am sure that the package contains method validate().
    Any Help Please?
    Thanks
    Ahmad Elsafty

    DB:3.43:Email Sending Error aa

    Hi all, I have some problem.
    I am using JDeveloper 10g for development, and Oracle Application Server 10.1.2.0.2 as a deployment server, I am using the apache commons package to send email, it works fine at development with JDeveloper 10g but with the app server it throws a runtime exception saying that no such method called validate() in the class InternetAddress.
    I am sure of the version of mail api package and apache package, also I am sure that the package contains method validate().
    Any Help Please?
    Thanks
    Ahmad Elsafty

  • RELEVANCY SCORE 3.35

    DB:3.35:Java.Lang.Noclassdeffounderror s7



    Hi I am calling a ActionHandler in a node, in Action Handler I am using following code

    if (StringUtils.isEmpty((String) executionContext.getVariable(EXCEPTION_THROWN))) {

    Its throwing error

    java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils

    but i have included commons-lang-2.3.jar , there are no build errors,,, yet the above exception is occuring,,, plz help

    DB:3.35:Java.Lang.Noclassdeffounderror s7


    Your are probably missing commons-collections jar at runtime.

  • RELEVANCY SCORE 3.33

    DB:3.33:Commons-Collections 1d



    Jackrabbit requires fairly recent versions of commons-collections. You will not that the two Jcr tests now fail since the previous apache version of the lib was reverted to JBoss.Tom, can you figure out how we can live with the later version of Commons-Collections? I'm not sure what problem the new one was causing.Regards, Jim

    DB:3.33:Commons-Collections 1d


    I have added the Jackrabbit libraries to the build.deploy.xml to be copied to the server/jbpm/lib directory.This is necessary for the Jcr Service to run correctly.Regards, Jim

  • RELEVANCY SCORE 3.27

    DB:3.27:Using Jakarta Commons Logging With Jboss k9



    Hi,I'm trying to use Commons Logging to wrap log4j logging system. When I execute my application jboss (I'm using jboss-3.0.3_tomcat-4.0.5) return me this exception:org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org/apache/commons/logging/impl/Log4JLogger at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414) ...Do you know why jboss cannot find this class and why instead it finds org.apache.commons.logging.LogConfigurationException ?Thanks in advancePaola

    DB:3.27:Using Jakarta Commons Logging With Jboss k9


    Hi,I'm trying to use Commons Logging to wrap log4j logging system. When I execute my application jboss (I'm using jboss-3.0.3_tomcat-4.0.5) return me this exception:org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org/apache/commons/logging/impl/Log4JLogger at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414) ...Do you know why jboss cannot find this class and why instead it finds org.apache.commons.logging.LogConfigurationException ?Thanks in advancePaola

  • RELEVANCY SCORE 3.20

    DB:3.20:Fragment Not Attaching To Host Bundle (Commons-Dbcp) xs



    I have a fragment, "DBCP Postgres Driver Fragment", that is suppose to attach to the host bundle ("Apache ServiceMix :: Bundles :: commons-dbcp (1.2.2.6)").

    I did my development on Window 7 using "apache-servicemix-4.3.1-fuse-00-00". I had everything running fine.

    Here's the relavent data from the "osgi:list":

    [] [] Apache ServiceMix :: Bundles :: commons-dbcp (1.2.2.6)

    Fragments: 496

    and

    [] [] NE Services :: DBCP Postgres Driver Fragment (1.0.02.SNAPSHOT)

    Hosts: 207

    Everything works fine here.

    I am now trying to deploy to Linux using "apache-servicemix-4.3.1-fuse-01-09" (I can't find a "apache-servicemix-4.3.1-fuse-00-00" download). One problem I am having is that the "commons-dbcp" host does not attach the fragment "Postgres Driver Fragment".

    From the "osgi:list" on the Linux box:

    [] [] Apache ServiceMix :: Bundles :: commons-dbcp (1.2.2.6)

    [] [] NE Services :: DBCP Postgres Driver Fragment (1.0.02.SNAPSHOT)

    Hosts: 205

    Notice that there is no "Hosts:" below the "[205]" entry.

    Viewing Id = 205 in the "Felix Web Console" confirms that is not attached and no Postgres imports are present.

    I checked the "PostgreSQL JDBC4 Drivercom.springsource.org.postgresql.jdbc4" bundles on both installations and they look the same and both are active.

    The only differences I can see are:

    1) Operating systems

    2) ESB versions

    3) The way they were installed (I haven't mentioned this previously):

    3.1) On the Windows/"apache-servicemix-4.3.1-fuse-00-00":

    osgi:install mvn:ca.ne2.integration/neis-dbcp-postgresql-jdbc-fragment/1.0.02-SNAPSHOT

    3.2) Linux/"apache-servicemix-4.3.1-fuse-01-09":

    osgi:install file:///home/servicemix/jars/ne-dbcp-postgresql-jdbc-fragment-1.0.02-SNAPSHOT.jar

    I don't have access to the maven repository from the Linux box.

    Any ideas on how to resolve this would be appreciated.

    I would like to try this on a Linux version of "apache-servicemix-4.3.1-fuse-00-00". Any idea on where I can find this.

    Thanks,

    Daryl

    DB:3.20:Fragment Not Attaching To Host Bundle (Commons-Dbcp) xs


    Thanks Freeman. The "osgi:refresh" solved the problem.

  • RELEVANCY SCORE 3.18

    DB:3.18:Re: Upload Binary File With Servlet 81


    Try using the oreilly servlets at http://www.servlets.com/cos, or the apache commons fileupload somewhere at http://jakarta.apache.org/commons/fileupload

    DB:3.18:Re: Upload Binary File With Servlet 81

    Well answered declangallagher.

    As for texan, it seems that you want to be given the exact code to parse the request, instead of writing your own code based on the multipart rfc.

    How is that different from using third party code, which by the way, has been proven to be stable?

  • RELEVANCY SCORE 3.15

    DB:3.15:Strange Behavior With Datascroller In Myfaces's Tomahawk. ms


    hi

    i have an strange problem using MyFaces's tomahawk.

    in the code listed below you can find a dataScroller configured to use a dataTable placed above it.
    the first time that the page is called, everything works well.
    but when click on any links in the dataScroller, for example when i click on next link
    the dataScroller's first,next and ... are not displayed.!!!

    i am using Apache Tomcat/5.0.19
    with :

    tomahawk-1.1.5.jar
    jsf-impl.jar
    jsf-api.jar
    bcel.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload-1.2.jar
    commons-io-1.3.1.jar
    commons-logging.jar
    standard.jar
    jstl.jar

    help me, please!!!

    %@ page session="false" contentType="text/html; charset=utf-8"%
    %request.setCharacterEncoding("utf8");%

    %@taglib uri="http://java.sun.com/jsf/core" prefix="f"%
    %@taglib uri="http://java.sun.com/jsf/html" prefix="h"%

    %@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%

    %@include file="inc/head.inc" %

    f:view

    h:form

    t:dataTable id="tab1" rows="3"
    value="#{report.postList}" var="state"
    h:column

    f:facet name="header"
    h:outputText value="id" /
    /f:facet

    h:outputText value="#{state.id}"/
    /h:column
    h:column
    f:facet name="header"
    h:outputText value="name" /
    /f:facet

    h:outputText value="#{state.name}"/
    /h:column
    /t:dataTable

    t:dataScroller id="scroller1"
    for="tab1"

    fastStep="5"
    f:facet name="first"
    h:outputText value="|" /
    /f:facet
    f:facet name="last"
    h:outputText value="|" /
    /f:facet
    f:facet name="previous"
    h:outputText value="" /
    /f:facet
    f:facet name="next"
    h:outputText value="" /
    /f:facet
    f:facet name="fastforward"
    h:outputText value="" /
    /f:facet
    f:facet name="fastrewind"
    h:outputText value="" /
    /f:facet

    /t:dataScroller

    /h:form
    /f:view

    DB:3.15:Strange Behavior With Datascroller In Myfaces's Tomahawk. ms

    hi

    i have an strange problem using MyFaces's tomahawk.

    in the code listed below you can find a dataScroller configured to use a dataTable placed above it.
    the first time that the page is called, everything works well.
    but when click on any links in the dataScroller, for example when i click on next link
    the dataScroller's first,next and ... are not displayed.!!!

    i am using Apache Tomcat/5.0.19
    with :

    tomahawk-1.1.5.jar
    jsf-impl.jar
    jsf-api.jar
    bcel.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload-1.2.jar
    commons-io-1.3.1.jar
    commons-logging.jar
    standard.jar
    jstl.jar

    help me, please!!!

    %@ page session="false" contentType="text/html; charset=utf-8"%
    %request.setCharacterEncoding("utf8");%

    %@taglib uri="http://java.sun.com/jsf/core" prefix="f"%
    %@taglib uri="http://java.sun.com/jsf/html" prefix="h"%

    %@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%

    %@include file="inc/head.inc" %

    f:view

    h:form

    t:dataTable id="tab1" rows="3"
    value="#{report.postList}" var="state"
    h:column

    f:facet name="header"
    h:outputText value="id" /
    /f:facet

    h:outputText value="#{state.id}"/
    /h:column
    h:column
    f:facet name="header"
    h:outputText value="name" /
    /f:facet

    h:outputText value="#{state.name}"/
    /h:column
    /t:dataTable

    t:dataScroller id="scroller1"
    for="tab1"

    fastStep="5"
    f:facet name="first"
    h:outputText value="|" /
    /f:facet
    f:facet name="last"
    h:outputText value="|" /
    /f:facet
    f:facet name="previous"
    h:outputText value="" /
    /f:facet
    f:facet name="next"
    h:outputText value="" /
    /f:facet
    f:facet name="fastforward"
    h:outputText value="" /
    /f:facet
    f:facet name="fastrewind"
    h:outputText value="" /
    /f:facet

    /t:dataScroller

    /h:form
    /f:view

  • RELEVANCY SCORE 3.14

    DB:3.14:Java.Lang.Noclassdeffounderror: Org/Apache/Commons/Mail/Simpleemail pj


    Hi all,
    i tried to implement Mail using SimpleEmail class of org/apache/commons/mail/SimpleEmail.i imported commons-email-1.0.jar and Email.jar into my sevlets project.

    After deploying and runnig it is giving the following error

    java.lang.NoClassDefFoundError: org/apache/commons/mail/SimpleEmail
    DBActions.sendEmail(DBActions.java:68)
    LoginPage.doGet(LoginPage.java:27)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    Regards
    Padma

    DB:3.14:Java.Lang.Noclassdeffounderror: Org/Apache/Commons/Mail/Simpleemail pj

    Do you have the jar in the WEB-INF/lib directory of your web application?

    Adding a jar to the project will only take care of compilation problems, as far as I know.

  • RELEVANCY SCORE 3.14

    DB:3.14:Swing Ftp Problem am


    Hi Guys,

    I've got an issue with a swing application I've written. I have very little experience with swing and so I don't know where to look for any of the answers. To summarize, I've created a swing application using Netbeans which attempts to ftp some files to an ftp server on the click on a button. Its a very simple test application. It works perfectly fine on my machine but when I port the project onto a colleagues machine the application hangs when initiating the upload (clicking the button).

    So specifics; I'm running mac osx 10.4, with jdk 1.5, netbeans 6.5. He's on a windows xp machine, running jdk 1.6 and using netbeans 6.5. We're using the apache commons net jars. The code we're trying to run is;

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    System.out.println("Initiate");
    FTPClient client = new FTPClient();

    try {
    client.connect("server");
    client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

    client.login("username", "pass");
    client.makeDirectory("testDIR");
    client.changeWorkingDirectory("testDIR");

    File file = new File("/Users/user/Desktop/testDIR");
    File[] fileArray = file.listFiles();

    client.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE);
    client.enterLocalPassiveMode();

    for(int i = 0; i fileArray.length; i++){
    client.storeFile(fileArray.getName(), new FileInputStream(fileArray[i]));
    System.out.println("fileArray[i].getName() = "+fileArray[i].getName());
    }

    client.logout();
    client.disconnect();

    } catch (SocketException e) {
    e.printStackTrace();
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }
    }
    When running this on Netbeans in a main method stand alone it works perfectly fine, on both machines. But as soon as we create a swing project and attach this to an action event on a button it just hangs. Just in case that is not clear, what I do in Netbeans is, right-click on a jButton Events Action jButton1ActionPerformed. After I'm done adding the code, the method looks like the above.

    So why would it work on my machine and not his? We're both on the same network, we're both running Netbeans. The only thing I could think of is the version of java. We're currently in the process of requesting a java 1.5 install on the windows machine, but in the meantime, is there anything else we could look at? I would feel more comfortable if my colleague could not upload at all. However he can upload when using the standalone class, but for some reason it fails when using swing.

    Not being a swing developer I would greatly appreciate the input of anyone with some experience. Its probably going to be something very trivial, but without having to spend a good few weeks learning swing I don't see how we are going to solve this problem.

    Cheers

    Edited by: Aegis1888 on Sep 30, 2009 9:29 AM

    DB:3.14:Swing Ftp Problem am

    Thanks for the advice. That's a very useful resource which I'll be passing on to the other developers here. It helped to strip down the code and remove the possibility of some of the other problems. I'm managed to narrow it down to two clases; One is the application panel FTPTestAppView and the other is simply a main method that runs it;

    package ftp.example;

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.SocketException;

    import org.apache.commons.net.PrintCommandListener;
    import org.apache.commons.net.ftp.FTPClient;
    import org.jdesktop.application.FrameView;
    import org.jdesktop.application.SingleFrameApplication;

    /**
    * The application's main frame.
    */
    public class FTPTestAppView extends FrameView {

    public FTPTestAppView(SingleFrameApplication app) {
    super(app);

    initComponents();
    }

    private void initComponents() {

    mainPanel = new javax.swing.JPanel();
    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();

    mainPanel.setName("mainPanel"); // NOI18N

    jPanel1.setName("jPanel1"); // NOI18N

    jButton1.setText("Test"); // NOI18N
    jButton1.setName("jButton1"); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    }
    });

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .add(jButton1)
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
    .addContainerGap(37, Short.MAX_VALUE)
    .add(jButton1)
    .add(34, 34, 34))
    );

    org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(
    mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(mainPanelLayout.createSequentialGroup()
    .add(106, 106, 106)
    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(179, Short.MAX_VALUE))
    );
    mainPanelLayout.setVerticalGroup(
    mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(mainPanelLayout.createSequentialGroup()
    .add(51, 51, 51)
    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(89, Short.MAX_VALUE))
    );

    setComponent(mainPanel);
    }

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    System.out.println("Initiate");
    FTPClient client = new FTPClient();

    try {
    client.connect("server");
    client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

    client.login("username", "password");
    client.makeDirectory("testDIR");
    client.changeWorkingDirectory("testDIR");

    File file = new File("/Users/username/Desktop/testDIR");
    File[] fileArray = file.listFiles();

    client.setFileType(org.apache.commons.net.ftp.FTP.BINARY_FILE_TYPE);
    client.enterLocalPassiveMode();

    for(int i = 0; i fileArray.length; i++){
    client.storeFile(fileArray.getName(), new FileInputStream(fileArray[i]));
    System.out.println("fileArray[i].getName() = "+fileArray[i].getName());
    }

    client.logout();
    client.disconnect();
    } catch (SocketException e) {
    e.printStackTrace();
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }

    }

    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel mainPanel;

    }

    package ftp.example;

    import org.jdesktop.application.Application;
    import org.jdesktop.application.SingleFrameApplication;

    /**
    * The main class of the application.
    */
    public class FTPTestApp extends SingleFrameApplication {

    /**
    * At startup create and show the main frame of the application.
    */
    @Override protected void startup() {
    show(new FTPTestAppView(this));
    }

    /**
    * This method is to initialize the specified window by injecting resources.
    * Windows shown in our application come fully initialized from the GUI
    * builder, so this additional configuration is not needed.
    */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
    * A convenient static getter for the application instance.
    * @return the instance of FTPTestApp
    */
    public static FTPTestApp getApplication() {
    return Application.getInstance(FTPTestApp.class);
    }

    /**
    * Main method launching the application.
    */
    public static void main(String[] args) {
    launch(FTPTestApp.class, args);
    }
    }

    The code was originally auto generated in netbeans, i narrowed it down as much as I could, but there may still be some comments or needless lines of code. Obviously you'll need an ftp server of some sort to test with, however with the dependencies you could run that application without the need to do anything else. The dependencies are;

    - appframework-1.0.3.jar
    - swing-layout-1.0.3.jar
    - swing-worker-1.1.jar
    - commons-net-ftp-2.0.jar

    I know this is strictly not SSCCE, buts its the closest I could get it. Besides I don't think a few dependencies are going to cause people here any real trouble. Please let me know if you require anything else.

    Thanks in advance.

    ps: Just had a look at my original post and it may not have been very clear, but the windows machine is running jdk 1.6 and the mac is running 1.5. That is the only difference.

  • RELEVANCY SCORE 3.12

    DB:3.12:Ftp Connection And Creating Folders 3f


    Hi!,

    I'm using FTPClient class to ftp files from my local computer to a remote server.

    My problem is that sometimes I will need to create folders in the remote server to send some files to them.

    How can I do it ?

    Thanks!
    Tatiana

    DB:3.12:Ftp Connection And Creating Folders 3f

    "MKD" is the command, but you should probably verify that the FTP server allows that first.

  • RELEVANCY SCORE 3.11

    DB:3.11:Problem In Ssl Client Authentication Using Apache-Commons-Httpclient Api xk


    Hi everyone !

    here is my problem:

    *1 -* I'm failing to do SSL Client Authentication using Apache-Commons-HTTPClient API v 3.0.
    *2 -* But I'm successful in doing SSL Server Authentication using Apache-Commons-HTTPClient API v3.0

    I'm using JDK v-1.5.0_06

    Following are my steps for 2:
    I have override the following settings of JRE for SSL Server Auth:

    System.setProperty( "javax.net.ssl.trustStore" , this.sslKeystoreFilePath);
    System.setProperty( "javax.net.ssl.trustStorePassword" , this.sslKeystorePassword );
    System.setProperty( "java.protocol.handler.pkgs" , "com.sun.net.ssl.internal.www.protocol" );
    Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() );and Its doing fine.

    But I don't find any useful class to do SSL Client Authentication.

    I know the way to do SSL Client Authentication using pure JSSE i.e.

    getCertsAndKeysFromPFXWithJSSE(); //Getting Keys and Certs from PFX using JSSE
    SSLContext sc = SSLContext.getInstance("SSL");
    sc.init(kmf.getKeyManagers(), null, null); //kmf=KeyManagerFactory
    SSLSocketFactory f = sc.getSocketFactory();
    SSLSocket c = (SSLSocket) f.createSocket(url, port);
    //Enabling Client Authentication
    c.setNeedClientAuth(true);
    printSocketInfo(c);
    sendRequest("hello".getBytes(), c, url);This code is also working fine.

    But I'm unable to perform the same task using Apache-Commons-HTTPClient API v 3.0. [I have to use this API]

    please help me in this regard.

    br

    KS

    DB:3.11:Problem In Ssl Client Authentication Using Apache-Commons-Httpclient Api xk

    getCertsAndKeysFromPFXWithJSSE();
    i need full code if u can

    i have problem to using .cer file to connect to https

  • RELEVANCY SCORE 3.10

    DB:3.10:Upload A Text File From Vb.Net Code By Using Apache Fileupload Commons zf


    Hi
    I am facing a gr8 problem.

    I am sending a HTTP request POST from a .vb.net code to a JSP file using content-type=multipart/,,,,,,

    I am using Apache commons to upload the file and place it on the server. The file upload code is unable to parse the request. Any help please

    Thanks

    DB:3.10:Upload A Text File From Vb.Net Code By Using Apache Fileupload Commons zf

    Hi
    I am facing a gr8 problem.

    I am sending a HTTP request POST from a .vb.net code to a JSP file using content-type=multipart/,,,,,,

    I am using Apache commons to upload the file and place it on the server. The file upload code is unable to parse the request. Any help please

    Thanks

  • RELEVANCY SCORE 3.06

    DB:3.06:Re: Problem In Running Application(Using Adf) On Bea Weblogic Server d3


    java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap$KeySet
    at org.apache.commons.collections.FastHashMap.keySet(Unknown Source)

    I would start by first checking that all required lib's are in place for the aplication.

    DB:3.06:Re: Problem In Running Application(Using Adf) On Bea Weblogic Server d3

    Hi Eric,
    1)What type mappings are you using to create BC4J Applications? If you are using Oracle Type Mappings, then the correct jar (bc4jdomorcl.jar) needs to be available in the classpath. If you are using Java type mappings the bc4jdomgnrc.jar should be used instead. By default, the bc4jdomgnrc jar is added to the setup.adf file. Could you please replace the classpath entry to point to :
    set CLASSPATH=%CLASSPATH%;..\..\..\weblogic81\ADF\lib\bc4jdomorcl.jar
    and restart the server and test your application and see if the error reproduces?

    2)Although 10.1.3 recommends usage of jdk 1.5, it does not stop you from creating applications based on jdk 1.4. That way, you can get to use the latest and cool features of 10.1.3. This is especially true in the case of ADF, which has a whole bunch of new features. Have a look at this link:
    http://download-west.oracle.com/otn_hosted_doc/jdeveloper/1013/adfdevguide.pdf

    Section 22.8.3 deals with the deploy 10.1.3 based ADF applications in Weblogic 8.x

    Thanks
    Prasanth

  • RELEVANCY SCORE 3.05

    DB:3.05:Migration From Weblogic 9.2 To 11.G c7


    Hi

    I am trying to migrate from weblogic 9.2 to 11.g and I am getting the follwoing error :

    'weblogic.kernel.Default (self-tuning)'] - java.lang.NoSuchMethodError: org/apache/commons/pool/impl/GenericObjectPoolFactory.init(Lorg/apache/commons/pool/PoolableObjectFactory;IBJIIZZJIJZJZ)V

    My application is using commons-pool-1.4.jar and weblogic 11g is loading com.bea.core.apache.commons.pool_1.3.0 version from /apps/weblogic/Oracle/Middleware/modules

    How do I resolve this. I have a startup servlet class which will create a pool of objects using commons-pool-1.4 APIs.

    regards
    Hari

    Edited by: 997435 on 02-Apr-2013 00:50

    DB:3.05:Migration From Weblogic 9.2 To 11.G c7

    You can use filtering classloaders - http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm#i1097930

    Some examples are given here: http://middlewaremagic.com/weblogic/?p=6725 (see the "Manipulating class loading" section).

  • RELEVANCY SCORE 3.04

    DB:3.04:Installation Problems 89



    Dear JSF users,I've been spending 2 days trying to install JSF rich faces on my JBoss Server. I think the problem is that some libraries of JSF reference other Apache libraries. For example I get a ClassNotFoundError with
    java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LazyMap

    DB:3.04:Installation Problems 89


    1) Supported servers mentioned in our dev guide2) If you place all the libraries(JSF RF etc..) to Web-inf/lib - use

    context-param
    param-nameorg.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL/param-name
    param-valuetrue/param-value
    /context-param

  • RELEVANCY SCORE 3.02

    DB:3.02:Tomcat 4.1 Oracle Blob Problem Using Apache Commons Dbcp 1s


    Hi all,

    We are using Tomcat 4.1.12, Java 1.4.x and trying to take advantage of the connection pooling that comes with Tomcat(the apache commons DBCP).
    We are connecting to a oracle database.

    Works fine for everything EXCEPT Blobs. We have a servlet that serves images from Oracle, that works fine when it doesn't use the connection pooling, but throws an exception when we call the

    ERROR: Class:DisplayGraphic Method:processRequest(HttpServletRequest request, Ht
    tpServletResponse response)
    Exception: org.apache.commons.dbcp.DelegatingResultSet
    DataSource ds = (DataSource)ctx.lookup("jdbc/db_connection");
    Connection conn = ds.getConnection();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    pstmt = conn.prepareStatement("SELECT graphic FROM graphics WHERE graphic_id = 1");
    rs = pstmt.executeQuery();
    if(rs.next())
    {
    oracle.sql.BLOB oBlob = ((OracleResultSet) oRS).getBLOB("GRAPHIC");
    InputStream oIS = oBlob.getBinaryStream();
    ... etc etc...
    }Any ideas?

    Cheers,
    Alex.

    DB:3.02:Tomcat 4.1 Oracle Blob Problem Using Apache Commons Dbcp 1s

    solved the problem.. i was using getBLOB instead of
    getBlob

    doh..Hi Alex,
    your problem is very interesting for me because I have a similar problem and your identical configuration...

    the instruction

    oracle.slq.BLOB aBlob = ((OracleResultSet)super.mRs).getBLOB("BLOBBONE")

    causes this:

    java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingResultSet

    To resolve this, I changed, in server.xml , the factory

    parameter
    namefactory/name
    valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
    /parameter

    with:

    parameter
    namefactory/name
    valueoracle.jdbc.pool.OracleDataSourceFactory/value
    /parameter

    and magically all works fine...
    But the question is... Why doesn't it work with the standard factory???
    There is a problem in the CLASSPATH that I don't see?

    Any suggestions is welcome!

    Thanks in advance!

    Giselda

  • RELEVANCY SCORE 3.02

    DB:3.02:Use Log4j Logging Instead Of Apache Commons Logging z3



    Hi

    I'm using hibernate tools in eclipise juno. When I generate DAO code it generates imports and logging code for apache commons logging. My project uses log4j, is there a way to change what logger is used in generated code?

    Thanks

    Mike

    DB:3.02:Use Log4j Logging Instead Of Apache Commons Logging z3


    Considering what is stated in apache common logging documentation:
    The commons-logging.jar file includes the JCL API, the default LogFactory implementation and thin-wrapper Log implementations for Log4J, Avalon LogKit, the Avalon Framework's logging infrastructure, JDK 1.4, as well as an implementation of JDK 1.4 logging APIs (JSR-47) for pre-1.4 systems.
    In most cases, including commons-logging.jar and your preferred logging implementation in the classpath should be all that is required to use JCL.

    you probably do not need to change anything, because generated classes should use log4j through common logging interface. If you need do use log4j classes directly, then there is a workaround for that, which includes:
    Copying dao/daohome.ftl template from hibernate-tools.jar to ${externalfolder}Change it to your needsConfigure template location property for exporter in Hibernate Code Generatiion Configuration dialog and point it to ${externalfolder} which contains dao/daohome.ftl file in it

  • RELEVANCY SCORE 3.01

    DB:3.01:Ftpclient 7f


    I've built a swing application that uses Jakarta Commons Net FTP classes to upload files to ftp website.(I am using NetBEANS 4.1)

    I extracted the commons-net-1.4.0.zip file to my src directory, and then added the commons-net-1.4.0.jar file to library path under project properties in NetBEANS...so far so good, I can run the program and it works fine from the NetBEANS studio..however when I try running the jar file that NetBEANS produces in "dist" directory,(eg. java - jar myGUIapp.jar) I get this error(look below) when I hit button to start ftp-ing. It seems like it cann't find the library, but it is added in the project, so how come it doesn't work?

    any ideas?

    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/net/f
    tp/FTPClient
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at changerates.HTMLRatesPageGenerator.GenerateHTML(HTMLRatesPageGenerator.java:111)
    at changerates.ChangeRates.jButton1ActionPerformed(ChangeRates.java:1295)
    at changerates.ChangeRates.access$000(ChangeRates.java:27)
    at changerates.ChangeRates$1.actionPerformed(ChangeRates.java:206)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

    DB:3.01:Ftpclient 7f

    Just a note: you can also use FTP URLs to upload your files and don't need any 3rd party libraries like Jakarta Commons Net FTP. Here's an example:

    /**
    * Upload a file to a FTP server. A FTP URL is generated with the following syntax:
    * codeftp://user:password@host:port/filePath;type=i/code.
    *
    * @param ftpServer FTP server address (incl. optional port ':portNumber').
    * @param user Optional user name to login.
    * @param pwd Optional password for iuser/i.
    * @param fileName Destination file name on FTP server (with optional preceeding relative path, e.g. "one/two/three.txt").
    * @param source Source file to upload.
    * @throws MalformedURLException, IOException on error.
    */
    public void upload(String ftpServer, String user, String pwd, String fileName, File source) throws MalformedURLException, IOException {
    if (ftpServer != null fileName != null source != null) {
    StringBuffer sb = new StringBuffer("ftp://");
    if (user != null pwd != null) { //need authentication?
    sb.append(user);
    sb.append(':');
    sb.append(pwd);
    sb.append('@');
    }//else: anonymous access
    sb.append(ftpServer);
    sb.append('/');
    sb.append(fileName);
    sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing

    BufferedInputStream bis = null;
    BufferedOutputStream bos = null;
    try {
    URL url = new URL(sb.toString());
    URLConnection urlc = url.openConnection();

    bos = new BufferedOutputStream(urlc.getOutputStream());
    bis = new BufferedInputStream(new FileInputStream(source.getName()));

    int i;
    while ((i = bis.read()) != -1) { //read next byte until end of stream
    bos.write(i);
    }//next byte
    } finally {
    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
    }
    }//else: input unavailable
    }//upload()

  • RELEVANCY SCORE 3.00

    DB:3.00:Jasperreports And Jrxmlloader.Load j9


    Hello,

    I am using iText, iReports and JasperReports to generate a PDF rapport. The stranges thing happens. When i make a windows application (local) the Class perfectly generates the PDF-file. ( a few warnings from WARNING: The 'rightBorderColor' attribute is deprecated. Use the pen tag instead.)

    But when i use the same code on a server (JSP-file) than i get this error in my Stack:
    [#|2008-03-04T13:18:31.656+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=52;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=1bf05493-0c11-442d-8110-819933062e30;|StandardWrapperValve[PrintServlet]: PWC1406: Servlet.service() for servlet PrintServlet threw exception
    java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151)
    at PrintServlet.processRequest(PrintServlet.java:45)
    at PrintServlet.doGet(PrintServlet.java:106)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
    at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)Now i have read that the problem should be in my classpath. I have added the following jars to it, but with no result:
    commons-beanutils-1.7.jar
    commons-digester-1.7.jar
    commons-javaflow-20060411.jar
    commons-collections-2.1.jar
    poi-3.0.1-FINAL-20070705.jar
    acrobat.jar
    jasperreports-2.0.4-applet.jar
    jasperreports-2.0.4.jar
    commons-logging-1.0.2.jarWhat could this be? The server is a Windows 2003 server

    Edited by: TouringBMW on Mar 4, 2008 12:32 PM

    DB:3.00:Jasperreports And Jrxmlloader.Load j9

    You're right, but also the order in which the jars are presented in the your ant files is crusial. The common-digister.jar file can be a pain. If you put the commons-file in the top order you also have a change that it works. I think it has something to do with inheritence.

  • RELEVANCY SCORE 2.93

    DB:2.93:Ftp Windows 98 Problem 99


    I'm using jarkarta's commons.net implementation of FTPclient in a java desktop application. Seems to work great. I have one client however that is able to connect to the ftp site, the replyStrings are kosher and there are no exceptions, signon and what not is fine, and when the retrieveFile command is run, false is returned. the file is not transferred. There is no exception. Does anyone know why a false would be returned without there being one of the listed exceptions?
    The client also has 5 windows 98 machines. It works on 4.
    I know this is a long shot but does anyone have any insights on Windows 98 and ftp? (besides updgrade the os ofcourse). Reinstall drivers?

    Here is the API Linkhttp://jakarta.apache.org/commons/net/apidocs/org/apache/commons/net/ftp/FTPClient.html

    DB:2.93:Ftp Windows 98 Problem 99

    If you not found the solution, you can use instead the edtftpj ftp client library. It
    is very easy to use, works fine and reports exceptions.

    Bye

  • RELEVANCY SCORE 2.92

    DB:2.92:Load Jar To Oracle Throw Errors 33


    hi,
    I tried to load jar to to oracle 11g Release 1 using command
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl-2.0.1.jar
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl-2.0.1-sources.jar
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl.jar
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-logging-1.1.1.jar
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl-2.0.1.jar

    I got the following error
    ============================================================================================================================

    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl-2.0.1.jar

    errors : class org/apache/commons/jexl2/scripting/JexlScriptEngine$1
    ORA-29534: referenced object SYSTEM.org/apache/commons/jexl2/scripting/JexlScriptEngine could not be resolved
    errors : class org/apache/commons/jexl2/scripting/JexlScriptEngine$EngineSingletonHolder$1
    ORA-29534: referenced object SYSTEM.org/apache/commons/jexl2/scripting/JexlScriptEngine could not be resolved
    errors : class org/apache/commons/jexl2/scripting/JexlScriptEngine$EngineSingletonHolder
    ORA-29534: referenced object SYSTEM.org/apache/commons/jexl2/scripting/JexlScriptEngine could not be resolved
    errors : class org/apache/commons/jexl2/scripting/JexlScriptEngine$FactorySingletonHolder
    ORA-29534: referenced object SYSTEM.org/apache/commons/jexl2/scripting/JexlScriptEngineFactory could not be resolved
    errors : class org/apache/commons/jexl2/scripting/JexlScriptEngine$JexlCompiledScript
    ORA-29521: referenced name javax/script/ScriptException could not be found

    ===============================================================================================================================
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl-2.0.1-sources.jar

    Error while creating source org/apache/commons/jexl2/Debugger
    ORA-29533: attempt to overwrite class or resource org/apache/commons/jexl2/Debugger while defining or compiling SYSTEM.org/apache/commons/jexl2/Debugger
    ORA-06512: at line 1

    Error while creating source org/apache/commons/jexl2/DebugInfo
    ORA-29533: attempt to overwrite class or resource org/apache/commons/jexl2/DebugInfo while defining or compiling SYSTEM.org/apache/commons/jexl2/DebugInfo
    ORA-06512: at line 1

    Error while creating source org/apache/commons/jexl2/Expression
    ORA-29533: attempt to overwrite class or resource org/apache/commons/jexl2/Expression while defining or compiling SYSTEM.org/apache/commons/jexl2/Expression
    ORA-06512: at line 1

    ====================================================================================================================
    loadjava.bat -user sys/password -resolve -synonym D:\javaToOracle\NEW\LIB\commons-jexl.jar

    errors : class org/apache/commons/jexl/junit/Asserter
    ORA-29521: referenced name junit/framework/Assert could not be found
    The following operations failed
    class org/apache/commons/jexl/junit/Asserter: resolution
    exiting : Failures occurred during processing

    ==========================================================================================================================

    loadjava.bat -user system@qtest -resolve -synonym D:\javaToOracle\NEW\LIB\commons-logging-1.1.1.jar

    errors : class org/apache/commons/logging/impl/AvalonLogger
    ORA-29521: referenced name org/apache/avalon/framework/logger/Logger could not be found
    errors : class org/apache/commons/logging/impl/LogKitLogger
    ORA-29521: referenced name org/apache/log/Hierarchy could not be found
    ORA-29521: referenced name org/apache/log/Logger could not be found
    errors : class org/apache/commons/logging/impl/ServletContextCleaner
    ORA-29521: referenced name javax/servlet/ServletContextListener could not be found
    ORA-29521: referenced name javax/servlet/ServletContextEvent could not be found
    The following operations failed
    class org/apache/commons/logging/impl/AvalonLogger: resolution
    class org/apache/commons/logging/impl/LogKitLogger: resolution
    class org/apache/commons/logging/impl/ServletContextCleaner: resolution
    exiting : Failures occurred during processing
    ====================================================================

    can u plese help to resolve this problem,
    Regrds
    nalananda

    DB:2.92:Load Jar To Oracle Throw Errors 33

    hi

    when I go through the user guide http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm.I came across

    _1.1.5.4 OracleJVM Ease-of-Use: JDK-Like Interface_ By using this feature,can I overcome the class resolving issue?

    Thanks

  • RELEVANCY SCORE 2.91

    DB:2.91:Writing Ftpclient Using Java d7


    When uploading a file from FtpClient program through Java, to to existing FTPServer, the file gets uploaded succesfully if there is no interruption.

    The problem arises when the Client could not connect to Server. The file that has been uploaded upto that point gets deleted...

    DB:2.91:Writing Ftpclient Using Java d7

    The FTP Server that i am using is the built in one that comes along with IIS. Can you explain me the required settings so that the uploaded file does not get deleted when the connection no longer exists.

  • RELEVANCY SCORE 2.91

    DB:2.91:Ftpclient.Namelist(Ftpclient.Pwd):Check For 0 Records jf


    Hi,
    I am writing a code to download files from a particular location using FtpClient. I get FileNotFoundException if the specified location has no files in it.The code snippet is as follows

    P.Note:serverIP,username,password,relBaseDir - input from screen

    FtpClient ftpClient = new FtpClient(serverIP);
    ftpClient.login(username,password);
    client.cd(relBaseDir);
    TelnetInputStream tnetInputStream = ftpClient.nameList(ftClient.pwd);
    /* Exception is thrown here as relBaseDir has no files in it. */

    Thanks in advance,
    Smitha

    DB:2.91:Ftpclient.Namelist(Ftpclient.Pwd):Check For 0 Records jf

    FtpClient ftpClient = new FtpClient(serverIP);
    ftpClient.login(username,password);
    client.cd(relBaseDir);
    TelnetInputStream tnetInputStream = ftpClient.nameList(ftClient.pwd);
    /* Exception is thrown here as relBaseDir has no files in it. */

    Thanks in advance,
    Smitha1) Why haven't you paste real code?
    This won't compile: ftpClient != client != ftClient

    2) Are you using Apache commons? In that case: pwd() != pwd

  • RELEVANCY SCORE 2.89

    DB:2.89:Org/Apache/Commons/Net/Ftp/Ftpclient Problem 8f


    Hi,

    I am trying to send a file to my webserver thru FTP. I have created a class that will send the file to the server. I have it tested and it worked fine. When I used the class as a Java bean in my JSP I encounter this error:

    type Exception report

    message Internal Server Error

    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: org/apache/commons/net/ftp/FTPClient
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:246)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
    at java.lang.Thread.run(Thread.java:536)

    root cause

    javax.servlet.ServletException: org/apache/commons/net/ftp/FTPClient
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
    at org.apache.jsp.autoloadfile_jsp._jspService(autoloadfile_jsp.java:81)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:202)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
    at java.lang.Thread.run(Thread.java:536)

    Below is my Java class for FTPing the file to the server:

    ************************************
    import org.apache.commons.net.ftp.*;
    import java.io.IOException;
    import java.io.*;
    import java.text.DateFormat;
    import java.util.Date;
    import java.net.SocketException;

    public class ftpfile
    {

    FTPClient ftp = null;
    private String server = null;
    private String username = null;
    private String pwd = null;
    private String serverdir = null;
    private String filename = null;

    public void connectftp() throws SocketException, IOException, Exception
    {

    try
    {
    ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(username,pwd);
    ftp.changeWorkingDirectory(serverdir);
    }
    catch (SocketException e)
    {
    throw new Exception("A socket connection problem occurs");
    }
    catch (IOException e)
    {
    throw new Exception("An IO problem occurs");
    }
    catch (Exception e) {e.printStackTrace();}
    }

    public void disconnectftp() throws IOException, Exception
    {
    try
    {
    if (ftp!=null)
    {
    ftp.logout();
    ftp.disconnect();
    }
    }
    catch (IOException e)
    {
    throw new Exception("An IO Exception occured");
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    }

    public void uploadfile() throws IOException, Exception
    {
    String filenameonly = null;

    try
    {

    ExtractFileName extractfile = new ExtractFileName();
    extractfile.setFilepath(this.filename);
    filenameonly = extractfile.getFileName();
    File file = new File(filename);
    FileInputStream fis = new FileInputStream(file);
    ftp.appendFile(filenameonly,fis);
    fis.close();
    }
    catch (IOException e) { throw new Exception("An IO Exception occured");}
    catch (Exception e) {e.printStackTrace();}
    }

    /*Setters and getter*/

    public void setServer(String server)
    {
    this.server = server;
    }

    public String getServer()
    {
    return this.server;
    }

    public void setUsername(String username)
    {
    this.username = username;
    }

    public String getUsername()
    {
    return this.username;
    }

    public void setPwd(String pwd)
    {
    this.pwd = pwd;
    }

    public String getPwd()
    {
    return this.pwd;
    }

    public void setServerdir(String serverdir)
    {
    this.serverdir = serverdir;
    }

    public String getServerdir()
    {
    return this.serverdir;
    }

    public void setFilename(String filename)
    {
    this.filename = filename;
    }

    public String getFilename()
    {
    return this.filename;
    }
    }

    **************************

    Below is my jsp file:
    ************************************
    %@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %
    html
    head
    titleUntitled Document/title
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
    /head
    jsp:useBean id="ftp" class="ftpfile"/
    %
    ftp.setServer("myserver");
    ftp.setUsername("test");
    ftp.setPwd("testpwd");
    ftp.setServerdir("/usr/local/mytestfolder/");
    ftp.setFilename("c:\\temp\\mast.txt");
    ftp.connectftp();
    ftp.uploadfile();
    ftp.disconnectftp();
    %
    body
    Uploading File!!!
    /body
    /html
    **********************

    Why is that when I tested my class it worked but when I used it in JSP it gives me error.

    Thanks in advance!!!

    rgds,

    Noynoy

    DB:2.89:Org/Apache/Commons/Net/Ftp/Ftpclient Problem 8f

    Please put your code in the tags described here.

    Make sure that those ftp classes are on the classpath. And try putting your bean class into a package.

    Hope this helps, let us know if it doesn't.

  • RELEVANCY SCORE 2.88

    DB:2.88:Ftpclient From Commons Net - Works On Windows, Not On Fedora mj


    Hi,
    I have an application that uses the FTPClient class to connect to a server and download some files. This application is being developed on a Windows box and it works fine from there.
    But when I port the application to a Fedora Core 4 env, it seems to not work. FTPClient lets the app log in and move around in the directory structure, but when the listFiles() command is invoked, the files are not seen. I am certain there are files in that directory (and it shows on Windows env).

    Could anyone tell me what the problem could be here??
    Thanks,
    -Riz.

    DB:2.88:Ftpclient From Commons Net - Works On Windows, Not On Fedora mj

    Case closed.
    For anyone who comes across this issue in the future...
    FTPClient defaults to active mode. Our server which is running the application does not accept incoming connections (except on a few ports), so I needed to change FTPClient mode to passive.

    Thanks,
    -Rizwan Merchant.

  • RELEVANCY SCORE 2.88

    DB:2.88:Vmw Server 2 Web Gui Doesn't Listen On 8222 Or 8333 c7


    Hi all, I have been installed a VMW server 2 X86_64 in a ubuntu 7.10 (Gutsty) server, all the process of installation and configuration follows normally, but at the end of these, when I try to access the admin interface, it's doesn't listen on any port (8222 or 8333), so I see if the server is listening on this ports using a netstat -puta and I can see that here is the problem, then I seach in the syslog any information that can help me to detect the problem and I found the following, can somebody help me please??

    Apr 14 16:28:09 centuri-BD watchdog-webAccess: '/usr/lib/vmware/webAccess/java/jre1.5.0_15/bin/webAccess -client -Xmx64m -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/common/endorsed -classpath /usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/bootstrap.jar:/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/commons-logging-api.jar -Dcatalina.base=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Dcatalina.home=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Djava.io.tmpdir=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start' exited after 0 seconds (quick failure 5)

    Apr 14 16:28:09 centuri-BD watchdog-webAccess: Executing '/usr/lib/vmware/webAccess/java/jre1.5.0_15/bin/webAccess -client -Xmx64m -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/common/endorsed -classpath /usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/bootstrap.jar:/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/commons-logging-api.jar -Dcatalina.base=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Dcatalina.home=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Djava.io.tmpdir=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start'

    Apr 14 16:28:09 centuri-BD watchdog-webAccess: '/usr/lib/vmware/webAccess/java/jre1.5.0_15/bin/webAccess -client -Xmx64m -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/common/endorsed -classpath /usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/bootstrap.jar:/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/commons-logging-api.jar -Dcatalina.base=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Dcatalina.home=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Djava.io.tmpdir=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start' exited after 0 seconds (quick failure 6)

    Apr 14 16:28:09 centuri-BD watchdog-webAccess: End '/usr/lib/vmware/webAccess/java/jre1.5.0_15/bin/webAccess -client -Xmx64m -XX:MinHeapFreeRatio=30 -XX:MaxHeapFreeRatio=30 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/common/endorsed -classpath /usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/bootstrap.jar:/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/bin/commons-logging-api.jar -Dcatalina.base=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Dcatalina.home=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16 -Djava.io.tmpdir=/usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/temp org.apache.catalina.startup.Bootstrap start', failure limit reached

    Apr 14 16:28:09 centuri-BD VMware[init]: /etc/init.d/vmware: line 80: 5754 Bus error "$func" "$@"

    DB:2.88:Vmw Server 2 Web Gui Doesn't Listen On 8222 Or 8333 c7


    Tks for your collaboration...but unafortunately..my server hard disk crash down I now I will have to reinstall it...now I will be gonna install the lastest version of Debian..(lenny) becuase in it VMW runs without problems..tks again for your time..and help...thats nice to know that exists people that can help you in this community....

    Best Regards....

  • RELEVANCY SCORE 2.88

    DB:2.88:Secure Ftp - Ftp Over Ssl 8f


    I am newbie and I have to implement secure Ftp to transfer files. My existing FTP implementation- FTPClient is using the jakarta commons(apache), with jdk 1.4.

    -- Now if I use the FTPSClient supported by jakarta, that will need commons-net 2.0 jar - and that runs on jdk5.0. But, this will require altogether moving the entire existing application from jdk 1.4 to 5.0.!!

    Can you suggest how big is the change moving from jdk1.4 to jdk 5.0 ?

    -- To use some other free libraries that support secure FTP - FTPS.

    Do you know other free lib available to support FTP over SSL?

    Thanks for all help.

    DB:2.88:Secure Ftp - Ftp Over Ssl 8f

    commons-net-2.0.jar is available directly from apache.org. I would view all other sources with suspicion unless they are Apache mirrors.

  • RELEVANCY SCORE 2.86

    DB:2.86:Java.Lang.Noclassdeffounderror: Lorg/Apache/Commons/Logging/Log; dp


    I get this error when trying to create a pdf using JasperReports. The commons-loggin jar is definitely in the classpath though... and I don't see any duplicates of the jar that could potentially cause problems. Any ideas?

    thanks

  • RELEVANCY SCORE 2.85

    DB:2.85:How To Read The File From Ftp Server cm


    Hi
    I need to read a file from a ftp server . Iam using apache lib common-net .jar .
    FTPClient ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(username,password);

    FTPFile[] files = ftp.listFiles();
    for(int i=0 ;ifiles.length;i++){
    System.out.println(" File : "+ i + " - " + files);
    }
    InputStream ip = ftp.retrieveFileStream(path);

    I got the inputstream from the ftp server. but iam not able to read the contents of the file ....

    help me plzzzzz

    DB:2.85:How To Read The File From Ftp Server cm

    Hi
    I have one more problem . first i try to read the file and write the file in local directory . then i try to read the data in the remote file .. iam getting the datas as null.

    InputStream ip = ftp.retrieveFileStream(path);

    File f = new File("D:\\ftp.txt");
    FileOutputStream fo = new FileOutputStream(f);
    byte[] buf = new byte[1024];

    while ((len = ip.read(buf)) 0) {
    fo.write(buf,0,len);
    }
    fo.close();

    BufferedReader br = new BufferedReader(new InputStreamReader(ip));
    String line;
    do {
    line = br.readLine();
    System.out.println(" data " +line);
    }while (line != null);

  • RELEVANCY SCORE 2.83

    DB:2.83:Noclassdeffounderror: Org/Apache/Commons/Logging/Logfactory 8a



    Hi,

    I am using BEA Workshop in BEA WebLogic Server 8.1 with SP1. When I try to start
    my pageflow
    I get the following error:

    NoclassdefFoundError: org/apache/commons/logging/LogFactory

    I verified that the common-logging.jar file is in $project/web-inf/lib. I am not
    sure what am I missing or is this a bug???

    Please reply ASAP.

    Thanks,
    Andy

    DB:2.83:Noclassdeffounderror: Org/Apache/Commons/Logging/Logfactory 8a

    Hi

    This appears to be a class loading issue.

    Although not a clean solution, one quick test would be to place the common-logging.jar in the classpath of the server. You can modify the startup script and add this as the first entry in the classpath and see if it still shows the issue.

    Thanks
    Vimala

  • RELEVANCY SCORE 2.82

    DB:2.82:No Action For Ftpclient Ftpclient = New Ftpclient() In Applet 7j


    Hi,
    I have noted the post:
    "Why would an applet die on FTPClient ftper = new FTPClient(); ??" from Greynault
    Greynault wrote:
    Well I don't know why I couldn't find that class, but I built it as a runnable Jar and now it works just fine.

    Frankly speaking, I really don't know how to solve the same problem for me

    my testApplet.java is as :
    =================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import org.apache.commons.net.ftp.*;

    public class testApplet extends JApplet implements ActionListener {
    private JPanel pane = null;
    private JScrollPane scrolling = null;
    private JTextPane fileBox = null;
    private JButton butLoad = null;
    private final String TEST = "test";
    private FTPClient ftpClient = null;

    public void init() {
    try {
    jbInit();
    }
    catch (Exception e) {
    e.printStackTrace();
    }
    }

    private void jbInit() throws Exception {
    pane = new JPanel();
    pane.setBounds(new Rectangle(0, 0, 500, 325));
    pane.setLayout(null);
    pane.setBorder(BorderFactory.createEtchedBorder( EtchedBorder.LOWERED));
    pane.setBackground(new Color(221, 194, 219));

    fileBox = new JTextPane();
    fileBox.setText("");
    fileBox.setEditable(false);
    scrolling = new JScrollPane(fileBox);
    scrolling.setBounds(new Rectangle(16, 65, 295, 225));

    butLoad = new JButton();
    butLoad.setBounds(new Rectangle(231, 23, 80, 30));
    butLoad.setText("Test");
    butLoad.setActionCommand(TEST);
    butLoad.addActionListener(this);

    pane.add(scrolling);
    pane.add(butLoad);
    setContentPane(pane);
    }

    public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals(TEST)) {
    fileBox.setText("before ftpClient = new FTPClient()");
    ftpClient = new FTPClient();
    fileBox.setText("ftpClient==null is " + (ftpClient == null));
    }
    }
    }
    ===============================================

    The MS Dos Window is as following

    C:\set path=C:\Program Files\Java\jdk1.6.0_02\bin

    C:\javac -classpath commons-net-1.4.1.jar testApplet.java

    C:\jar cvf testApplet.jar testApplet.class
    (create) manifest
    (create)UtestApplet.class (x(read)=2719)((write)=1477)(s(compressed) 45%)

    C:\

    ===============================================

    my testApplet.html as:

    html
    body
    applet code="testApplet.class" archive="testApplet.jar" width=500 height=325
    /applet
    /body
    /html

    ==================================================

    When I push the ' Test Button ',
    I get the message ' before ftpClient = new FTPClient() ' ,
    not as I expect the message ' ftpClient==null is false ' .
    That mean the process stop at ' ftpClient = new FTPClient(); '

    Somebody can give me some hint or idea ?

    NanFei

    DB:2.82:No Action For Ftpclient Ftpclient = New Ftpclient() In Applet 7j

    I add all class files of commons-net-1.4.1.jar into testApplet.jar ,
    then it work !

    NanFei

  • RELEVANCY SCORE 2.81

    DB:2.81:Applet On Remote Machine - No Class Definition Found c9


    I am facing a problem regarding Applet application.

    I have developed an applet that make a connection with server to transfer some data and for this I am using commons-httpclient-3.0.1.jar.

    But the application was giving me the error
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    Then I update the Manifest file with-in the applet's jar file, with property
    Class-Path: commons-httpclient-3.0.1.jar commons-logging-1.1.jar commons-codec-1.3.jar

    all these jar files are place on the root of the web application

    and i call the applet in the html as
    "APPLET ARCHIVE="TApplet.jar" CODE="A.B.TApplet.class" WIDTH=800 HEIGHT=700
    /APPLET"

    it works fine on my machine.......

    but when i try to access the applet from "some other machine" it gives me the error again
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    So i try to bundle all required packages by applet in the applet jar file to become one package to downloand and run on the client and keep the mainfest file same like
    Class-Path: commons-httpclient-3.0.1.jar commons-logging-1.1.jar commons-codec-1.3.jar

    but it doesn't work so i also try to change some other options like
    Class-Path: ./commons-httpclient-3.0.1.jar ./commons-logging-1.1.jar ./commons-codec-1.3.jar

    but I got the same error again and again
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    any suggestions please .....

    Thanx in advance
    Mansoor

    DB:2.81:Applet On Remote Machine - No Class Definition Found c9

    I am facing a problem regarding Applet application.

    I have developed an applet that make a connection with server to transfer some data and for this I am using commons-httpclient-3.0.1.jar.

    But the application was giving me the error
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    Then I update the Manifest file with-in the applet's jar file, with property
    Class-Path: commons-httpclient-3.0.1.jar commons-logging-1.1.jar commons-codec-1.3.jar

    all these jar files are place on the root of the web application

    and i call the applet in the html as
    "APPLET ARCHIVE="TApplet.jar" CODE="A.B.TApplet.class" WIDTH=800 HEIGHT=700
    /APPLET"

    it works fine on my machine.......

    but when i try to access the applet from "some other machine" it gives me the error again
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    So i try to bundle all required packages by applet in the applet jar file to become one package to downloand and run on the client and keep the mainfest file same like
    Class-Path: commons-httpclient-3.0.1.jar commons-logging-1.1.jar commons-codec-1.3.jar

    but it doesn't work so i also try to change some other options like
    Class-Path: ./commons-httpclient-3.0.1.jar ./commons-logging-1.1.jar ./commons-codec-1.3.jar

    but I got the same error again and again
    java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod

    any suggestions please .....

    Thanx in advance
    Mansoor

  • RELEVANCY SCORE 2.81

    DB:2.81:Ftp Connection Timeout Problem !!! ka


    hello,
    i use sun.net.ftp.FtpClient; for connecting to ftp and write this
    FtpClient ftp = new FtpClient();
    ftp.openServer(FTPSERVER);
    ftp.login(USER,PASSWORD);My problem is that i want to set timeout period to FtpClient while connecting to ftp.
    How can i solve this problem?
    i have to learn this...

    thanks for your answers.
    bye.

    Musa YILMAZ

    DB:2.81:Ftp Connection Timeout Problem !!! ka

    Hi,

    You shouldn't use Sun internal classes, do instead download an ftp library. There are a bunch of them which are free.

    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html

    /Kaj

  • RELEVANCY SCORE 2.80

    DB:2.80:Ftpclient - Stores Mp3 Files Defectly kx


    Hi!

    I'm working on a FTPClient and would like to store files on a FTP-Server. My Programm does save txt-files. But when it comes to store mp3 files it stores them in a wrong manner (file on server has the same size but I can't play it anymore - and the mp-player requests different codec).

    I'm using NetComponent's FTPClient-class. Here the part of the class which effects the upload and implements Serializable:

    input = new FileInputStream(upFile);
    ftp.storeFile(upFile.getName(),input);

    (ftp is an instance of the FTPClient() class, the method storeFile needs an InputStream)

    I have already tried to do this by using a ObjectInputStream but this caused an exception ("invalid stream header")

    I hope you can help me with that problem.

    Jonathan

    (Sorry for my english)

    DB:2.80:Ftpclient - Stores Mp3 Files Defectly kx

    Now it works with:

    setFileType(FTPClient.IMAGE_FILE_TYPE)

    Thank you US101!

  • RELEVANCY SCORE 2.79

    DB:2.79:Apache Commons Net - Ftp Problem xz


    Hi All!

    I would like to ask regarding Apache Commons Net - FTP: I am having an exception indicating: (After successful connection of FTP Server)

    Exception in thread "main" java.lang.NoClassDefFroundError: org/apache/oro/text/regex/MalformedPatternException
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
    at org.apache.commons.net.ftp.FTPClientlistFiles(FTPClient.java:2141)
    at org.apache.commons.net.ftp.FTPClientlistFiles(FTPClient.java:2188)
    at FTP_Sample.getFiles(FTP_Sample.java:17)
    at FTP_Sample.main(FTP_Sample.java:55)

    the code that is causing this exception is:
    FTPFile [] files=ftp.listFiles();

    Complete code of the Simple Program:

    import org.apache.commons.net.ftp.*;
    import java.util.*;
    import java.text.*;
    import java.io.*;

    class FTP_Sample{

    public void getFiles(String server, String un, String pw, String dir, String locDir, Calendar start, Calendar end){
    try{
    FTPClient ftp=new FTPClient();
    ftp.connect(server);
    ftp.login(un,pw);
    System.out.println("Connected to " + server + "!");
    System.out.println(ftp.getReplyString());

    ftp.changeWorkingDirectory(dir);
    FTPFile [] files=ftp.listFiles();

    //Codes for getting files here...

    ftp.logout();
    ftp.disconnect();

    }catch(Exception e){ e.printStackTrace(); }
    }

    public static void main(String args[]) throws IOException{

    String server="10.101.216.119";
    String un="door";
    String pw="knock";
    String dir="/appsvg3/i2doleproj/prod/intg/clogFileServer/clog_datafiles/ip/dp/dpLoadingErrors/";
    String locDir="C:\\I2";
    Calendar start=Calendar.getInstance();
    Calendar end=Calendar.getInstance();

    start.set(2007,03,15);
    end.set(2007,03,31);

    FTP_Sample ftps=new FTP_Sample();
    ftps.getFiles(server,un,pw,dir,locDir,start,end);
    System.out.println("FTP Transfer - Done!");
    }
    }

    Any Idea how to solve this problem?

    Thank you and God Bless,

    MaDz

    DB:2.79:Apache Commons Net - Ftp Problem xz

    Solved.

    You will need jakarta-oro-2.0.8.jar and to be safe include also jakarta-regexp-1.5.jar.

  • RELEVANCY SCORE 2.79

    DB:2.79:Ftp Not Freeing The Files mx


    hey,
    I am using the function which FTP the files to the client side. I am using the Apache FTPClient API to FTP files to the client FTp site.
    Now What I want is to when I am done with FTP move the files to local directory. But what is happening files are not moving and manually went to the Windows server and try to move the files manually and it showed error that this files is being used by the program. Out of 4 files lets 2 has this problem and remaining move successfuly. How can I free the files from FTP which is my guess that FTP is not freeing the

    Any idea will be appreciated.

    DB:2.79:Ftp Not Freeing The Files mx

    hey,
    I am using the function which FTP the files to the client side. I am using the Apache FTPClient API to FTP files to the client FTp site.
    Now What I want is to when I am done with FTP move the files to local directory. But what is happening files are not moving and manually went to the Windows server and try to move the files manually and it showed error that this files is being used by the program. Out of 4 files lets 2 has this problem and remaining move successfuly. How can I free the files from FTP which is my guess that FTP is not freeing the

    Any idea will be appreciated.

  • RELEVANCY SCORE 2.79

    DB:2.79:Org.Apache.Jasper.Jasperexception: Org/Apache/Commons/Digester/Digester dx


    I'm trying to generate jasper report from my jsp.

    i have tried it in with simple java class. its working fine but i tried to merge it
    with jsp, its showing "org.apache.jasper.JasperException: org/apache/commons/digester/Digester"
    this exception.
    i'm using Tomcat server i have included all jars file in my application lib folder.
    place jasper jar in ext folder of java.

    plz help me out

    regards

    Yash

    DB:2.79:Org.Apache.Jasper.Jasperexception: Org/Apache/Commons/Digester/Digester dx

    I'm trying to generate jasper report from my jsp.

    i have tried it in with simple java class. its working fine but i tried to merge it
    with jsp, its showing "org.apache.jasper.JasperException: org/apache/commons/digester/Digester"
    this exception.
    i'm using Tomcat server i have included all jars file in my application lib folder.
    place jasper jar in ext folder of java.

    plz help me out

    regards

    Yash

  • RELEVANCY SCORE 2.78

    DB:2.78:Doubt In Ftpclient Of Apache 31


    Hi all,
    Im using Ftpclient of org.apache.commons.net.ftp . When i use the printWorkingDirectory() method , it is returning the network file system path instead of the actual path.I need the actual path. Has anybody encountered this issue before?plz help

    DB:2.78:Doubt In Ftpclient Of Apache 31

    Hi all,
    Im using Ftpclient of org.apache.commons.net.ftp . When i use the printWorkingDirectory() method , it is returning the network file system path instead of the actual path.I need the actual path. Has anybody encountered this issue before?plz help

  • RELEVANCY SCORE 2.78

    DB:2.78:Apache Commons Net 1.4.1 Ftp Problem d3


    Hi,
    I have a problem with FTPClient class on my application:
    I connect with success to a ftp server, get list of files avalaible (all pdf files), and download all.
    It seems to work fine, except for some files.
    I use retrieveFile Method, passing a new ByteArrayOutputStream().
    I don't call completePendingCommand() at the end, because in api, for retrieveFile, is not mentioned.
    Also I don't close or flush the outputstream, because is a byte[] array and I don't work on files.

    All files correctly open with acrobat reader, but the content is white, as the FTPClient doesn't download correctly some files.
    This problem repeated random... without any logic purpose.

    I need to call completePendingCommand anyway?
    I need to flush and close ByteArrayOutputStream before call toByteArray() method?
    Thank you very much
    Bye

  • RELEVANCY SCORE 2.78

    DB:2.78:Problem With My Ftp Client Program: Malformedpatternexception af


    HI

    I am writing an FTP application using Jakarta.commom.net 1.2.2. I am able to connect and disconnect with my server. As a start up, I am trying to print the list of files in the specified directory.(As later on I will down load few files from there) But it gave me bunch of exception although it compiled well. Here is my code:
    import org.apache.commons.net.ftp.*;
    import org.apache.commons.net.ftp.FTPClient;
    import org.apache.commons.net.ftp.FTPFile;

    public class MyFTP {

    public static void main(String[] args) {

    String user="user-name";
    String psw="password";
    String server="134.238.198.12";
    String directory="/lic";
    try {
    FTPClient f= new FTPClient();
    f.connect(server);
    f.login(user, psw);
    System.out.print(f.getReplyString());

    /************* this does not work *************/

    FTPFile[] files = f.listFiles();
    for(int i=0;i files.length;i++){
    System.out.println("files:" + files.getName());
    }//end of for loop

    /************* up to this *************/

    System.out.println();
    f.disconnect();

    }catch(Exception e){
    System.out.println("Error:"+e);
    }

    }//end of function

    }

    THese are the exception I got:
    java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:121)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:84)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2306)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2055)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2106)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2146)
    at MyFTP.main(MyFTP.java:23)
    Exception in thread "main" I dont know how to proceed. All I need to do is download a file from a specified directory in binary mode.
    That is my goal. But before that I tried to see whether I am able to get the files/directory listing from a specified directory. Pls help/suggest me If I am doing anything wrong.

    Advance Thanks

    DB:2.78:Problem With My Ftp Client Program: Malformedpatternexception af

    Hi,

    I've experienced the same problem but managed to find a solution to make it work.

    Simply just add the following line of code:
    FTPFile[] files = f.listFiles(f.printWorkingDirectory());

    printWorkingDirectory() returns the current directory.

    I guess that your example tries to access the remote FTP-server at the root and you don't have access to this part of the remote server.

  • RELEVANCY SCORE 2.78

    DB:2.78:Strange Delete Behavior In Solaris 10 With Nfs Mounts j7


    We are using the apache commons-io framework to delete a directory in a Solaris 10 environment. The code works well on our dev and qa boxes, but when we load it into our production envrionment we get intermittent failures where the files in a directory are not being deleted and therefore when we try to delete the directory it fails to delete.

    We suspect that this may be some kind of NFS problem in Solaris where it may take longer to delete a file than if it is on a local drive and therefore the code reaches the deletedir before the OS actually removes the files and this cause the delete directory failure because files are still present.

    Has anyone seen this in an NFS environment with Solaris? We are on Java 1.4.2_15 and we are using apache commons-io 1.3.1.

    DB:2.78:Strange Delete Behavior In Solaris 10 With Nfs Mounts j7

    Is it possible that some other process concurrently creates files in the directory?

    Execing "rm -r -f" would not be a nice, platform-independent solution, would it?

  • RELEVANCY SCORE 2.78

    DB:2.78:Jasperreport And Java Development 9d


    I am trying to integrate the jasper report into the NetBeans 5.5.1 .As the article mentioned I added all the following six classes.
    JasperReports-1.2.5
    commons-beanutils-1.5.jar
    commons-collections-2.1.jar
    commons-digester-1.7.jar
    commons-logging-1.0.2.jar
    commons-javaflow-20060411.jar

    Compiling step is OK. But when I tried to run the application following message would come.
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:151) at Main.main(Main.java:45)

    When I do this in JBuilder and the command prompt the same message appeared.
    What is this problem and how to solve this?
    Help me

    Thank you,

    DB:2.78:Jasperreport And Java Development 9d

    Hi,

    have u added other jar like itext.jar , ireport.jar and jasperreport.jar

    try after adding this jar.
    this might be useful.
    if u get solution then pls post it/

  • RELEVANCY SCORE 2.77

    DB:2.77:How To Include Third Party .Jar Files Into My Jar File zs


    Hi,

    how do i include a open source third party jar file into an executable jar?

    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?

    currently i'm getting the following error from when executing my BlogBox.jar

    C:\MyJava\BlogBoxjava -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.init(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)

    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks

    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?

    Message was edited by:
    gekkokid

    DB:2.77:How To Include Third Party .Jar Files Into My Jar File zs

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf

    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.

    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar

    and it works,

    thank you everyone :)

  • RELEVANCY SCORE 2.76

    DB:2.76:Can U Please Help Me Check The Code To Download From Sftp kk


    I have written following code.ITs working properly.Its copying files from SFTP server to my machine .

    But i want to download files from SFTP server to my machine as
    1)i want to download .zip files from SFTP server
    2)it should popup a window containig open,save,cancel
    3)please delete unnecessary coding if anything in mycode
    can u please alter code for that

    this is my code

    package gtmse.test;

    import org.apache.commons.net.ftp.FTPClient;
    import org.apache.commons.net.ftp.FTPFile;
    import sun.net.ftp.FtpClient;

    import java.io.*;
    import java.net.URLConnection;
    import java.net.URL;
    import java.util.zip.ZipInputStream;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;

    /**
    * Created by IntelliJ IDEA.
    * User: chethan_bs
    * Date: Nov 26, 2007
    * Time: 3:13:38 PM
    * To change this template use File | Settings | File Templates.
    */
    public class TestFtp {
    public static void main(String args[])
    {
    System.out.println("-- TEST FTP --");
    ftp();
    }
    public static void ftp()
    {
    try
    {
    System.out.println("-- FTP CONNECT --");
    //connect("ftpservername", "user", "password");

    //Refer to : http://www.docjar.com/docs/api/org/apache/commons/net/ftp/FTPClient.html
    // Connect and logon to FTP Server
    FTPClient ftpClient = new FTPClient();
    ftpClient.connect("ftpservername");
    boolean isLoggedIn = ftpClient.login("username", "password");

    //System.out.println("Reply : "+ftpClient.getReply());
    //System.out.println("Reply Code : "+ftpClient.getReplyCode());
    //System.out.println("Reply String : "+ftpClient.getReplyString());

    System.out.println("SystemName : "+ftpClient.getSystemName());
    System.out.println("isRemoteVerificationEnabled : "+ftpClient.isRemoteVerificationEnabled());
    System.out.println("listFiles Length : "+ftpClient.listFiles().length);
    System.out.println("isLoggedIn : "+isLoggedIn);
    System.out.println("Status : "+ftpClient.getStatus());
    System.out.println("getPassiveHost : "+ftpClient.getPassiveHost());
    System.out.println("getPassivePort : "+ftpClient.getPassivePort());
    System.out.println("listHelp : "+ftpClient.listHelp());

    ftpClient.setFileTransferMode(ftpClient.BINARY_FILE_TYPE);
    FTPFile[] ftpfiles = ftpClient.listFiles();
    /*
    File dirPath = new File("c:/123456");
    //if (!dirPath.exists())
    //FileUtils.forceMkdir(new File("c:/123456"));
    */
    for(int x = 0;xftpfiles.length;x++)
    {
    System.out.println("----------------------------------------------------");
    System.out.println("File Name "+x+ " : "+ftpfiles[x].getName());
    System.out.println("File Size : "+ftpfiles[x].getSize());
    System.out.println("File Type : "+ftpfiles[x].getType());
    System.out.println("isDirectory : "+ftpfiles[x].isDirectory());
    System.out.println("isFile : "+ftpfiles[x].isFile());
    System.out.println("getUser : "+ftpfiles[x].getUser());
    System.out.println("getTimestamp : "+ftpfiles[x].getTimestamp().getTime());
    System.out.println("----------------------------------------------------");
    File file1 = new File( "E:\\SSO\\Files" + File.separator + ftpfiles[ x ].getName() );

    if(ftpfiles[x].isFile())
    {
    FileOutputStream fos = new FileOutputStream( file1 );
    ftpClient.retrieveFile( ftpfiles[ x ].getName(), fos );
    fos.close();
    }
    file1.exists();
    }

    /*
    java.util.Enumeration files = ftpClient.getDirListing();
    while (files.hasMoreElements()) {
    FtpFile ftpFile = (FtpFile) files.nextElement();
    System.out.println(ftpFile.getFilename());
    System.out.println(ftpFile.getFilesize());
    // etc. other helpful methods are detailed in Javadoc
    }
    */

    //ftpClient.download("C:\\Temp\\", "README.txt");
    // Eventually other operations here ...
    ftpClient.disconnect();
    System.out.println("-- FTP DISCONNECT --");

    /*
    URL url = new URL("ftp://gtm:GtM2505@ftp.spanservices.com/galileo.log;type=i");
    URLConnection urlc = url.openConnection();
    InputStream is = urlc.getInputStream(); // To download
    zipdownload(is, urlc);

    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    StringBuffer sBuf = new StringBuffer();
    String line = null;
    while ((line = br.readLine()) != null)
    {
    sBuf.append(line);
    }
    br.close();
    is.close();
    System.out.println("READING "+sBuf.toString());
    //OutputStream os = urlc.getOutputStream(); // To upload
    */

    /*
    //import sun.net.ftp.FtpClient;
    FtpClient ftpClient = new FtpClient();
    //ftpClient.
    */

    }
    catch(IOException ioe)
    {
    ioe.printStackTrace();
    }
    }

    private static void zipdownload(InputStream is, URLConnection urlc)
    {
    try
    {
    //set the content type for zip
    // response.setContentType("application/zip");
    // response.setHeader("Content-Disposition", "attachment; filename= SSO.zip");
    byte[] _buf = new byte[1024];
    //zos is used to write files in zip
    ZipOutputStream zos = null;
    //zip is used to read files
    ZipInputStream zis = null;
    //zos = new ZipOutputStream(OutputStream out);
    zis = new ZipInputStream(is);
    ZipEntry ze = null;

    while ((ze = zis.getNextEntry()) != null)
    {
    String fname = ze.getName();
    if (fname!=null)
    {
    //copy the entry from zis to zos
    int bytes = 0;
    //deal with password protected files
    zos.putNextEntry(new ZipEntry(fname));
    while ((bytes = zis.read(_buf)) 0)
    {
    zos.write(_buf, 0, bytes);
    }//end of while
    zis.closeEntry();
    zos.closeEntry();
    } //end of if
    }//end of while

    if (zis != null)
    zis.close();
    if (zos != null)
    zos.close();
    }
    catch(IOException ioe)
    {
    ioe.printStackTrace();
    }
    }
    }

    DB:2.76:Can U Please Help Me Check The Code To Download From Sftp kk

    I don't think the code you are using will work with SFTP/SSH server. The code you are using is for FTP which is a different protocol.

    Try the following API

    http://www.jscape.com/sftp/

  • RELEVANCY SCORE 2.76

    DB:2.76:Ftp Malformedserverreplyexception sc


    I'm having an issue trying to FTP a file to our server everyday.

    Here is the response from the server...

    org.apache.commons.net.MalformedServerReplyException: Could not parse response code. Server Reply: ma.

    I'm not sure what the server reply 'ma' means? I can log in using a client like Filezilla no problem.
    FTPClient client = new FTPClient();

    try {

    client.connect("IP Address");

    boolean login = client.login("username", "password");

    if (login) {
    do something
    }
    } catch (IOException e) {
    e.printStackTrace();
    out.println(e.toString());

    } finally {

    try {
    client.disconnect();
    } catch (IOException e) {
    e.printStackTrace();
    out.println(e.toString());
    }
    }

    Thanks for any suggestions.

    DB:2.76:Ftp Malformedserverreplyexception sc

    Have a look at the classes in the org.apache.commons.net.ftp.parser package and see if any of them look like they might be suitable for your FTP server. (Which is what, by the way?)

  • RELEVANCY SCORE 2.76

    DB:2.76:Plz Help Its Argent s7


    Hi,

    I want to send sms from PC through GSM modem.
    for this i m using smslib

    To use smslib i need to install
    jar file commons-net-1.4.1.jar(Apache Jakarta Commons/NET )
    can u plz suggess me from where '
    can i get it?

    Thank u

    DB:2.76:Plz Help Its Argent s7

    What makes you think that the people on this forum can magically see the modem you're using and find out the model number and manufacturer, so they could send you to the right URL which you also seem to think they've memorized.

    You're the one with the modem. Pick it up, read the label, find out who made it and what its model number is, then go to their web site and look for the emulator and documentation and whatever else you need.

  • RELEVANCY SCORE 2.75

    DB:2.75:Classpath Issue, But I Don't See How fp


    We have developed and Applet and are trying to test it. It relys on some of the Apache commons libraries. When the Applet loads we get a NoClassDefFoundError. As you can see from the attached log, the browser is loading the commons-net jar.

    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Users\pohara
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to n
    ----------------------------------------------------
    Dumping class loader cache...
    Live entry: key=http://10.28.127.52/,WaferID-4.5.jar, commons-lang-2.6.jar, commons-net-1.3.0.jar, refCount=1, threadGroup=sun.plugin2.applet.Applet2ThreadGroup[name=http://10.28.127.52/-threadGroup,maxpri=4]
    Done.

    Memory: 17,504K Free: 6,319K (36%) ... completed.
    Trace level set to 5: all ... completed.
    Logging set to : true ... completed.
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@26fbfc
    basic: Plugin2ClassLoader.addURL parent called for http://10.28.127.52/WaferID-4.5.jar
    basic: Plugin2ClassLoader.addURL parent called for http://10.28.127.52/commons-lang-2.6.jar
    basic: Plugin2ClassLoader.addURL parent called for http://10.28.127.52/commons-net-1.3.0.jar
    basic: exception: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient.
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at com.cognex.insight.waferid.gui.FileTabButtonHandler.init(FileTabButtonHandler.java:61)
    at com.cognex.insight.waferid.gui.tabs.TabFile.init(TabFile.java:142)
    at com.cognex.insight.waferid.gui.WaferIdApplet.init(WaferIdApplet.java:230)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient

    I assume that there must be an issue loading the FTPClient, but it has not external dependencies that I am aware of. I am pretty sure this is not a classpath issue, but am at a loss where else to look.

    Pat O

    DB:2.75:Classpath Issue, But I Don't See How fp

    Could you post here the applet manifest, if any, and the HTML applet tag?

  • RELEVANCY SCORE 2.75

    DB:2.75:Trying A Comprehensive Jakarta-Commons Pkgbuild.... js



    Hey there!

    I would like to build a PKGBUILD for a nice java banking program. On the way to a Arch-conform PKGBUILD I stumbled over the Java Package Guidelines and investigated the libs which are shipped with the program a bit further.

    There I found that some jars from the jakarta commons package were used but not yet packaged in AUR or the official repos. So first I wanted to build them separately, but then I found that it would make more sense to have one comprehensive package of (currently) 30MB instead of 33 single packages.

    What do you think about the idea? I am willing to support this meta package as well as the single ones if I just knew how the implementation would be more sensible.

    Since it would be a huge amount of work to pack every packag on its own, I wrote a PKGBUILD for all packages that are in Jakarta Commons.

    I hope, if it is generally desired to have any package in a single file, that I at least learnt a bit from writing this PKGBUILD
    # Contributor: jakob
    pkgname=jakarta-commons-all
    pkgver=1.0
    pkgrel=1
    pkgdesc=This packag includes all Jakarta Commons Proper packages.
    url=http://jakarta.apache.org/commons/
    license=APACHE
    depends=()
    makedepends=()
    conflicts=()
    source=(http://www.apache.org/dist/jakarta/commons/attributes/binaries/commons-attributes-2.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/beanutils/binaries/commons-beanutils-1.7.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/betwixt/binaries/commons-betwixt-0.7.tar.gz
    http://www.apache.org/dist/jakarta/commons/chain/binaries/commons-chain-1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/cli/binaries/cli-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/codec/binaries/commons-codec-1.3.tar.gz
    http://www.apache.org/dist/jakarta/commons/collections/binaries/commons-collections-3.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/configuration/binaries/commons-configuration-1.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/daemon/binaries/commons-daemon-1.0.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/dbcp/binaries/commons-dbcp-1.2.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/dbutils/binaries/commons-dbutils-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/digester/binaries/commons-digester-1.7.tar.gz
    http://www.apache.org/dist/jakarta/commons/discovery/binaries/commons-discovery-0.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/el/binaries/commons-el-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/email/binaries/commons-email-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/fileupload/binaries/commons-fileupload-1.1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/httpclient/binary/commons-httpclient-3.0.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/io/binaries/commons-io-1.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/jelly/binaries/commons-jelly-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/jexl/binaries/commons-jexl-1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/jxpath/binaries/commons-jxpath-1.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/lang/binaries/commons-lang-2.2.tar.gz
    http://www.apache.org/dist/jakarta/commons/latka/binaries/latka-1.0-alpha1.zip
    http://www.apache.org/dist/jakarta/commons/launcher/binaries/commons-launcher-1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/logging/binaries/commons-logging-1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/math/binaries/commons-math-1.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/modeler/binaries/commons-modeler-2.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/net/binaries/commons-net-1.4.1.tar.gz
    http://www.apache.org/dist/jakarta/commons/pool/binaries/commons-pool-1.3.tar.gz
    http://www.apache.org/dist/jakarta/commons/primitives/binaries/commons-primitives-1.0.tar.gz
    http://www.apache.org/dist/jakarta/commons/scxml/binaries/commons-scxml-0.5.tar.gz
    http://www.apache.org/dist/jakarta/commons/transaction/binaries/commons-transaction-1.1.tgz
    http://www.apache.org/dist/jakarta/commons/validator/binaries/commons-validator-1.3.0.tar.gz)

    md5sums=(47d037449aa38b6c8e181abcfaf36b2b d1571ce9d6ec3d1795364cc44f3d116e
    707af78be5ed2518dd2eada9afefb238 e688f648a5fd324f591669ca70ebe96d
    6c28bdee998fe4d9e76c7cf40e7f4691 aad3948be13476d9599cadaf146bc92a
    030a1c1d08f47a6c9be000fc611714b4 6c8bc440de20b7c9b5b3b5315d50316b
    591fceeb4feab1094a78c9c5decd8cca d333fc11abb532be2487338cb452b583
    b437ea809d320378fc05af9f29e2636f 717239578dfcd05bde0dfd1d3e8f319f
    2273f5f83a477f4f18fccf3a00e2b48c fb856b9689bdc4c52f8ae999057f89fc
    4fb252cd4bcee57b573937e3c88974cc 3b851898d3347cd4d6890b79c9a8a0f0
    58167f247e8f8ad8fb1def97c1de8f07 52b42b61593def482dc968ffdd27f113
    e9e3ba84a214d2bcf96aa31b24f3bb5f 9bdf02d9b659a70b7f327c923c1f4d80
    1730dae5f0ef0594a47ead5d1a4ac41b 4f683f7b6970babb8c9f09bb12b7c1a6
    fbf479099aa252989fe4c81511abf4bf 7ed65e08e8c952c4d9f6db0d73ef5426
    c2bd7cc1fa08d78ec5aa80632c21152b 37c43d1d0c08c1b753a7bf952c763eb3
    ba74fdf4aca98f01579eca11acc6d882 577e90cc40328c287acc921dae344c12
    1bdae6c015689349b704daebda924a5b 2ce92656204f2fa63dad6dfa88e1458b
    091e2dc0efcb9155c2b4a05792d49a77 fe946d1775d58ded6050dec6af648f38
    221d924fb85f3597d8be0708d45f0f5a)

    build() {
    mkdir -p $startdir/pkg/usr/share/java/jakarta-commons
    cd $startdir/src/
    rm -rf *gz docs LICENSE*
    mv *.txt doc
    mv * $startdir/pkg/usr/share/java/jakarta-commons
    }

    DB:2.75:Trying A Comprehensive Jakarta-Commons Pkgbuild.... js


    Your absolutely right saying that never all commons packages would be used by just one program.
    I read the Java Packaging Guidelines again and it says that only commoly used and major libs should be sourced out to single packages. So the question is: Do any other packages in AUR or the official repos use some of the jakarta-commons projects so it would eventually pay to make single packages for them, or isnt it worth the hussle?

    I for my part now will leave the libs that are bundled with the package I wanted to upload at first in the package and use them.

    Thanks for your reply

  • RELEVANCY SCORE 2.75

    DB:2.75:Java.Lang.Noclassdeffounderror: Org/Apache/Commons/Net/Socketclient p8


    Anything know why appear this error in my program putFTPFile.java?.
    The package org.apache.commons.net are download of:
    http://apache.rediris.es/jakarta/commons/net/binaries/commons-net-1.1.0.zip

    Thanks!!!

    import org.apache.commons.net.SocketClient.*;
    import org.apache.commons.net.SocketClient;
    import org.apache.commons.net.*;
    import org.apache.commons.*;
    import org.apache.commons.net.ftp.*;

    public class putFTPFile
    {
    public static void main(String args[])
    {
    String server="MYFTPSERVER";

    FTPClient ftp = new FTPClient();

    try {
    int reply;
    ftp.connect(server);
    System.out.println("Connected to " + server + ".");
    System.out.print(ftp.getReplyString());

    // After connection attempt, you should check the reply code to verify
    // success.
    reply = ftp.getReplyCode();

    if(!FTPReply.isPositiveCompletion(reply)) {
    ftp.disconnect();
    System.err.println("FTP server refused connection.");
    System.exit(1);
    }
    } catch(Exception e) {
    if(ftp.isConnected()) {
    try {
    ftp.disconnect();
    } catch(Exception f) {
    // do nothing
    }
    }
    System.err.println("Could not connect to server.");
    e.printStackTrace();
    System.exit(1);
    }

    try {
    ftp.login("MyUSR", "MyPWD");

    ftp.disconnect();
    }
    catch(Exception e) { System.out.println("Error connecting to LOGIN server."); }

    }

    }

  • RELEVANCY SCORE 2.74

    DB:2.74:Re: File Uploading,Help. d7


    Carefully read this article to understand how multipart form data requests works and how you can gather parameter values and files from it using Apache Commons FileUpload:
    http://balusc.blogspot.com/2007/11/multipartfilter.html

    DB:2.74:Re: File Uploading,Help. d7

    today, I have only one hour to do this and I don't have time ,but I manage to do this with this filter I will put this article as a home page...I promise :)
    thank you again!!!

  • RELEVANCY SCORE 2.74

    DB:2.74:Thread: Cannot Java And Ftp 1x


    Dear all,

    I created a java net program to use Novell Netware FTP. Current i used

    apache commons-net 1.4. when i tried to get the directory listings , it shows

    TPClient f=FTPClient();

    f.connect(server);

    f.login(username, password);

    FTPFile[] files = listFiles(directory);

    org.apache.commons.net.ftp.parser.ParserInitializa tionException: Unknown

    parser type: NETWARE Type : L8

    DB:2.74:Thread: Cannot Java And Ftp 1x

    The NetWare FTP server uses a Unix style file display. You should tell

    your FTP client application to use the Unix parser. This can for example

    be done with FTPClientConfig as shown in the examples here:

    http://jakarta.apache.org/commons/ne...entConfig.html

    -' + '-

    Marcel Cox

    http://support.novell.com/forums

  • RELEVANCY SCORE 2.74

    DB:2.74:Jakarta Net Commons: Issue With Ftpclient mj


    hi!

    hope this is the right forum for this question :)

    i use the following code to send some files to my ftp-server:
    FTPClient ftp = new FTPClient();
    try {
    ftp.connect("localhost");
    ftp.login("drivesync","sync");
    ftp.setFileType(FTPClient.BINARY_FILE_TYPE);

    File folder = new File("Y:\\Data\\My Pictures\\");
    File[] files = folder.listFiles(new FileFilter() {
    public boolean accept(File file) {
    if(file.isFile()) {
    return true;
    } else {
    return false;
    }
    }
    });

    for (int i = 0; i files.length; i++) {
    File file = files;
    InputStream inputStream = new FileInputStream(file);
    OutputStream outputStream = ftp.storeFileStream(file.getName());

    byte[] buffer = new byte[4096];
    int l;
    while((l = inputStream.read(buffer)) != -1) {
    // Daten aus Buffer in outputStream schreiben:
    outputStream.write(buffer, 0, l);
    }

    /* Streams schliessen: */
    inputStream.close();
    outputStream.close();
    }

    } catch (SocketException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }
    this works without any problem... for the first file. when the for-loop wants to get the outputstream for the second file, the FTPClient only returns [i]null.
    has anybody an idea whats wrong? i tried to use the completePendingCommand()-method, but no change.
    after trying to get the second outputstream i get the right replycode (150) from the server... but the stream's still null.

    thx greetz
    manu

    DB:2.74:Jakarta Net Commons: Issue With Ftpclient mj

    This doesn't reply as the problem involved the need to keep the stream open.
    Of course, closing the stream and calling completePendingCommand() release the resources clean for a new use, but that's not what was needed, or at least not what I needed.

  • RELEVANCY SCORE 2.74

    DB:2.74:Noclassdeffound From Jsp 9m


    I've modified the CLASSPATH for Tomcat to include /usr/share/commons-beanutils/lib/commons-beanutils.jar (which exists). My application has been built using ant and the JAR is included in build.xml as part of the classpath.

    When viewed, my servlet throws "java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanUtils", when it's trying to populate a bean, using a class that was compiled successfully by ant. All the class does is call BeanUtils.populate(..) and it does have an "import" statement.

    Because the class calling BeanUtils compiles correctly using ant , I suspect this is a problem with the classpath in Tomcat, therefore:

    Can I check that Tomcat has the correct classpath? Is there any other reason Tomcat wouldn't be seeing the JAR, or that this error would occur?

    Thanks.

    DB:2.74:Noclassdeffound From Jsp 9m

    You may want to go through this

    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

  • RELEVANCY SCORE 2.72

    DB:2.72:Apache Commons-Net d7


    Hi
    I was using apache commons-net to FTP some files to an FTP server.
    I was able to login to the server. I want to know How can I move out from my root directory. Is it possible using apche coomons-net. The working directory displayed is only /home/myname.

    Thanks
    Prabhath Nair

    DB:2.72:Apache Commons-Net d7

    Ya thanks

    I got the answer. It is because FTP Api's won't provide any methods which allow you to move out of root folder. It is because of security reasons.

    Thanks
    Prabhath Nair

  • RELEVANCY SCORE 2.71

    DB:2.71:Cannot Implement Ws-Security Usernametoken Of Soap Axis Adapter 77



    Hi,

    We are trying to implement the UsernameToken WS-Security in PI 7.11 using the Receiver SOAP Axis Adapter but we are getting the error below:

    com.sap.engine.interfaces.messaging.api.exception.MessagingException: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/axis/description/OperationDesc : cannot initialize class because prior initialization attempt failed

    We have already asked the Basis Team to deploy the optional components in SOAP Axis, however, the error still persist. Do you have any idea on how we could resolve the issue?

    Optional Components

    XML Security API

    Found: org.apache.xml.security.Init at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/xmlsec-1.4.2.jar

    Apache Xalan

    Found: org.apache.xalan.Version at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/xalan.jar

    Jakarta-Commons Codec

    Found: org.apache.commons.codec.Encoder at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/commons-codec-1.4.jar

    Jakarta-Commons Net

    Found: org.apache.commons.net.SocketFactory at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/commons-net-1.0.0-dev.jar

    Jakarta-Commons HttpClient

    Found: org.apache.commons.httpclient.HttpClient at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/commons-httpclient-3.0.1.jar

    Apache WSS4J

    Found: org.apache.ws.security.WSSConfig at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/wss4j-1.5.4.jar

    Apache Addressing

    Found: org.apache.axis.message.addressing.Constants at /usr/sap/XDC/DVEBMGS00/j2ee/cluster/bin/ext/com.sap.aii.af.axisproviderlib/lib/addressing-1.1.1.jar

    Apache Sandesha

    Warning: optional component missing --- looking for org.apache.sandesha.Constants in com.sap.aii.af.axisproviderlib/Sandesha.jar; see http://ws.apache.org/sandesha/

    Thanks,

    Jenny

    DB:2.71:Cannot Implement Ws-Security Usernametoken Of Soap Axis Adapter 77


    I'm also facing the same issue. I'm using Axis adapter at receiver side. Receriver side communication channel is throwing the error as follows:

    com.sap.engine.interfaces.messaging.api.exception.MessagingException: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/axis/description/OperationDesc : cannot initialize class because prior initialization attempt failed

    All basis components were installed including optional ones. Please give a solution, if you find out.

  • RELEVANCY SCORE 2.71

    DB:2.71:Problems Upload Excel (Xls) Files Using Ftp 3f


    Hi I am having some problems uploading a xls file I succesfully upload a txt file but I dond have any exception the problem is that the file is not there.. Here is the code:

    FTPClient client = new FTPClient();
    client.connect(server);
    client.login(user, pass);

    File file = new File("C:/errors.xls");
    InputStream is = new FileInputStream(file);
    client.setFileType(FTP.BINARY_FILE_TYPE);
    client.enterLocalPassiveMode();
    client.storeFile("\\errors.xls",is);

    is.close();
    client.disconnect();

    Thanks in advance

    DB:2.71:Problems Upload Excel (Xls) Files Using Ftp 3f

    File file = new File("C:/errors.xls");

    I think you want:
    File file = new File("C:\\errors.xls");

  • RELEVANCY SCORE 2.70

    DB:2.70:Wdk Automated Test Framework Compile Issue 1z



    It appears that the webcomponent/testtool/compiler.jsp and supporting java class is sensitive to the classpath length. I cannot compile any test class created via the recorder and consistently recieve the same error: Verify the location of your JDK (JAVA_HOME) and hit 'Compile' to try again. The path stated to where the java compiler is correct but when looking at the compile command displayed by the JSP its obviously not correct. It appears the quoted classpath is getting cut off - not sure if this is actually a display issue or if the command being run is malformed. The classpath components are nothing out of the ordinary for a WDK development environment which leads me to believe that there is probably someone else out there with the same problem. Has anyone else seen this error? This is brand new Wbtop 6.5 SP1 install with ATF 2.5 added to it. At this point even the sample test suite will not run without errors - it looks for non-existent controls on the page and hangs waiting for export location selection. Anyone experienced these errors as well?

    Thanks in advance,

    Scott

    Malformed compile command looks like:

    "/u01/app/documentum/shared/java/1.5.0_12/bin/javac" -classpath "/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/classes:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ldapjdk.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/DmcRecords.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/activation.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/castor-1.1-xml.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/xforms.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/jaxb-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/xtrim-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/image-services-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/bpm_infra.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-logging-1.1.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/xtrim-server.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/workflow.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-jxpath-1.2.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/aspectjrt.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/subscription.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/dfc.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/XformsChiba.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/messageService.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-fileupload-1.0.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ucf-server-impl.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/messageArchive.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/bofirm.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-beanutils.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-codec-1.3.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/XformsEngine.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-collections-3.0.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/microsoft.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/xml-ca.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/jsafeFIPS.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/configservice-impl.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ci.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ss_css2.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/msclasses.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/bpmutil.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/configservice-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ucf-server-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/dms-client-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/log4j.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/Dart.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/regexp.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/mail.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/All-MB.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/jsr173_api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-httpclient-3.0.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/extended-search-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/commons-io-1.2.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/ldapfilt.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/preset-api.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/collaboration.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/certjFIPS.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-INF/lib/XformsCommon.jar:/u01/app/apache/tomcat/apache-tomcat-6.0.18/webapps/wt650sp1/WEB-

    Note that it ends incorrectly above

    DB:2.70:Wdk Automated Test Framework Compile Issue 1z


    In addition to the OS information, for the sample suite not running, can you turn on tracing: set in TraceProp.properties SESSIONENABLEDBYDEFAULT, com.documentum.web.test.Trace.TESTCASE, com.documentum.web.test.Trace.TESTSTEP and com.documentum.web.test.Trace.TESTRECORDER to true,

    and then in log4j.properties set log4j.appender.stdout.threshold to DEBUG, run the test suite, and send us the server logs. At the point of hanging, also take us a screenshot. That'll help us troubleshoot.

    Thanks!

    Matthew

  • RELEVANCY SCORE 2.70

    DB:2.70:Problem With Commons.Net 9s


    Hi,

    I have problem with the following package : commons-net-1.2.1.jar.
    I donwloaded it at : http://jakarta.apache.org/commons/net/.

    I'm on Windows 2000 and set the following variable to the value : CLASSPATH=.;MY_JAVA_HOME\jre\lib\ext\commons-net-1.2.1.jar

    Then, my code is the following to test a FTP connection :

    import java.io.*;
    import org.apache.commons.net.ftp.*;
    public class TestFTP
    {
    public static void main(String[] args)
    {
    FTPClient ftpClient = new FTPClient();
    ftpClient.connect("monftp", "mon_user", "mon_pass");
    ftpClient.disconnect();
    }
    }But, when I compile, I obtain the following message :
    "TestFTP.java:8: cannot resolve symbol
    symbol : method connect (java.lang.String,java.lang.String,java
    location: class org.apache.commons.net.ftp.FTPClient
    ftpClient.connect("monftp", "mon_user", "mon_pass");
    ^
    1 error"

    Could somebody tell me where the error is ?

    Thanks in advance.

    DB:2.70:Problem With Commons.Net 9s

    Hi ,

    I m using commons-net library to list files in ftp server and check whether the file is a directory or not .
    It works for some cases but when the directory name is separated by spaces i.e /lib/lib stand/ it fails to recognise the directory name.

    Please can you suggest me a solution to this problem.

    Thank you.

  • RELEVANCY SCORE 2.69

    DB:2.69:Issue Using Commons-Vfs2 In Karaf kp



    Hi,

    I am porting legacy code to OSGi. The code has dependencies on Apache commons-vfs2 and craft. I had configured my feature to include the following:

    ...
    bundlemvn:org.openengsb.wrapped/com.jcraft.jsch-all/0.1.42.w1/bundle
    bundlemvn:org.apache.commons/commons-vfs2/2.0/bundle
    ...

    DB:2.69:Issue Using Commons-Vfs2 In Karaf kp


    Hi,

    That's feature is in FUSE ESB full kit.

    Freeman

  • RELEVANCY SCORE 2.69

    DB:2.69:Servlet Exception xz


    Hi,

    i am getting the following exception

    javax.servlet.ServletException: org/apache/commons/httpclient/HttpClient

    Can anyone let me know the root cause for this exception

    i am using Weblogic server 8.1

    DB:2.69:Servlet Exception xz

    ServletException usually indicates some serious error while handling/initializing a servlet. There isn't much you can do when you see this exception - a servlet container might destroy a servlet instance in such case.
    My guess is it is some error in your servlet that results in ServletException, maybe something to do with commons-httpclient usage.

    By the way, this forum is dedicated to Sun appservers not Weblogic ones. You might want to also check if your servlet works with Sun appserver 8.1 or 8.2.

  • RELEVANCY SCORE 2.69

    DB:2.69:Hi Problem With Ftpclient zf


    Hi
    I have downloaded the package for FTPClient from jakarta.apache.org but now i have get bellow exception.

    java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2284)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2227)
    at com.ftpConnection.FTPConnection.main(FTPConnection.java:41)
    Exception in thread "main" I have just used the jar and I think there is some problem in jar so i tried to download it again but the problem persist so can any one guide me in this regards? bellow is the code i have used

    FTPClient ftpConnection = new FTPClient();
    ftpConnection.connect(host);
    ftpConnection.login(FTPConnection.userName,FTPConnection.password);
    FTPFile fileList[] = ftpConnection.listFiles();

    DB:2.69:Hi Problem With Ftpclient zf

    Thanks a lot foryour valueable reply

    but now i am not getting one more thing if you could help me out in this how can i download a file from the list of files returned to me? i am not getting that and even no class or function is defined for that.

    can you help me in this regards

    Thanks
    Niand

  • RELEVANCY SCORE 2.69

    DB:2.69:Changing Directories With Ftpclient aa


    Hi

    I am using this code to download a file from an FTP server, which works if the file is in my local directory. My problem is that the file I need to download is not in my default directory.

    FTPClient client = new FTPClient();
    client.connect("mysever");
    client.login("username", "password");

    InputStream inputStream =client.retrieveFileStream("file i need to download");
    FileOutputStream outputStream = new FileOutputStream("c:/file.txt");
    int data;
    while((data = inputStream.read()) != -1) {
    outputStream.write(data);
    }
    inputStream.close();
    outputStream.close();

    Im sure this is an easy answer but none of my searching turned up anything useful. Thanks.

  • RELEVANCY SCORE 2.69

    DB:2.69:About Ftpclient ?? 9a


    Hi,

    "list" and "get" methods work well when I'm connected to one server but doesn't work at all when connected to another one: onto that one I can log on without any problems and all functions work using "CuteFtp", but errors come when I try to use "list" and "get" from FTPClient package : (I get an IOException)

    http://www.enterprisedt.com/downloads/ftp/doc/index.html

    what could be the problem ?

    thanks

    Yves

    DB:2.69:About Ftpclient ?? 9a

    Do you have appropriate permissions for the user that you are using in the ftp session?

    That would be my guess

  • RELEVANCY SCORE 2.69

    DB:2.69:Noclassdeffounderror: Org/Apache/Commons/Logging/Logfactory 78


    I'm using JDev 9.0.3 and have created a Struts-based JSP for Business Components. I am not sure what I have done since yesterday, but I'm receiving this error when I try to run my jsp. (Which was previously working fine).

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    Any ideas as to what this class is for and why I would be getting this error now?

    Thanks in advance!
    -Teri

    DB:2.69:Noclassdeffounderror: Org/Apache/Commons/Logging/Logfactory 78

    Teri, Ian,

    Since I am not able to reproduce the problem I need to understand what is different in your environment.

    Is it on a Windows platform?
    Do you run the application embeded in JDev or a remote oc4j instance. Or Tomcat? If so how did you deploy?

    At which point do you get this error? Can you "attach" the log?

    Thanks,
    Charles.

  • RELEVANCY SCORE 2.69

    DB:2.69:Classloader Problem 3s


    Hello,

    I have the following method to dinamically load external jars:

    public static Class findAndLoadClass(ClassLoader proxyClassLoader, String jarDir, String classBinaryName) throws Exception
    {
    File fJarDir = new File(jarDir);
    File[] jarFiles = fJarDir.listFiles();
    int numJarFiles = jarFiles.length;

    ArrayListURL listURLs = new ArrayListURL();

    for (int i = 0; i numJarFiles; i++)
    {
    if (jarFiles.getName().endsWith(".jar"))
    {
    URI jarURI = jarFiles[i].toURI();
    listURLs.add(jarURI.toURL());
    }
    }

    URLClassLoader classLoader = URLClassLoader.newInstance((URL[])listURLs.toArray(new URL[listURLs.size()]), proxyClassLoader);
    return (classLoader.loadClass(classBinaryName));
    }
    This method loads all jars contained in 'jarDir' directory using the application classloader (proxyClassLoader) passed as parameter (this.getClass().getClassLoader()).

    I have 2 jars in 'jarDir': my.jar and commons-lang-2.5.jar. Inside my.jar exists the class 'MyClass' that tries to call to 'org.apache.commons.lang.StringEscapeUtils' (method inside commons-lang-2.5.jar), and I'm getting a 'java.lang.NoClassDefFoundError: org/apache/commons/lang/StringEscapeUtils'.

    Can anybody tell me why MyClass can't see the method inside ''commons-lang-2.5.jar" if they're under the same classloader?

    Many thanks,
    Joan.

    DB:2.69:Classloader Problem 3s

    OK, forget everything, one of the jars was also located in the classpath.

    Now, removing it works.

  • RELEVANCY SCORE 2.69

    DB:2.69:Cant Use Log4j Or Commons Logging With Ease In Oc4j/Oas 10g js


    Hi,

    I have a simple JEE 5 app which just uses Log4J for logging. I have a log4j.properties at the right place. But deploying an EAR with this config fails

    Operation failed with error: Lorg/apache/log4j/Logger;

    or if i move to commons logging this...

    Operation failed with error: Lorg/apache/commons/logging/Log;

    Things as simple as using logging, I feel, shouldnt be any complex than what is inferred. Atleast there should more error detailing to it than a bozo message like the above.

    Anyone used logging in just a ejb jar app???

    DB:2.69:Cant Use Log4j Or Commons Logging With Ease In Oc4j/Oas 10g js

    Hi,

    I have a simple JEE 5 app which just uses Log4J for logging. I have a log4j.properties at the right place. But deploying an EAR with this config fails

    Operation failed with error: Lorg/apache/log4j/Logger;

    or if i move to commons logging this...

    Operation failed with error: Lorg/apache/commons/logging/Log;

    Things as simple as using logging, I feel, shouldnt be any complex than what is inferred. Atleast there should more error detailing to it than a bozo message like the above.

    Anyone used logging in just a ejb jar app???

  • RELEVANCY SCORE 2.69

    DB:2.69:Please Help Me To Check This Problem 3d


    I write this program to connect the FTP Server by using the
    package commons-net-1.4.1.jar which i download from http://jakarta.apache.org/site/downloads/downloads_commons-net.cgi

    the code is below .It is no problem when I compile ,but it causes some problem when i run it .
    import org.apache.commons.net.ftp.*;

    public class FTP {
    public static void main(String[] args) {
    try {
    FTPClient ftp = new FTPClient();
    ftp.connect("10.200.64.89");
    ftp.login("upc","upc");
    FTPFile[] f = ftp.listFiles();
    for(int i = 0 ; i f.length; i++) {
    System.out.println(f.getName());
    }
    }catch (Exception e) {
    e.printStackTrace();
    }
    }
    }you can view the Exception :

    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)
    at work.FTP.main(FTP.java:12)

    the method ftp.listFiles() can't run successful, but the others method

    such as ftp.changeWorkingDirectory() will do what it do.

    please someone help tme . Thanks!

  • RELEVANCY SCORE 2.69

    DB:2.69:Class File Has Wrong Version 48.0, Should Be 47.0 9k


    i have donloaded these two jar file jakarta-oro-2.0.8 and commons-net-1.4.0 from apache site place it in my

    C:\jdk1.3\jre\lib\ext directory.

    now when i compile this file it gives the error

    bad class file: C:\jdk1.3\jre\lib\ext\commons-net-1.4.0.jar(org/apache/commons/n
    et/ftp/FTPClient.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpa
    th.
    public class JakartaFtpWrapper extends FTPClient {

    it compile with jdk1.4 fine what will be the solution for jdk1.3 any body have a solution pls. help me.

    Regards
    Shambhu

    DB:2.69:Class File Has Wrong Version 48.0, Should Be 47.0 9k

    the actual error i am getting is this

    root cause

    java.lang.UnsupportedClassVersionError: org/apache/commons/net/ftp/FTPClient (Unsupported major.minor version 48.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:937)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1372)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at fsl.controlpanel.ConnectionProvider.getFtpFolderSize(ConnectionProvider.java:691)
    at fsl.controlpanel.ConnectionProvider.upadteAttacments(ConnectionProvider.java:621)
    at org.apache.jsp.updateattachment$jsp._jspService(updateattachment$jsp.java:141)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:484)what wiil be the possible solution
    Regards
    shambhu

  • RELEVANCY SCORE 2.68

    DB:2.68:Struts Data-Source Problem dc


    Hi,
    I can not solve this problem form more then one week:
    I am trying to create simple web application using Struts
    in JBuilder X.
    Here are the steps I am doing:
    1. Create new project
    2. Create new Web-App
    3. Create new JSP with simple submit form
    Now the application can be runned and everything is ok.
    4. Add new dataSource to struts-config.xml so it looks like this:

    ?xml version="1.0" encoding="UTF-8"?
    !DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"
    struts-config
    data-sources
    data-source key="dataSource" type="org.apache.struts.util.GenericDataSource"
    set-property property="driverClassName" value="com.borland.datastore.jdbc.DataStoreDriver" /
    set-property property="url" value="jdbc:borland:dslocal:C:\xjozo\test.jds" /
    set-property property="username" value="jozo" /
    set-property property="password" value="jozo" /
    /data-source
    /data-sources
    /struts-configAnd when I try to run the app noe it throws this an exception (see log below).
    These libraries I have in my WEB-INF\lib\:

    beandt.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-lang.jar
    commons-logging.jar
    commons-validator.jar
    dx.jar
    jakarta-oro.jar
    jds.jar
    struts.jar

    The file test.jds exists.

    Can anybody help me, I am realy out of any ideas.
    Here is the tomcat log:

    C:\xjozo\JBuilderX\jdk1.4\bin\javaw -classpath "C:\xjozo\JBuilderX\thirdparty\jakarta-tomcat-4.0.6-LE-jdk14\bin\bootstrap.jar;C:\xjozo\JBuilderX\jdk1.4\lib\tools.jar" -Dcatalina.home="C:/xjozo/JBuilderX/thirdparty/jakarta-tomcat-4.0.6-LE-jdk14" org.apache.catalina.startup.Bootstrap -config C:\xjozo\jbproject\proj5\Tomcat\conf\server8080.xml start
    HttpConnector Opening server socket on all host IP addresses
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.6
    WebappLoader[WebModule1]: Deploying class repositories to work directory C:\xjozo\jbproject\proj5\Tomcat\work\WebModule1
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/beandt.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\beandt.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-beanutils.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-beanutils.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-collections.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-collections.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-digester.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-digester.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-fileupload.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-fileupload.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-lang.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-lang.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-logging.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-logging.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-validator.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-validator.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/dx.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\dx.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/jakarta-oro.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\jakarta-oro.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/jds.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\jds.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/struts.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\struts.jar
    WebappLoader[WebModule1]: Reloading checks are enabled for this Context
    StandardManager[WebModule1]: Seeding random number generator class java.security.SecureRandom
    StandardManager[WebModule1]: Seeding of random number generator has been completed
    ContextConfig[WebModule1]: Added certificates - request attribute Valve
    StandardWrapper[WebModule1:default]: Loading container servlet default
    StandardWrapper[WebModule1:action]: Marking servlet action as unavailable
    StandardContext[WebModule1]: Servlet /WebModule1 threw load() exception: javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
    javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:895)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
    at org.apache.catalina.core.StandardService.start(StandardService.java:388)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
    StandardWrapper[WebModule1:invoker]: Loading container servlet invoker
    HttpConnector[8080] Starting background thread
    Stopping service Tomcat-Standalone
    HttpConnector[8080] Stopping background thread
    StandardHost[localhost]: Removing web application at context path /WebModule1

    DB:2.68:Struts Data-Source Problem dc

    Hi,
    I can not solve this problem form more then one week:
    I am trying to create simple web application using Struts
    in JBuilder X.
    Here are the steps I am doing:
    1. Create new project
    2. Create new Web-App
    3. Create new JSP with simple submit form
    Now the application can be runned and everything is ok.
    4. Add new dataSource to struts-config.xml so it looks like this:

    ?xml version="1.0" encoding="UTF-8"?
    !DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"
    struts-config
    data-sources
    data-source key="dataSource" type="org.apache.struts.util.GenericDataSource"
    set-property property="driverClassName" value="com.borland.datastore.jdbc.DataStoreDriver" /
    set-property property="url" value="jdbc:borland:dslocal:C:\xjozo\test.jds" /
    set-property property="username" value="jozo" /
    set-property property="password" value="jozo" /
    /data-source
    /data-sources
    /struts-configAnd when I try to run the app noe it throws this an exception (see log below).
    These libraries I have in my WEB-INF\lib\:

    beandt.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-lang.jar
    commons-logging.jar
    commons-validator.jar
    dx.jar
    jakarta-oro.jar
    jds.jar
    struts.jar

    The file test.jds exists.

    Can anybody help me, I am realy out of any ideas.
    Here is the tomcat log:

    C:\xjozo\JBuilderX\jdk1.4\bin\javaw -classpath "C:\xjozo\JBuilderX\thirdparty\jakarta-tomcat-4.0.6-LE-jdk14\bin\bootstrap.jar;C:\xjozo\JBuilderX\jdk1.4\lib\tools.jar" -Dcatalina.home="C:/xjozo/JBuilderX/thirdparty/jakarta-tomcat-4.0.6-LE-jdk14" org.apache.catalina.startup.Bootstrap -config C:\xjozo\jbproject\proj5\Tomcat\conf\server8080.xml start
    HttpConnector Opening server socket on all host IP addresses
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.6
    WebappLoader[WebModule1]: Deploying class repositories to work directory C:\xjozo\jbproject\proj5\Tomcat\work\WebModule1
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/beandt.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\beandt.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-beanutils.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-beanutils.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-collections.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-collections.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-digester.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-digester.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-fileupload.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-fileupload.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-lang.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-lang.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-logging.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-logging.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/commons-validator.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\commons-validator.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/dx.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\dx.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/jakarta-oro.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\jakarta-oro.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/jds.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\jds.jar
    WebappLoader[WebModule1]: Deploy JAR /WEB-INF/lib/struts.jar to C:\xjozo\jbproject\proj5\WebModule1\WEB-INF\lib\struts.jar
    WebappLoader[WebModule1]: Reloading checks are enabled for this Context
    StandardManager[WebModule1]: Seeding random number generator class java.security.SecureRandom
    StandardManager[WebModule1]: Seeding of random number generator has been completed
    ContextConfig[WebModule1]: Added certificates - request attribute Valve
    StandardWrapper[WebModule1:default]: Loading container servlet default
    StandardWrapper[WebModule1:action]: Marking servlet action as unavailable
    StandardContext[WebModule1]: Servlet /WebModule1 threw load() exception: javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
    javax.servlet.ServletException: Error instantiating servlet class org.apache.struts.action.ActionServlet
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:895)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3279)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
    at org.apache.catalina.core.StandardService.start(StandardService.java:388)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
    StandardWrapper[WebModule1:invoker]: Loading container servlet invoker
    HttpConnector[8080] Starting background thread
    Stopping service Tomcat-Standalone
    HttpConnector[8080] Stopping background thread
    StandardHost[localhost]: Removing web application at context path /WebModule1

  • RELEVANCY SCORE 2.68

    DB:2.68:Web-Inf/Lib Remains Empty After Deployment 31



    Hi,

    I'm using Eclipse 3.5.2 with WTP and the JBoss AS tools 3.1cr2 server adapter with an EAR project that consists out of an EJB module and a web module. The web module has a bunch of jar files in [web module project root]/libraries/somedir, where "somedir" refers to several directories like apache-commons, jsf (for the richfaces libs, not jsf itself of course) etc.

    The jar files in that directory are added to the .classpath of that project and in project - Java EE Module Dependencies - Web Libraries, these are marked for being deployed to WEB-INF/lib. In .classpath, entries like this are added:

    classpathentry kind="lib" path="libraries/apache-commons/commons-beanutils-1.7.0.jar" sourcepath="libraries/apache-commons/commons-beanutils-src.jar"
    attributes
    attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/
    /attributes
    /classpathentry

    DB:2.68:Web-Inf/Lib Remains Empty After Deployment 31


    This seems very very familiar to https://jira.jboss.org/jira/browse/JBIDE-6024

    Indeed it does. However, we did just encounter exactly the same problem deploying to a Tomcat instance using the WTP supplied server adapter. We added libs to our project, outside of WEB-INF/lib. Added them to the .classpath and marked them as web library dependencies.

    After a redeploy, the new libs weren't deployed, but the old ones were. The simple close, open, redeploy cycle didn't help here. Eventually, after much trial and error suddenly the following seemed to fix the problem: close, open, remove deployment, clean, add deployment.

  • RELEVANCY SCORE 2.68

    DB:2.68:Connect Ftpclient To A Ibm 4690 Os Server. 97


    Hi,

    I'm facing some problem connectiong to a IBM 4690 OS Server with the FTPClient class from the commons-net-1.4.1 library. It seems it can't read the folder on the server. The problem is that using the FTP client from Internet Explorer is works perfectly.

    Here is my code (kind of hardcoded but it's only to test).

    FTPFile[] files = null;

    try {
    files = listFiles(remoteFolder);
    } catch (ParserInitializationException e) {

    FTPListParseEngine engine = initiateListParsing("org.apache.commons.net.ftp.parser.EnterpriseUnixFTPEntryParser", remoteFolder);

    if (!engine.hasNext()) {
    throw new SystemException("No file found.");
    }
    }Here is the ParserInitializationException that it throws:

    org.apache.commons.net.ftp.parser.ParserInitializationException: Unknown parser type: OS 4690 operating system
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:118)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
    ...I've tried to use many of the FTPFileListParser available but without success.

    Anyone has an idea of how could I handle the problem? Where could I find a Parser that would works?

    Thanks,

    MJalbert

    DB:2.68:Connect Ftpclient To A Ibm 4690 Os Server. 97

    Hi everyone,

    I've finally resolved the problem. The IBM 4690 needs a special parser in order to use the "listFiles()" method.

    If anyone needs the parser, feel free to contact me.

    MJalbert

  • RELEVANCY SCORE 2.68

    DB:2.68:Getting Segmentation Fault When The Application Donwloading More Images Asynchrounously pf



    my application is running the image loader sample application, it works fine for downloading upto 250 images asynchronously. if we download more than the 250 it is crashing with message (terminated SIGSEGV code=1 fltno=11 ip=79a4e45c(/base/usr/lib/qt4/lib/libQtCore.so.4.8.5@_ZN27QEventDispatcherUNIXPrivate8doSelectE6QFlagsIN10QEventLoop17ProcessEventsFlagEEP7timeval+0x11f) mapaddr=0014e45c. ref=597e3034 bdslot=1).

    the following code creates image loader object for each image.
    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */

    /*
    * Legal Information for images used.
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/6/62/Peace_riding_in_a_triumphal_chariot_Bosio_Carrous...
    * Attribution: By PierreSelim (Own work) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/a/af/Crepuscular_rays_with_reflection_in_GGP.jpg
    * Attribution: By Brocken Inaglory (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/2/2a/Anodorhynchus_hyacinthinus_-Hyacinth_Macaw_-side_...
    * Attribution: By Randy (originally posted to Flickr as Hyacinth) [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/2/29/Bataille_Waterloo_1815_reconstitution_2011_cuiras...
    * Attribution: By Myrabella (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/e/ec/Armadillo_Aerospace_Pixel_Hover.jpg
    * Attribution: By Armadillo Aerospace/Matthew C. Ross [CC-BY-3.0-us (http://creativecommons.org/licenses/by/3.0/us/deed.en)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/f/f5/A_sculpture_at_the_entrance_to_the_palace_of_Vers...
    * Attribution: By Chris Robinson [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/6/6d/Firehole_river_at_Upper_Geyser_Basin-2008-june.jp...
    * Attribution: By Brocken Inaglory (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/7/7c/Peugeot_206_WRC.jpg
    * Attribution: By Christopher Batt ( http://www.flickr.com/people/christopherbatt/ ) [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/9/97/Toda_Hut.JPG
    * Attribution: Pratheep P S [CC-BY-SA-2.5 (http://creativecommons.org/licenses/by-sa/2.5)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/d/dc/Marriott_Center_1.JPG
    * Attribution: By Mark A. Philbrick (Brigham Young University) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
    */

    #include "app.hpp"

    #include bb/cascades/AbstractPane
    #include bb/cascades/Application
    #include bb/cascades/QmlDocument

    using namespace bb::cascades;

    /**
    * This app demonstrates the techniques how to use multi-threads to handle network activities
    * and sync the results with the main thread.
    *
    * In this app, you will learn:
    * -how to use QNetworkAccessManager to perform asynchronous network requests.
    * -how to use QThread to perform time-consuming operations in their own threads.
    *
    */
    //! [0]
    App::App(QObject *parent) :
    QObject(parent), m_model(new QListDataModelQObject*()) {
    // Register custom type to QML
    qmlRegisterTypeImageLoader();

    m_model-setParent(this);

    // Fill the model with datafor
    for (int i = 0; i 250; i++) {
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/6/62/Peace_riding_in_a_triumphal_chariot_Bosio_Carrous...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/a/af/Crepuscular_rays_with_reflection_in_GGP.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/2/2a/Anodorhynchus_hyacinthinus_-Hyacinth_Macaw_-side_...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/2/29/Bataille_Waterloo_1815_reconstitution_2011_cuiras...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/e/ec/Armadillo_Aerospace_Pixel_Hover.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/f/f5/A_sculpture_at_the_entrance_to_the_palace_of_Vers...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/6/6d/Firehole_river_at_Upper_Geyser_Basin-2008-june.jp...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/7/7c/Peugeot_206_WRC.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/9/97/Toda_Hut.JPG",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/d/dc/Marriott_Center_1.JPG",
    this));
    }

    // Create the UI
    QmlDocument* qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml-setContextProperty("_app", this);

    AbstractPane *root = qml-createRootObjectAbstractPane();
    Application::instance()-setScene(root);
    }
    //! [0]

    //! [1]
    void App::loadImages() {
    // Call the load() method for each ImageLoader instance inside the model
    for (int row = 0; row m_model-size(); ++row) {
    qobject_castImageLoader*(m_model-value(row))-load();
    }
    }
    //! [1]

    bb::cascades::DataModel* App::model() const {
    return m_model;
    }

    Imageloader.cpp file which downloads the images asynchronously.here at get request i am getting segmentation fault.
    ImageLoader::ImageLoader(const QString imageUrl, QObject* parent) :
    QObject(parent), m_loading(false), m_imageUrl(imageUrl) {
    }
    //! [0]

    /**
    * Destructor
    */
    //! [1]
    ImageLoader::~ImageLoader() {
    if (m_thread)
    m_thread-wait();
    }

    void ImageLoader::load() {
    m_loading = true;
    emit loadingChanged();
    QNetworkAccessManager* netManager = new QNetworkAccessManager(this);

    const QUrl url(m_imageUrl);
    QNetworkRequest request(url);
    request.
    QNetworkReply* reply = netManager-get(request); //here iam getting the segmentation fault.

    if (reply != NULL) {
    connect(reply, SIGNAL(finished()), this, SLOT(onReplyFinished()));

    }

    }
    void ImageLoader::onImageProcessingFinished(const QImage image) {
    const QImage swappedImage = image.rgbSwapped();
    const bb::ImageData imageData = bb::ImageDatacolon;:fromPixels(
    swappedImage.bits(), bb::PixelFormat::RGBX, swappedImage.width(),
    swappedImage.height(), swappedImage.bytesPerLine());

    m_image = bb::cascades::Image(imageData);
    emit imageChanged();

    m_label.clear();
    emit labelChanged();

    m_loading = false;
    emit loadingChanged();
    }
    //! [4]

    QVariant ImageLoader::image() const {
    return QVariant::fromValue(m_image);
    }

    QString ImageLoader::label() const {
    return m_label;
    }

    bool ImageLoader::loading() const {
    return m_loading;
    }
    imageprocessor will process the data to images and displays after processing.

    if i dont use posting it works fine for any number of images. I understand that the problem with eventloop when i call get request. how to resolve this issue as i need to follow this approach for downloading large number of images.

    Thanks for spending your precious time.

    Kranthi.

    DB:2.68:Getting Segmentation Fault When The Application Donwloading More Images Asynchrounously pf


    my application is running the image loader sample application, it works fine for downloading upto 250 images asynchronously. if we download more than the 250 it is crashing with message (terminated SIGSEGV code=1 fltno=11 ip=79a4e45c(/base/usr/lib/qt4/lib/libQtCore.so.4.8.5@_ZN27QEventDispatcherUNIXPrivate8doSelectE6QFlagsIN10QEventLoop17ProcessEventsFlagEEP7timeval+0x11f) mapaddr=0014e45c. ref=597e3034 bdslot=1).

    the following code creates image loader object for each image.
    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */

    /*
    * Legal Information for images used.
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/6/62/Peace_riding_in_a_triumphal_chariot_Bosio_Carrous...
    * Attribution: By PierreSelim (Own work) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/a/af/Crepuscular_rays_with_reflection_in_GGP.jpg
    * Attribution: By Brocken Inaglory (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/2/2a/Anodorhynchus_hyacinthinus_-Hyacinth_Macaw_-side_...
    * Attribution: By Randy (originally posted to Flickr as Hyacinth) [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/2/29/Bataille_Waterloo_1815_reconstitution_2011_cuiras...
    * Attribution: By Myrabella (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/e/ec/Armadillo_Aerospace_Pixel_Hover.jpg
    * Attribution: By Armadillo Aerospace/Matthew C. Ross [CC-BY-3.0-us (http://creativecommons.org/licenses/by/3.0/us/deed.en)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/f/f5/A_sculpture_at_the_entrance_to_the_palace_of_Vers...
    * Attribution: By Chris Robinson [CC-BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/6/6d/Firehole_river_at_Upper_Geyser_Basin-2008-june.jp...
    * Attribution: By Brocken Inaglory (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/7/7c/Peugeot_206_WRC.jpg
    * Attribution: By Christopher Batt ( http://www.flickr.com/people/christopherbatt/ ) [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/9/97/Toda_Hut.JPG
    * Attribution: Pratheep P S [CC-BY-SA-2.5 (http://creativecommons.org/licenses/by-sa/2.5)], via Wikimedia Commons
    *
    * Image: http://upload.wikimedia.org/wikipedia/commons/d/dc/Marriott_Center_1.JPG
    * Attribution: By Mark A. Philbrick (Brigham Young University) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
    */

    #include "app.hpp"

    #include bb/cascades/AbstractPane
    #include bb/cascades/Application
    #include bb/cascades/QmlDocument

    using namespace bb::cascades;

    /**
    * This app demonstrates the techniques how to use multi-threads to handle network activities
    * and sync the results with the main thread.
    *
    * In this app, you will learn:
    * -how to use QNetworkAccessManager to perform asynchronous network requests.
    * -how to use QThread to perform time-consuming operations in their own threads.
    *
    */
    //! [0]
    App::App(QObject *parent) :
    QObject(parent), m_model(new QListDataModelQObject*()) {
    // Register custom type to QML
    qmlRegisterTypeImageLoader();

    m_model-setParent(this);

    // Fill the model with datafor
    for (int i = 0; i 250; i++) {
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/6/62/Peace_riding_in_a_triumphal_chariot_Bosio_Carrous...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/a/af/Crepuscular_rays_with_reflection_in_GGP.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/2/2a/Anodorhynchus_hyacinthinus_-Hyacinth_Macaw_-side_...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/2/29/Bataille_Waterloo_1815_reconstitution_2011_cuiras...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/e/ec/Armadillo_Aerospace_Pixel_Hover.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/f/f5/A_sculpture_at_the_entrance_to_the_palace_of_Vers...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/6/6d/Firehole_river_at_Upper_Geyser_Basin-2008-june.jp...
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/7/7c/Peugeot_206_WRC.jpg",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/9/97/Toda_Hut.JPG",
    this));
    m_model-append(
    new ImageLoader(
    "http://upload.wikimedia.org/wikipedia/commons/d/dc/Marriott_Center_1.JPG",
    this));
    }

    // Create the UI
    QmlDocument* qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml-setContextProperty("_app", this);

    AbstractPane *root = qml-createRootObjectAbstractPane();
    Application::instance()-setScene(root);
    }
    //! [0]

    //! [1]
    void App::loadImages() {
    // Call the load() method for each ImageLoader instance inside the model
    for (int row = 0; row m_model-size(); ++row) {
    qobject_castImageLoader*(m_model-value(row))-load();
    }
    }
    //! [1]

    bb::cascades::DataModel* App::model() const {
    return m_model;
    }

    Imageloader.cpp file which downloads the images asynchronously.here at get request i am getting segmentation fault.
    ImageLoader::ImageLoader(const QString imageUrl, QObject* parent) :
    QObject(parent), m_loading(false), m_imageUrl(imageUrl) {
    }
    //! [0]

    /**
    * Destructor
    */
    //! [1]
    ImageLoader::~ImageLoader() {
    if (m_thread)
    m_thread-wait();
    }

    void ImageLoader::load() {
    m_loading = true;
    emit loadingChanged();
    QNetworkAccessManager* netManager = new QNetworkAccessManager(this);

    const QUrl url(m_imageUrl);
    QNetworkRequest request(url);
    request.
    QNetworkReply* reply = netManager-get(request); //here iam getting the segmentation fault.

    if (reply != NULL) {
    connect(reply, SIGNAL(finished()), this, SLOT(onReplyFinished()));

    }

    }
    void ImageLoader::onImageProcessingFinished(const QImage image) {
    const QImage swappedImage = image.rgbSwapped();
    const bb::ImageData imageData = bb::ImageDatacolon;:fromPixels(
    swappedImage.bits(), bb::PixelFormat::RGBX, swappedImage.width(),
    swappedImage.height(), swappedImage.bytesPerLine());

    m_image = bb::cascades::Image(imageData);
    emit imageChanged();

    m_label.clear();
    emit labelChanged();

    m_loading = false;
    emit loadingChanged();
    }
    //! [4]

    QVariant ImageLoader::image() const {
    return QVariant::fromValue(m_image);
    }

    QString ImageLoader::label() const {
    return m_label;
    }

    bool ImageLoader::loading() const {
    return m_loading;
    }
    imageprocessor will process the data to images and displays after processing.

    if i dont use posting it works fine for any number of images. I understand that the problem with eventloop when i call get request. how to resolve this issue as i need to follow this approach for downloading large number of images.

    Thanks for spending your precious time.

    Kranthi.

  • RELEVANCY SCORE 2.68

    DB:2.68:Set Up For Apache Ftp d3


    I am attempting to use ftp from a java program. When I attempt to add the apache Ftp by using the statement
    import org.apache.commons.net.ftp.FTP; I get the error
    package org.apache.commons.net.ftp does not exist

    The jar file commons-net-ftp-2.0.jar is in F:\ directory.
    My class path is
    .;F:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip;F:\commons-net-ftp-2.0.jar;
    Does someone have any suggestions.

    DB:2.68:Set Up For Apache Ftp d3

    I figured it out. You have to add the jar file to the JDE project. Sorry about that!

  • RELEVANCY SCORE 2.67

    DB:2.67:How To Use Ftpclient.List(String Mask) ? pm


    Hi all,

    about the package enterprisedt.net.ftp.FTPClient

    (http://www.enterprisedt.com/downloads/ftp.html)

    I have a problem using the FTPClient method "list",

    what do they call a "mask", I would like an example with "list".

    thanks

    Yves

    DB:2.67:How To Use Ftpclient.List(String Mask) ? pm

    Looks like you didn't remember to set the transfertype. The line 546 goes if (transferType.equals(FTPTransferType.BINARY)) {

  • RELEVANCY SCORE 2.67

    DB:2.67:Propertyutils 73



    Using latest RichFaces with Seam with rich:scrollableDataTable I get:`Caused by: java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils`I have looked in War and the class seems to exist (commonsbeanutils.jar).Why would I be getting this?

    DB:2.67:Propertyutils 73


    Using latest RichFaces with Seam with rich:scrollableDataTable I get:`Caused by: java.lang.NoClassDefFoundError: org/apache/commons/beanutils/PropertyUtils`I have looked in War and the class seems to exist (commonsbeanutils.jar).Why would I be getting this?

  • RELEVANCY SCORE 2.67

    DB:2.67:Jbpmschema Fails To Build For Cvs Head 73



    I'm trying to build the HEAD of CVS and it's failing with classpath issues in the jbpmschema task.Is this a temporary or known problem? If so, I'll ignore it for now otherwise I'll keep looking at my checkout.
    [jbpmschema] using jbpm configuration jbpm/db2.jbpm.cfg.xml

    BUILD FAILED
    C:\projects\hibernate\jBPM\jbpm.3\build\build.xml:36: The following error occurred while executing this line:
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    DB:2.67:Jbpmschema Fails To Build For Cvs Head 73


    BTW, ant version 1.6.2 does compile the project, but 1.6.5 does not.

  • RELEVANCY SCORE 2.67

    DB:2.67:Java.Lang.Noclassdeffounderror xd


    Hi Experts,I'm Using with nwds 7.0 sp18and i'm want to use with FTPClientbut i'm get the error message "java.lang.NoClassDefFoundError: org/apache/commons/net/SocketClient "I'm using with external libraries according to the bloghttp://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417200)ID0624163350DB00824325244483116045End?blog=/pub/wlg/4512and i'm using with the jar commons-net-1.3.0.jarbut i'ts not workingdo you have a soultion?thanksYossi

    DB:2.67:Java.Lang.Noclassdeffounderror xd

    In the library reference, givepakage name say ~ J2EE EA DC NameEg. sap.com~testEmpProjRegards,Tushar Sinha

  • RELEVANCY SCORE 2.67

    DB:2.67:Struts, Log4j, Commons-Logging Problems In 9.0.4 Too?? f8


    ok... I have a J2EE project that uses struts, log4j, a couple ejbs. I can successfully deploy and run on JBoss. However, our client insists that we use the 10g App Server, so I tried to deploy on 10g v10.1.2 (after making the appropriate changes to the deployment descriptors); the ear file deployed without problems, but when using the application, I encountered the following error when the app got to part of my code that tries to create a log file using the commons-logging framework:

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    I see from these forums that there is a known problem regarding commons-logging and log4j with v10.1.2 (Help: 10g, struts, commons-logging and log4j doesn't work in 10g!? 9i fine! )..... so, I installed v9.0.4 of the 10g AppServer, deployed and ...... drum roll please.... I get the same error.

    The commons-logging.jar file IS in the [application dir]/WEB-INF/lib directory so the app should be finding the org.apache.commons.logging.LogFactory class file. And - struts is working based on page navigation prior to hitting the error (which I've heard indicates that the commons-logging.jar library is being invoked at some point).

    So... am I missing something? or does v9.0.4 also have the bug (related to classloaders)???

    sure hope someone can help....
    Scott

    DB:2.67:Struts, Log4j, Commons-Logging Problems In 9.0.4 Too?? f8

    i already searched for all instances of commons-logging.jar in the app server folders - it only occurs in my project folders, so that doesn't help much. I ended up writing my own logging framework, but it would still be nice to get the app server to play nice....

  • RELEVANCY SCORE 2.67

    DB:2.67:Unavailableexception: Org/Apache/Commons/Pool/Impl/Genericobjectpool cc


    Hello Friends,
    I am getting this error "javax.servlet.UnavailableException: org/apache/commons/pool/impl/GenericObjectPool". I am using Netbeans 6.0.I have written this code in struts-config file.
    data-sources
    data-source type="org.apache.commons.dbcp.BasicDataSource" key="org.apache.struts.action.DATA_SOURCE_KEY"
    set-property property="driverClassName"
    value="oracle.jdbc.driver.OracleDriver" /
    set-property property="url"
    value="jdbc:oracle:thin:@localhost:1521:gd" /
    set-property property="username"
    value="system"/
    set-property property="password"
    value="manager"/
    /data-source
    /data-sources

    I feel this error is because of Database connection Pool.I have also copied the commons-dbcp.jar in lib folder.Still getting this error.Not able to trace.Please help
    it's urgent.Many thanx in advance.

    DB:2.67:Unavailableexception: Org/Apache/Commons/Pool/Impl/Genericobjectpool cc

    I got the solution.I need to add commons-pool.jar along with commons-dbcp.jar.

    And of course it was urgent to me not for others as I was posting the problem. :)

  • RELEVANCY SCORE 2.67

    DB:2.67:Mysql Db Connection Problem. pc


    Hello,

    I am using this code to implement connection pool:
    private boolean makeConnection() throws ServletException, IOException
    {
    try
    {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    }
    catch (ClassNotFoundException e)
    {
    e.printStackTrace();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }

    DataSource dataSource = setupDataSource( "jdbc:mysql://localhost/admin?user=rootpassword=aSdf" );
    try
    {
    Connection conn = dataSource.getConnection();
    Statement statement = conn.createStatement();

    statement.executeUpdate( "INSERT INTO mytable VALUES(10000000, 'This is it');" );
    statement.close();

    return true;
    }
    catch(SQLException e)
    {
    e.printStackTrace();
    }

    return true;
    }

    public static DataSource setupDataSource(String connectURI)
    {
    ObjectPool connectionPool = new GenericObjectPool(null);
    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI,null);
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
    PoolingDataSource dataSource = new PoolingDataSource(connectionPool);

    return dataSource;
    }

    Here is the exception that I get:

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Servlet execution threw an exception
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

    root cause

    java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
    org.apache.commons.pool.impl.GenericObjectPool.init(GenericObjectPool.java:392)
    org.apache.commons.pool.impl.GenericObjectPool.init(GenericObjectPool.java:266)
    MakePosting.PostAdd.setupDataSource(PostAdd.java:118)
    MakePosting.PostAdd.makeConnection(PostAdd.java:85)
    MakePosting.PostAdd.processRequest(PostAdd.java:47)
    MakePosting.PostAdd.doGet(PostAdd.java:187)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.

    I included two jar files to my project
    1. C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\commons-pool-1.2.jar
    2. C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\mysql-connector-java-3.1.10-bin.jar

    What is the problem? Can't figure out what the problem is.

    Thanks.

    DB:2.67:Mysql Db Connection Problem. pc

    Are you by anychance using the MySQL Connector/J, which is downloaded from the mysql website:
    http://dev.mysql.com/downloads/connector/j/3.1.html

    The minmum imports which is needed for a simple application could be:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;You would then have to create a connection so place this within the class
    private Connection sqlConnection;To test if the driver is properly installed, you could add this function
    public void testDriver() throws Exception {
    System.out.println("Initializing Server... ");
    try {
    Class.forName("org.gjt.mm.mysql.Driver");
    System.out.println(" Driver Found.");
    } catch (ClassNotFoundException e) {
    System.out.println(" Driver Not Found, exiting..");
    throw (e);
    }
    }and to connect to the database you do this:
    public Connection getConnection(String host, String userDB, String passDB, String database) throws Exception {
    String url = "";
    try {
    url = "jdbc:mysql://" + host + "/" + database;

    Connection con = DriverManager.getConnection(url, userDB, passDB);
    System.out.println(" Database connection established to " + url+ ".");

    return con;
    } catch (java.sql.SQLException e) {
    System.out.println(" Connection couldn't be established to "+ url);
    throw (e);
    }
    }I believe thats an easy way to do it, read the docs:) they help tremendously.
    Enjoy heh

  • RELEVANCY SCORE 2.66

    DB:2.66:Ftp Using Sun.Net.Ftp To Upload Files ac


    We have been using a program for uploading files to a ftp server for several years, without problems, but now it is hanging in the line "TelnetOutputStream netOut = ftpClient.put(fileName)".
    If anybody have a ideer to analyse or solve the problem I wouldt bee extremly glad.

    Regards
    Ivan

    The code is simuler to the following:

    import sun.net.ftp.FtpClient;
    import java.io.File;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import sun.net.TelnetInputStream;
    import sun.net.TelnetOutputStream;

    private static void usingFTPClientPut() {
    String server = "www.test.com";
    String user = "testUser";
    String passwd = "testPassword";
    String fileName = "Test.tif";
    FtpClient ftpClient = new FtpClient();
    try {
    ftpClient.openServer(server);
    ftpClient.login(user, passwd);
    ftpClient.cd("my/test");
    ftpClient.binary();
    TelnetOutputStream netOut = ftpClient.put(fileName); !!!!!!!!!Problem
    File file = new File(fileName);

    // Now transfer the file contents
    InputStream fileIn = new FileInputStream(file);
    byte c[] = new byte[1000];
    int read = 0;
    while ((read = fileIn.read(c)) != -1) {
    netOut.write(c, 0, read);
    }
    fileIn.close();
    netOut.close();
    ftpClient.closeServer();
    }
    catch (Exception excp) {
    System.out.println("Exception: " + excp);
    }
    }

    DB:2.66:Ftp Using Sun.Net.Ftp To Upload Files ac

    What I say is that we havent changed anything on our
    machine.Then it has nothing to do with java.

    Furthermore if I try to connect "manuely" to
    the FTP server then it is possible to upload a file to
    it.
    So Please, if anybody know away to find out why this
    program suddenly hangs up in the FTP.put command, when
    it has been working for years I will be glad.The network probably changed.

    New router, new gateway (or maybe not new), or maybe the one that is there is failing.

    Or someone is loading the network and "hanging" is really just "taking a really long time." Faulty devices, like network cards, can cause this to happen.)

  • RELEVANCY SCORE 2.65

    DB:2.65:Error While Ftp: Software Caused Connection Abort: Socket Write Error sk


    Hello,
    I am trying to ftp using the Java ftp libs, and when that failed, the Commons Net FTPClient.
    I am able to login and the empty file is created. However for both, I get the following SocketException. Any help appreciated. The code is mostly taken from the javadocs for Commons Net.
    thanks,
    Anil
    -------------------

    Connected to juwo.com.
    230 User juwo logged in.
    java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(Unknown Source)
    at java.net.SocketOutputStream.write(Unknown Source)
    at org.apache.commons.net.io.SocketOutputStream.write(SocketOutputStream.java:69)
    at MyFTP.put3(MyFTP.java:79)
    at MyFTP.main(MyFTP.java:105)

    ============= CODE ==================
    static void put3(String server, String user, String passwd)
    throws IOException {
    boolean error = false;
    FTPClient ftp = null;
    try {
    int reply;
    ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(user, passwd);

    System.out.println("Connected to " + server + ".");
    System.out.print(ftp.getReplyString());

    // After connection attempt, you should check the reply code to
    // verify
    // success.
    reply = ftp.getReplyCode();

    if (!FTPReply.isPositiveCompletion(reply)) {
    ftp.disconnect();
    System.err.println("FTP server refused connection.");
    System.exit(1);
    }
    ftp.setFileType(FTP.IMAGE_FILE_TYPE);
    ftp.cwd("/wwwroot/nodepad");
    OutputStream out = ftp.appendFileStream("anilsvoice.spx");
    File src = new File("C:\\anilsvoice.spx");
    InputStream in = new FileInputStream(src);

    // Transfer bytes from in to out
    byte[] buf = new byte[1024];
    int len;
    while ((len = in.read(buf)) 0) {
    out.write(buf, 0, len);
    }
    in.close();
    out.close();
    ftp.logout();
    } catch (IOException e) {
    error = true;
    e.printStackTrace();
    } finally {
    if (ftp.isConnected()) {
    try {
    ftp.disconnect();
    } catch (IOException ioe) {
    // do nothing
    }
    }
    System.exit(error ? 1 : 0);
    }

    }

    DB:2.65:Error While Ftp: Software Caused Connection Abort: Socket Write Error sk

    No, that was not the problem. logout will not produce that error on a closed stream. The problem was external - my web hosting provider's disk space quota was full! :)
    I ran my original program and it worked without errors and so did your code. Thanks and sorry for any inconvenience!
    -
    Anil

    Found it. Had to read down a bit, but I found it. I
    can see how you might have missed it.
    Look at #5-6, they are in REVERSE ORDER.

    You need to send the ftp.logout() BEFORE you
    close the in/out streams. You CAN close the stream
    'in' because that is connected to a local file, not
    the socket. However, when you create the stream 'out'
    you are switching that referenced object to the new
    'out' object. When the ftp.logout() method is called,
    it is trying to write to the now-closed 'out' stream
    and NOT it's original stream which was deleted when
    you created the 'out' stream with that object as it's

  • RELEVANCY SCORE 2.65

    DB:2.65:Problem With Pl/Sql In Java dp


    Hi, I was trying make a procedure that send a file by FTP,

    my java code is:

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.SocketException;
    import org.apache.commons.net.ftp.FTPClient;

    public class FTP {

    public static void send (String host,
    String user,
    String passwd,
    String filePath,
    String fileName) throws SocketException, IOException {

    FTPClient ftpClient = new FTPClient();

    ftpClient.connect(host);
    ftpClient.login(user, passwd);
    ftpClient.changeWorkingDirectory(filePath);

    InputStream in = new FileInputStream(new File(fileName));
    ftpClient.appendFile(fileName, in);

    ftpClient.disconnect();
    in.close();
    System.out.println("send file");
    }
    }

    and i use commons-net I add librarys in my db oracle 9i :

    loadjava -user ****/***** -verbose -resolve jakarta-oro-2.0.8.jar
    loadjava -user ****/***** -verbose -resolve commons-net-1.2.2.jar
    loadjava -user ****/***** -verbose -resolve FTP.java

    is fine, and after create a procedure for wrap:

    CREATE OR REPLACE PROCEDURE SENDFTP(host IN VARCHAR, user IN VARCHAR,
    passwd IN VARCHAR,
    filePathTo IN VARCHAR,
    fileName IN VARCHAR) AS LANGUAGE JAVA NAME 'FTP.send(java.lang.String,
    java.lang.String,java.lang.String,java.lang.String,java.lang.String)';
    /
    SHOW ERRORS;

    but when I call SENDFTP(....) my server stop and I have that stop oracle and start.

    is good idea use Java Procedure ? why this error ?

    thanks a lot

    Message was edited by:
    alex_florentino@hotmail.com

    Message was edited by:
    alex_florentino@hotmail.com

    DB:2.65:Problem With Pl/Sql In Java dp

    change varchar to varchar2 in:

    CREATE OR REPLACE PROCEDURE SENDFTP(host IN VARCHAR2, user IN VARCHAR2,
    passwd IN VARCHAR2,
    filePathTo IN VARCHAR2,
    fileName IN VARCHAR2) AS LANGUAGE JAVA NAME 'FTP.send(java.lang.String,
    java.lang.String,java.lang.String,java.lang.String,java.lang.String)';

  • RELEVANCY SCORE 2.64

    DB:2.64:Re: Tostring Builder 3x


    http://jakarta.apache.org/commons/lang/apidocs/org/apache/commons/lang/builder/ToStringBuilder.html

    DB:2.64:Re: Tostring Builder 3x

    Just asking for some useful pointers, which you gave
    none.First of all I did - you didnt see it though. Bottom line is that it isnt possible to automate toString() unless one (1) specifies naming conventions for the methods that should be included in the output (so that only methods without side-effects are included), and (2) assume that public state is the only state interesting for toString.

    I have written code for automating toString also - it is after all a pretty obvious thing to do when one first discovers the reflection api. I limited the methods to those returning non-void, and beginning with getXXX, plus a special case not to match getClass(). It was a usefull exercise, and I could re-use some of the ideas when I later had to write a automatic XML generator.

    Br - J

  • RELEVANCY SCORE 2.64

    DB:2.64:Is It Ok To Remove Commons-Httpclient.Jar?? kc



    our application uses older version of commons.jar from apache which contains httpclient code.we have ear file which uses one of the classes of httpclient.It will take lot of testing and resouces to replace the comons.jar. we are not using it for our aplication and it is creating problem while class loading.Is it ok to remove the commons-httpclient.jar ??Does jboss will create problem internally??

    DB:2.64:Is It Ok To Remove Commons-Httpclient.Jar?? kc


    How about configuring classloader scoping for your application:https://www.jboss.org/community/docs/DOC-9288http://www.jboss.org/community/docs/DOC-10290

  • RELEVANCY SCORE 2.63

    DB:2.63:Strust Dtd Validation Fails Without Internet Connection pk


    Dear
    I am using struts validation:
    I am having a problem when the internet is down...my application throws
    Could not connect to remote host
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd"

    can anyone suggest a way out to make this read from local machine....by changing the DOCTYPE or someting like that.....

    !DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd"

    Thanks for your response in advance.....
    vijay
    vijay.r@uy-tcs.com

    DB:2.63:Strust Dtd Validation Fails Without Internet Connection pk

    !DOCTYPE form-validation SYSTEM "(relative-path/)validator_1_0.dtd"

  • RELEVANCY SCORE 2.63

    DB:2.63:Apache Commons Fileupload z9


    I'm trying to use the Apache Commons fileUpload utility to upload several files from user's local drive to the server. I get a list of file names and locations without submitting the form. So, I am not using the standard request object parsing as defined in the instructions. Can this be done, can I upload a list of some files without submitting a form and still use this fileUpload utility?

    DB:2.63:Apache Commons Fileupload z9

    I think play fool around with the user. Say you have a page a.jsp on load you can submit a form which is hidden to the user. And the servlet which will handle this request should send the "b.jsp" which is similar to a.jsp - hidden form submission trick.

  • RELEVANCY SCORE 2.63

    DB:2.63:Re: Two Styles Of Connection Pool 7k


    Depends on the appserver you're using. Apache Tomcat for example uses Apache Commons DBCP API.

    I recommend using it instead of a homegrown pooling framework. It is far more robust and configureable.

    DB:2.63:Re: Two Styles Of Connection Pool 7k

    Search on Google, on eraly time people create connection pool by themself, public synchronized Connection getConnection() { Connection con = null; if (freeConnections.size() 0) { // Pick the first Connection in the Vector // to get round-robin usage con = (Connection) freeConnections.firstElement(); freeConnections.removeElementAt(0); try { if (con.isClosed()) { log("Removed bad connection from " + name); // Try again recursively con = getConnection(); } } catch (SQLException e) { log("Removed bad connection from " + name); // Try again recursively con = getConnection(); } } else if (maxConn == 0 || checkedOut maxConn) { con = newConnection(); } if (con != null) { checkedOut++; } return con; } public synchronized void freeConnection(Connection con) { // Put the connection at the end of the Vector freeConnections.addElement(con); checkedOut--; notifyAll(); }right now people write connection pool by set properity in Context.xml and only have get connection but did not have return connection part , How the new JNDI handle the return pool connection? Thnak youpublic synchronized Connection getConnection() throws SQLException, ServletException { Connection conn = null; try { conn = pool.getConnection(); SQLWarning warning = conn.getWarnings(); } catch (SQLException sqle) { System.out.println("JDBC error:" + sqle.getMessage()); System.out.println("JDBC error:" + sqle.getSQLState()); System.out.println("JDBC error:" + sqle.getErrorCode()); sqle.printStackTrace(); throw sqle; } finally { try { conn.close(); } catch (SQLException e1) { e1.printStackTrace(); } conn = null; } return conn; }//end connection

  • RELEVANCY SCORE 2.62

    DB:2.62:Problem With Struts! 8j


    hi,

    i've written a servlet ------
    import org.apache.struts.digester.Digester;

    which gives error while compiling as--------
    cannot resolve symbol
    symbol : class Digester
    location: package digester
    import org.apache.struts.digester.Digester;

    after this somebody suggested me to----

    keep commons jar(common-*.jar) files in classpath.
    struts use Apache Commons' also.

    i did this also.....
    but still the same error arrises

    thanx
    ---Amita

    DB:2.62:Problem With Struts! 8j

    "amita" == amita amitanarote@hotmail.com writes:amita hi,
    amita i've written a servlet ------
    amita import org.apache.struts.digester.Digester;

    amita which gives error while compiling as--------
    amita cannot resolve symbol
    amita symbol : class Digester
    amita location: package digester
    amita import org.apache.struts.digester.Digester;

    amita after this somebody suggested me to----

    amita keep commons jar(common-*.jar) files in classpath.
    amita struts use Apache Commons' also.

    amita i did this also.....
    amita but still the same error arrises

    There are two issues here. One is making the classes properly available at
    deployment/runtime. The other is making them available at compile time. Your
    call to the "javac" task (I assume you're using Ant) needs to specify the
    commons jar files in its classpath. Don't bother setting the CLASSPATH
    environment variable.

    At deployment, make sure that the "commons" jar files are in your WEB-INF/lib
    directory of your web application.

    --
    ===================================================================
    David M. Karr ; Java/J2EE/XML/Unix/C++
    dmkarr@earthlink.net ; SCJP; SCWCD

  • RELEVANCY SCORE 2.62

    DB:2.62:I Have Problem When Use Jakarta Commons Net In Java mp


    Hi you, I'm new in Network Programming in Java and I'm excuting a FTP class to list all files and directories information from FTP Host . But I had a problem when I try to use "org.apache.commons.net.ftp" package in Jakarta Commons Net Library. It logins OK but fail when try list information in current working directory .
    -----------------------------------------------------
    Error on : FTPFile[] files = ftpClient.listFiles();
    ------------------------------------------------------------------------
    220 ftp1.0catch.com NcFTPd Server (licensed copy) ready.
    Workdir /
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParse r(DefaultFTPFileEntryParserFactory.java:169)
    at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(D efaultFTPFileEntryParserFactory.java:94)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2358)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2141)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2188)
    at JClient.FTPClientTrial.useFTP(FTPClientTrial.java:52)
    at JClient.FTPClientTrial.main(FTPClientTrial.java:23)
    Java Result: 1
    ---------------------------------------------------------------------------
    CODE :
    import java.text.DateFormat;
    import java.util.Date;
    import org.apache.commons.net.ftp.*;

    import java.io.*;
    public class FTPClientTrial {
    public static void main(String[] args) {
    new FTPClientTrial().useFTP("ftp://thanhnam-it.0catch.com", "/", "J://AcrobatReader//Readme.htm",
    "usernam", "password");
    }

    public void useFTP(String ftpserver, String directoryName,
    String filetoUpload, String username, String password) {
    FTPClient ftpClient = new FTPClient();

    try {
    ftpClient.connect(ftpserver);
    System.out.print(ftpClient.getReplyString());

    // check reply code.
    if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
    ftpClient.disconnect();
    System.out.println("Connection refused.");
    return;
    }

    ftpClient.login(username, password);
    System.out.println("Workdir " +
    ftpClient.printWorkingDirectory());

    //Store file
    FileInputStream input = new FileInputStream(filetoUpload);
    ftpClient.storeFile(filetoUpload, input);

    //ERROR HERE : FTPFile[] files = ftpClient.listFiles(); System.out.println( "Number of files in dir: " + files.length );
    DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT );
    for( int i=0; ifiles.length; i++ )
    {
    Date fileDate = files[ i ].getTimestamp().getTime();

    // Download a file from the FTP Server
    System.out.print( df.format( files[ i ].getTimestamp().getTime() ) );
    System.out.println( "\t" + files[ i ].getName() );
    File file = new File( "/directory" + File.separator + files[ i ].getName() );
    FileOutputStream fos = new FileOutputStream( file );
    ftpClient.retrieveFile( files[ i ].getName(), fos );
    fos.close();
    file.setLastModified( fileDate.getTime() );
    }

    ftpClient.logout();
    ftpClient.disconnect();
    System.out.println("Disconnected");

    } catch (IOException e) {
    if (ftpClient.isConnected()) {
    try {
    ftpClient.disconnect();
    System.out.println("Disconnected");
    }
    catch (IOException f) {
    // do nothing
    }
    }

    e.printStackTrace();
    }
    finally {
    try {
    ftpClient.logout();
    ftpClient.disconnect();
    }
    catch (IOException f) {
    System.out.println("Disconnected");
    }
    }
    }
    }
    ---------------------
    So I don't understand what type of error and how I can solve it? Anyone show me? Thank u a lot!

    Message was edited by:
    nfit_hut

  • RELEVANCY SCORE 2.62

    DB:2.62:Using Apache Commons Httpclient To Create A Custom Socket For Java Mail ka


    Does anyone know how to use Apache Commons HTTPClient to create a custom socket for Java mail. This is necessary for me to use NTLM authentication

    DB:2.62:Using Apache Commons Httpclient To Create A Custom Socket For Java Mail ka

    JavaMail doesn't use HTTP.

    If you want to add support for NTLM authentication to one of the standard protocols,
    your best bet is to create a SASL provider, although note that only JavaMail's IMAP
    provider uses SASL currently. The other protocols should add SASL support, but that
    hasn't been done yet.

  • RELEVANCY SCORE 2.62

    DB:2.62:Xml Rpc Problem xz


    Hi, in my program i am using XML RPC..

    On this line:
    Object result = sxrpc.execute("weblab.getFromSklad", params);

    i get following error. i tried everything, file xmlrpc-2.0-applet.jar is in lib/ext JRE directory also in classpath. what can i do? many thanks

    the error:

    Exception in thread "Thread-6" java.lang.NoClassDefFoundError: org/apache/commons/codec/EncoderException
    at org.apache.xmlrpc.applet.SimpleXmlRpcClient.execute(SimpleXmlRpcClient.java:92)
    at RpcCommunication.getSkladData(RpcCommunication.java:60)
    at GetData.run(GetData.java:19)

    DB:2.62:Xml Rpc Problem xz

    This really belongs on an Apache XML-RPC forum, but basically the problem is that you need yet another Apache JAR file. The list of required JARs that's provided with XML-RPC is not complete. You are missing the one that contains the 'commons codec', obviously.

  • RELEVANCY SCORE 2.61

    DB:2.61:About Ftpclient j3


    Hi,

    "list" and "get" methods work well when I'm connected to one server but doesn't work at all when connected to another one: onto that one I can log on without any problems and all functions work using "CuteFtp", but errors come when I try to use "list" and "get" from FTPClient package :

    http://www.enterprisedt.com/downloads/ftp/doc/index.html

    what could be the problem ?

    thanks

    Yves

    DB:2.61:About Ftpclient j3

    i used this api sometime ago and when i tried list command it used to give one of FTPException or IOException(i don't remember exactly which exception it was) when there was no file at server with the name given in list() method. when it get a file it doesn't give the exception.

  • RELEVANCY SCORE 2.61

    DB:2.61:Changing Working Directory For Ftp pz


    ok so here is my code...

    String server = "MY_SERVER";
    String username = "very";
    String password = "nice";

    FTPClient ftp = new FTPClient();
    try {
    ftp.connect(MY_SERVER);
    if(!ftp.login(username, password))
    {
    ftp.logout();
    }
    boolean dos = ftp.changeWorkingDirectory("C:/Documents and Settings/user/Desktop");
    System.out.println(dos);

    Basically I am trying to put files into the server through an ftp process, I am still new to this so I am not 100% sure if I even need to switch the working directory to the one on my computer with the files I want to put. And if I get the directory working, does anyone know how to actually put files into my server? I am using the Jakarta apache commons library

    DB:2.61:Changing Working Directory For Ftp pz

    I am trying to put files into the server through an
    ftp process, I am still new to this so I am not 100%
    sure if I even need to switch the working directory
    to the one on my computer with the files I want to
    put.No. The "working directory" is the directory on the server where you want to put or get files.

    And if I get the directory working, does anyone
    know how to actually put files into my server? I am
    using the Jakarta apache commons libraryI had forgotten how, so I went and looked at the API documentation. It didn't take me long to find the storeFile method.

    You've never used an FTP client before to send files to an FTP server? Then it's not surprising you have no idea how one works. Perhaps you should get hold of something like WS-FTP and try using that for a while, so you get the idea.

  • RELEVANCY SCORE 2.61

    DB:2.61:Wl 10.3 Commons Logfactory Noclassdeffounderror, Hibernate 37


    I keep getting this error when I try to deploy on weblogic 10.3. I'm trying to initialize hibernate through spring. We are using split-directory structure for development.

    Code:
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.hibernate.util.XMLHelper.clinit(XMLHelper.java:26)
    at org.hibernate.cfg.Configuration.reset(Configuration.java:196)

    Here is the spring configuration
    Code:
    bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"
    property name="environment"
    props
    prop key="java.naming.factory.initial"weblogic.jndi.WLInitialContextFactory/prop
    /props
    /property
    /bean

    bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
    property name="jndiTemplate" ref="jndiTemplate" /
    property name="jndiName" value="ds.oracleds" /
    /bean
    !-- lazy-init="true"--
    bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
    property name="dataSource" ref="dataSource" /
    property name="mappingResources"
    list
    valuetest.hbm.xml/value
    /list
    /property

    property name="hibernateProperties"
    props
    prop key="hibernate.dialect"org.hibernate.dialect.Oracle10gDialect/prop
    prop key="hibernate.show_sql"true/prop
    prop key="hibernate.generate_statistics"true/prop
    /props
    /property
    /bean
    bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"
    property name="sessionFactory" ref="sessionFactory" /
    /bean

    bean id="testDao" class="test.TestDao"
    property name="hibernateTemplate" ref="hibernateTemplate" /
    /bean

    I have commons-logging.jar in my classpath. The following is a list of jar files in my lib directory

    Code:
    antlr-2.7.6.jar
    asm-2.2.3.jar
    asm-commons-2.2.3.jar
    asm-util-2.2.3.jar
    cglib-2.2.jar
    commons-attributes-api.jar
    commons-attributes-compiler.jar
    commons-beanutils.jar
    commons-codec.jar
    commons-collections-3.1.jar
    commons-dbcp.jar
    commons-digester.jar
    commons-discovery.jar
    commons-fileupload.jar
    commons-httpclient.jar
    commons-io.jar
    commons-jexl-1.1.jar
    commons-lang.jar
    commons-logging.jar
    commons-pool.jar
    commons-validator.jar
    dom4j-1.6.1.jar
    easymock-2.5.1.jar
    ehcache-1.5.0.jar
    hibernate-annotations.jar
    hibernate-commons-annotations.jar
    hibernate-entitymanager.jar
    hibernate3.jar
    iText-2.1.0.jar
    jasperreports-3.7.0.jar
    javassist-3.9.0.GA.jar
    jaxb-api.jar
    jaxen-1.1-beta-7.jar
    jdt-compiler-3.1.1.jar
    jstl.jar
    jta-1.1.jar
    junit-4.1.jar
    log4j-1.2.15.jar
    ojdbc14.jar
    quartz-all-1.6.0.jar
    quartz-weblogic-1.6.0.jar
    slf4j-api-1.5.8.jar
    slf4j-jcl-1.5.8.jar
    spring.jar
    standard.jar
    struts-el.jar
    struts-legacy.jar
    struts.jar
    xalan-2.7.0.jar

    DB:2.61:Wl 10.3 Commons Logfactory Noclassdeffounderror, Hibernate 37

    Hi,

    Along with Hibernate 3.0 suit you will find two JARS:

    commons-logging-1.0.4.jar
    commons-logging.jar

    I can see only one Jar in your Jar List...not the commons-logging-1.0.4.jar.
    Please refer to the following link: http://jaysensharma.wordpress.com/hibernate/. Here u will find the Required Jars for Hibernate 3...

    Thanks
    Jay SenSharma

  • RELEVANCY SCORE 2.61

    DB:2.61:Apache Commons Httpclient - Keystore Problem z9


    Hi!

    What I need to do is to make a https connection with client authorization. I'm using apache commons httpclient to do this task but I've one problem that I can't solve. How to read the certifiactes from an particular keystore file into httpclient? Have no idea how to implement this.

    DB:2.61:Apache Commons Httpclient - Keystore Problem z9

    Here's the working solution:

    public class SSLConnection {

    private final String TAG = "[SSLConnection] ";
    private final Logger log = Logger.getLogger(SSLConnection.class);

    private final String KEYSTORE = "keystore.jks";
    private final String KEYSTORE_PASS = "keypass";
    private final String TRUSTSTORE = "truststore";
    private final String TRUSTSTORE_PASS = "trustpass";

    private static final PropertyUtils pu = new PropertyUtils("p.properties");

    private String URL = pu.getPropertyValue("URL");
    private String PROXY_IP = pu.getPropertyValue("WWW_PROXY_IP");
    private Integer PROXY_PORT = Integer.parseInt(pu.getPropertyValue("WWW_PROXY_PORT"));

    private final KeyStore keyStore;
    private final KeyStore trustStore;

    public SSLConnection() throws Exception {

    keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    trustStore = KeyStore.getInstance(KeyStore.getDefaultType());

    InputStream keyStoreIs = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(KEYSTORE));
    InputStream trustStoreIs = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(TRUSTSTORE));

    try {

    keyStore.load(keyStoreIs, KEYSTORE_PASS.toCharArray());
    trustStore.load(trustStoreIs, TRUSTSTORE_PASS.toCharArray());

    } finally {
    CommonsIOUtils.closeInputStream(keyStoreIs);
    CommonsIOUtils.closeInputStream(trustStoreIs);
    }

    }

    public void sendMessage(String msg) throws Exception {

    long token = System.currentTimeMillis();

    log.info(TAG + "sendMessage() " + token + " msg - " + msg);

    System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");

    DefaultHttpClient dhc = new DefaultHttpClient();
    HttpHost proxy = getProxy();
    if (proxy != null) {
    dhc.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, getProxy());
    }
    SSLSocketFactory ssf = new SSLSocketFactory(keyStore, KEYSTORE_PASS, trustStore);
    Scheme s = new Scheme("https", ssf, 443);
    ClientConnectionManager ccm = dhc.getConnectionManager();
    ccm.getSchemeRegistry().register(s);

    HttpPost hp = new HttpPost(URL);
    StringEntity se = new StringEntity(msg, "UTF-8");

    hp.setEntity(se);
    HttpResponse hr = dhc.execute(hp);

    log.info(TAG + "sendMessage() " + token + " response - " + hr.getStatusLine());
    log.info(TAG + "sendMessage() " + token + " response - " + CommonsIOUtils.toString(hr.getEntity().getContent()));

    ccm.shutdown();
    }

    private HttpHost getProxy() {

    if (PROXY_IP != null !PROXY_IP.isEmpty() PROXY_PORT != null) {
    HttpHost hh = new HttpHost(PROXY_IP, PROXY_PORT);
    return hh;
    } else
    return null;
    }
    }

  • RELEVANCY SCORE 2.61

    DB:2.61:Urgent: Java Ftp Problem jm


    Hi,

    I am trying to FTP (retreive) the files from external server, that is going through some proxy.

    I am using commons-net-1.0.0.jar file to do the FTP (FTPClient)

    2 files must be retreived (get) from that box. The local server is UNIX solaris.

    It is working fine in BC box and Dev box. The process is able to GET both the files.

    But in Production (Primary box), I am able to get only one file, and that is the smaller out of 2. Not getting the larger file.

    Program is not throwing any errors either.

    Not sure what I need to check or how to resolve this problem.

    Any help is greatly appreciated.

    DB:2.61:Urgent: Java Ftp Problem jm

    Did the Bolivian army lose their jobs to outsourcing?Several times over. They've subbed out at alternate times to ninja lemmings, frisky water buffalo, and a lone mangy jackrabbit.

    It's all about the bottom line, baby.