java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Hi all
I am trying to set up a tFTPConnection, with FTPS Support, using the below setup

However I am left with the following error when I try and run it:
java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
at java.lang.Class.getMethod0(Class.java:2813)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: com.enterprisedt.net.ftp.FTPException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
Exception in thread "main"


Any ideas what is wrong?
I am running this:
"Talend Open Studio for Data Integration"
Version: 5.6.1
Build id: V5.6.1_20141207_1530
On a windows 8 64bit machine.
30 REPLIES
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Do you have a file called edtftpj.jar (or similar) in your \Studio\configuration\lib\java folder?
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

rhall yes I have that in 
C:\Talend\TOS_DI-20141207_1530-V5.6.1\configuration\lib\java
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Are you running it in the Studio when you get this error or as a standalone job?
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

rhall
I am running it in the studio, using the "Run" button.

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

rhall
I have just restarted Talend and now I am getting the following error on my tFTPRename component.

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

For some reason it is not displaying my screenshots.....
This is the error I receive:
"com.enterprisedt cannot be resolved to a type"
Community Manager

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

To publish a screenshot in this Forum, you can use either of these boxes below: one is to drop a file from your file system, the other one is to paste the image from your clipboard. Let me know if this is what you've done and still had an issue getting your screenshots displayed or if you used another way, such as the upload button from the toolbar?
Can you try to paste your FTP component configuration please?
Can you check whether the Module view suggests you to download a jar?
Can you access your FTP outside Talend (just in case the exception would be totally misleading).
Elisa

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Elisa
I am trying to attach a screenshot, it shows that it is displaying in the text box, but then when I hit "Submit" the image does not appear. 
(Am attempting to upload with the "Upload" button now.



This is the error I now receive:
 connecting to socket on port 3629
connected
java.io.FileNotFoundException:
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at hourly_ftp_file.hourly_file_0_1.Hourly_File$1MyTrust_tFTPConnection_1.getTrustManagers(Hourly_File.java:490)
at hourly_ftp_file.hourly_file_0_1.Hourly_File$1MyTrust_tFTPConnection_1.access$0(Hourly_File.java:478)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.tFTPConnection_1Process(Hourly_File.java:509)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.runJobInTOS(Hourly_File.java:5387)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.main(Hourly_File.java:5244)
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
com.enterprisedt cannot be resolved to a type
com.enterprisedt cannot be resolved to a type
com.enterprisedt cannot be resolved to a type
disconnected
at hourly_ftp_file.hourly_file_0_1.Hourly_File.tFTPRename_1Process(Hourly_File.java:655)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.tFTPConnection_1Process(Hourly_File.java:583)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.runJobInTOS(Hourly_File.java:5387)
at hourly_ftp_file.hourly_file_0_1.Hourly_File.main(Hourly_File.java:5244)
Job Hourly_File ended at 15:22 23/07/2015.

P.S. when I hit "preview" my images do not show up either
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

When you look at your Job design, you will notice in the bottom left there are at least 2 tabs (depending on the environment). These tabs say "Designer" and "Code". Can you click on the "Code" one and let us know if there are any red markers that appear on the right hand side of the code window once the code has generated. If there are, can you find the code that they relate to. This sounds like a classpath issue that may actually be a Talend bug.
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

I get an error here now:
} catch (com.enterprisedt.net.ftp.FTPException e) {
globalMap.put("tFTPRename_1_CURRENT_STATUS",
"File rename fail.");
throw e;
}


Telling me that com.enterprisedt cannot be resolved to a type.
There is not a file to be renamed currently (I am setting up the job to work), but I have email alerts set up if there is no file etc, but this is killing the job.
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

I think your install might be corrupted possibly. Do you have a folder called \plugins\org.talend.libraries.ftp_5.6.1.20141207_1530\lib
with the following files inside...
commons-net-3.3.jar
edtftpj.jar
ftp4j-1.7.2.jar
jsch-0.1.51.jar
If the answer is no, that is your problem. You should be able to get these Jars from teh first folder I asked you to check earlier. If the folder does not exist, simply create it and add the files. You will then need to restart your Talend Studio.
Rilhia Solutions
One Star

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

For some reason it is not displaying my screenshots.....
This is the error I receive:
"com.enterprisedt cannot be resolved to a type"

You need to post 10 messages in the forum Smiley Wink

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

RHall
I have them in this folder:
.../TOS_DI-r118616-V5.5.1/TOS_DI-r118616-V5.5.1/plugins/org.talend.libraries.ftp_5.5.1.r118616/lib
Files:
commons-net-3.3.jar
edtftpj.jar
ftp4j-1.5.1.ar
jsch.jar


Not sure at all whats going on
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Hang on, you are using 5.6.1, correct? I ask as you have just told me that the folder in which you have those files is a 5.5.1 folder. Have you upgraded from 5.5.1? Do you have both version running side by side? If so, that is fine, but you will need this folder ....
org.talend.libraries.ftp_5.6.1.20141207_1530
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

