Java Question B4A program does not start in my connection liibrary

Amalkotey

Active Member
Licensed User
Longtime User
hello,

I write at the moment, a Inifile library for android. So I can also download from my website inifile, I 've been using the "import com.AB.FTP.ABFTP;" involved the ABFTP library.

Under Eclipse - with a Main class - everything works fine. If I integrate the library into B4A, can be B4A the program compile properly. But on the Android device is the following Medlung.

In preparation of Javadoc is the warning "warning: Can not find annotation method 'value() ' in type' anywheresoftware.b4a.BA$Author ': class file for anywheresoftware.b4a.BA$Author not found".

You know why? Thank you for your help in advance.

best regards
Amalkotey
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
@Erel:

I am working on a customer order. The customer has a very old program under Windows, which means data from other systems can only import inifile. For this reason I must write to the eportoieren data in an ini file. Then this is copied via FTP to the server of the customer and the customer gets the software inifile and reads this.

The log has issued an error message " java.lang.NoClassDefFoundError: org.apache.commons.net.ftp.FTPClient ". The imported and referenced commons-net-3.01.jar missing in my library. how get them when I get into it with jar export?

regards
Amalkotey
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
if I have a reference form of ABFTP I get called in post # 1 error message when generating Javadoc. Under the Lib Eclipse runs perfectly with a Main class.

Alternatively ic tried to involve the comms net 3.0.1.jat directly. also does my lib with a main class in eclipse. There is criticism that exists in the B4AShared.jar B4A.Author no. I 've installed a wrong B4AShared -jar? How do I get a reference of the commons net.3.0.1.jar involved with with my lib? When Jar export I can not select the referenced libraries. My B4A has released version 1.50.
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
I 've dated B4AShared.jar the forum, which is downloaded from 08.12.2010. The error message like bein centering javadoc does not come anymore. when compiling under B4A I get following error message:

B4X:
src\esdaSO\Android\IniFile_Demo\main.java:205: cannot access com.AB.FTP.ABFTP
class file for com.AB.FTP.ABFTP not found
 

Amalkotey

Active Member
Licensed User
Longtime User
Hello Erel,

thank you it worked. Since I was still noticed a mistake in my library, I 've removed it and now get the following compile error message in the B4A:

B4X:
Compiling code.                         0.02
Generating R file.                      0.00
Compiling generated Java code.          Error
B4A line: 85
Ini.LoadIniFilePerFTP(\
javac 1.6.0_21
src\esdaSO\Android\IniFile_Demo\main.java:429:
LoadIniFilePerFTP([B][I][U]java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String[/U][/I][/B])
in esdaSO.Android.IniFile [B][U]cannot be applied to[/U][/B] (java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
mostCurrent._ini.LoadIniFilePerFTP("esdaso.de",(int)(21),"esdaSO_3","esdaSO_3","/",_localpath,"IniFile-Lib.ini");
                ^
1 error

In the line 429 only six parameters are passed to the method. However, there are seven parameters in the head of the methods declared.
Hence the error. Is this a bug in B4A? If I take the variable "_localpath (in B4A: localPath)" out of the call, the program runs properly.

B4A:
B4X:
Dim localPath As String
localPath = File.DirRootExternal & "/"
Ini.LoadIniFilePerFTP("esdaso.de", 21, "esdaSO_3", "esdaSO_3", "/", localPath, "IniFile-Lib.ini")

Java:
B4X:
public void LoadIniFilePerFTP(String ftpServer, int port, String user, String pwd, String ftpPath, String localPath, String fileName)
{
  .....
}

Many thanks in advance.

regards
Amalkotey
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
Hello,

now I have solved the problems mentioned above. B4A compiled my code and the program runs on the android-device. The fur on the Connect method but I get the error "java.net.UnknownHostException: ftp://esdaso.de". Is calling the method

B4X:
FTPClient.connect(InetAddress.getByName("ftp://" + host), port) or
FTPClient.connect(InetAddress.getByName("ftp." + host), port)

performed with port 21. The error message indicates that an IP could not be determined. Under Eclipse - calling my library with a main-method in a annother class - the connect is working properly.

I have the package of commons-net-3.0.1-source.jar with in the src folder included, so the exported file in the jar and the packages are available. The error also occurs when I'm in my Libary ABFTP means "extends ABFTP" and "import com.AB.FTP.ABFTP;" and integrate with an instance of "ABFTP conFTP ABFTP = new();" fancy.

B4X:
public void LoadIniFilePerFTP(String ftpServer, int port, String user, String pwd, String ftpPath, String localPath, String fileName) {
   conFTP.ABFTPConnect("ftp." + ftpServer, port, user, pwd);
   if (conFTP.getABFTPConnected()) {
      conFTP.ABFTPDownload(ftpPath, fileName, localPath, fileName);
      conFTP.ABFTPDisconnect();
      if (conFTP.getABFTPLastError().length() == 0) {
         try {
            load(localPath + fileName);
            this.lastError = "File downloaded!";
         } catch (FileNotFoundException e) {
            e.printStackTrace();
            this.lastError = "FileNotFoundException" + crLF + e.toString();
         }
      } else {
         this.lastError = "File not downloaded!" + crLF + conFTP.getABFTPLastError(); 
      }
   } else {
      this.lastError = "File not downloaded!" + crLF + conFTP.getABFTPLastError();
   }
}

What am I doing wrong? Where is my problem? Thanks for your help in advance.

regards
Amalkotey
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
I still need help!

Hello,

I still need help! Has no one an idea?

regards
Amalkotey
 

Amalkotey

Active Member
Licensed User
Longtime User
@agraham:

Because the Library under both Android and Windows use place. Times now is a customer requirement. That was the idea of Erel. I have included the required methods directly from the common-3.0.1-net, and get the same error message here.
 
Last edited:
Top