RHall
I do not have that in this folder:
C:\Talend\TOS_DI-20141207_1530-V5.6.1\workspace\.metadata\.plugins\

Do I literally just take the four files from my previous folder, and put them in a folder named:
org.talend.libraries.ftp_5.6.1.20141207_1530

Many thanks for all your help
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

It's not a folder inside your workspace, it is a folder inside your main installation. Mine is here...
\Talend-Studio-20141207_1530-V5.6.1\plugins\org.talend.libraries.ftp_5.6.1.20141207_1530\lib
If you don't have that folder, I would take a back up of your jobs and reinstall.
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

RHall
Thank you for your help.
I will export all my jobs, uninstall/reinstall Talend and start over again Smiley Happy
Will let you know, cheers!
Community Manager

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Yes, please post here again for your FTP jar issue. On my end, I have passed on the image upload issue to the web dev team to investigate it. Cheers
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Esabot,
I believe the issue with posting images is due to not having posted more than 10 posts. I recently set up a new user on here (this one) as my old one was linked to my old Talend work account. When I set that up I had to post 10 times before I could post images.
Rilhia Solutions
Community Manager

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

THanks for your input. I'll check whether this rule still makes sense.

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Hey all again
Right, so I did a clean install of Talend 6.0, created just a TFTPConnection with FTPS support, and have received the following error message:
Starting job Bentley_FTP at 13:07 28/07/2015.
connecting to socket on port 3918
connected
java.io.FileNotFoundException:
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at local_project.bentley_ftp_0_1.Bentley_FTP$1MyTrust_tFTPConnection_1.getTrustManagers(Bentley_FTP.java:311)
at local_project.bentley_ftp_0_1.Bentley_FTP$1MyTrust_tFTPConnection_1.access$0(Bentley_FTP.java:299)
at local_project.bentley_ftp_0_1.Bentley_FTP.tFTPConnection_1Process(Bentley_FTP.java:330)
at local_project.bentley_ftp_0_1.Bentley_FTP.runJobInTOS(Bentley_FTP.java:611)
at local_project.bentley_ftp_0_1.Bentley_FTP.main(Bentley_FTP.java:468)
disconnected
Job Bentley_FTP ended at 13:07 28/07/2015.

This is a completely clean install and I am getting the above error.
Any ideas?!
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

This is down to your job configuration. You are pointing to a file which doesn't exist. Go to line 311 in your Bentley_FTP job's source code (see image below to see how to see the source) and you should be able to see what component has this issue.
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Rich Talend 6.0 doesn't have the lines for code (quite annoyingly!) but it appears to be:
ks.load(new java.io.FileInputStream("")
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

That sucks, but we can change that. Go to Windows--> Preferences --> General --> Editors --> Text Editors (as below)

Then tick "Show Line Numbers".
You will then see the line numbers.
A FileInputStream is used for reading a file. It looks like your job is looking to read a file called "". You will need to set this. Hopefully the line numbers will point you to the actual component.
Rilhia Solutions

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Rich
I think I have worked out the issue of this one....
I am trying to connect to FTPS with no keystore file or password.
I don't have these and don't need them. Is there anyway to bypass this?
Many thanks
Fifteen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

I can't say I have tried this to be honest. It would appear that Talend requires you have these for FTPS. Maybe you could create an empty keystore and password and try use those to get round this. That is what I would try.
Rilhia Solutions
Six Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Usign tFTPConnection i have this error "com.enterprisedt cannot be resolved to a type", from this source code:
com.enterprisedt.net.ftp.FTPClient ftp_tFTPFileList_1 = null;
ftp_tFTPFileList_1 = (com.enterprisedt.net.ftp.FTPClient) globalMap.get("conn_tFTPConnection_1");

I fixed using tLibraryLoad to manually load "edtftpj-2.4.0.jar" (but if I can't find jar file in TOS plugin folder).
But now when I use tFTPFileList (that refer to tFTPConnection), this hangs for "java.lang.ClassCastException: it.sauronsoftware.ftp4j.FTPClient cannot be cast to com.enterprisedt.net.ftp.FTPClient" at this point:
ftp_tFTPFileList_1 = (com.enterprisedt.net.ftp.FTPClient) globalMap.get("conn_tFTPConnection_1");

I'm using a sftp connection, with implicit option.
bye
Seventeen Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

Are you sure you have downloaded and installed all so called modules which the studio at the beginning expects?
Six Stars

Re: java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPException

yes, quite sure. I downloaded modules required after the 6.1.1 fresh installation.
Indeed tLibraryLoad already shows edtftpj-2.4.0, I hadn't added to TOS when I used.
But if I open modules view, I don't find edtftpj dependecies by ftp component.