Android Question Problem Library jcifs-ng

stefano cavallari

Member
Licensed User
Good evening,

i have a problem with a program.
I am performing the file transfer, using the SMB.
I am using the jcifs-ng library (v. 0.32).

I initialized the smbClient variable and when I call the SMBINIT procedure I get this message:

java.lang.NoSuchMethodError: No static method getBoolean(Ljava/util/Properties;Ljava/lang/String;Z)Z in class Ljcifs/Config; or its super classes (declaration of 'jcifs.Config' appears in base.apk)
at jcifs.config.PropertyConfiguration.<init>(PropertyConfiguration.java:46)
at de.donmanfred.SMBClientwrapper$1.run(SMBClientwrapper.java:67)
at de.donmanfred.SMBClientwrapper$1.run(SMBClientwrapper.java:67)


Do you think of what's generated?




B4X:
        ReadFile.Initialize(File.OpenInput(File.DirRootExternal & "/TentataVendita/Configurazione","Parameter.ini"))
        credential.Domain = ReadFile.ReadLine
        credential.Username = ReadFile.ReadLine
        credential.Password = ReadFile.ReadLine
        credential.Share = "smb://" & credential.Domain & "/" & ReadFile.ReadLine
        ReadFile.Close
    
        tipotrasferimento="scarico"
        SMBInit(credential)
        
        
        
Sub SMBInit(cred As SMBCred)
    smbClient.Initialize("SMBClient",cred.Domain,cred.Username,cred.Password,cred.Share)
End Sub



Thanks for your help
 

DonManfred

Expert
Licensed User
Does the example app works if you use your credentials there?
Add some log to check the values read from the ini file if they are set correctly.
 
Last edited:
Upvote 0

stefano cavallari

Member
Licensed User
Does the example app works if you use your credentials there?
Add some log to check the values read from the ini file if they are set correctly.


yes I created an app that did only those functions, with the difference that I had put the credentials as constants and not read from a file.
Everything worked correctly.

When I put the same instructions in this program, which I had done in the past, I first had to delete some classes in the jcifs-ng.jar file because it didn't compile me and told me that those ".class" files already existed.

Once deleted, the program compiled correctly, it runs until I make the transfer.
The parameters read are correct.
 
Upvote 0

DonManfred

Expert
Licensed User
When I put the same instructions in this program, which I had done in the past, I first had to delete some classes in the jcifs-ng.jar file because it didn't compile me and told me that those ".class" files already existed.
This is probably the issue. You are not expected to remove any classes.

Create a new thread, post the full error you got about the dublicate dependencies.
 
Upvote 0

stefano cavallari

Member
Licensed User
This is probably the issue. You are not expected to remove any classes.

Create a new thread, post the full error you got about the dublicate dependencies.


i had read an old thread, that one had had a similar problem.
By deleting the classes he was able to solve it.

Now I publish the original error message.
 
Upvote 0

stefano cavallari

Member
Licensed User
I repurposed the library with all the classes.

This is the message that appears during the compilation:



problema.png




Looking in the folder
Anywhere Software \ Basic4android \ Libraries
I noticed that I have two similar libraries .... could this be the cause of the error?

jcifs-ng.jar
jcifs-ng-2.1.2.jar

Although I don't think so, because I had made another program, and yet it was compiled and executed correctly
 
Upvote 0

DonManfred

Expert
Licensed User
Please post errors as TEXT. Copy the text and paste it.
I noticed that I have two similar libraries .... could this be the cause of the error?

Note that
jcifs-ng.jar and jcifs-ng.xml is the Library itself. It conly contains classes de.donmanfred.*

Please post the #additionaljar lines you are using.
 
Last edited:
Upvote 0

stefano cavallari

Member
Licensed User
Please post errors as TEXT. Copy the text and paste it.

only one of them should be added at all. Try remove one of the #additionaljar lines


This is the situation :

If I delete jcfis-ng.jar, the library is not read to me, consequently the smbclient variable is not recognized and error.

If instead I delete jcfis-ng 2-1-2.jar, this message appears during the compilation

Cannot find: C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ libraries \ jcifs-ng-2.1.2.jar

I only have one .xml file for this library (jcifs-ng.xml), inside there is this tag
<dependsOn> jcifs-ng-2.1.2 </dependsOn>

Before proceeding and failing, what should I do?


- Delete the jcfis-ng.jar file
- rename the jcfis-ng 2-1-2.jar file to jcfis-ng.jar
- I modify the xml file and in the <dependsOn> tag I put "jcfis-ng.jar"
 
Upvote 0

stefano cavallari

Member
Licensed User
this file must be in the additional libs folder. The jcif-ng.jar and .xml must be in the additional libs folder too.
Make sure NOT to put all of them into the internal libary folder


So these 3 files should not be put in
C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ Libraries
where all the other libraries are.

I need to create another folder below
C: \ Program Files (x86) \ Anywhere Software \ Basic4android \

did I get it right ?
 
Upvote 0

DonManfred

Expert
Licensed User
did I get it right ?
The additional library folder should not be inside the program files folder.

Use any other Folder.
C:\Android\Addlibs
D:\AnyPath

Make sure to configure the ide to set this path for the additional libs folder..
 
Upvote 0

stefano cavallari

Member
Licensed User
The additional library folder should not be inside the program files folder.

Use any other Folder.
C:\Android\Addlibs
D:\AnyPath

Make sure to configure the ide to set this path for the additional libs folder..


I'm sorry but I'm a little inexperienced.

So I created a folder here
C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ LibAgg
I put the 3 files (the 2.jar files and the .xml one)

Opening the program obviously gives an error because it no longer sees the library.

So now to add it I go to "add file"?



aggiungifile.png
 
Upvote 0

DonManfred

Expert
Licensed User
o I created a folder here
C: \ Program Files (x86) \ Anywhere Software \ Basic4android \ LibAgg
NO! NO! NO!

You should NOT use the programfiles folder. It is a restricted folder.

 
Upvote 0

stefano cavallari

Member
Licensed User
NO! NO! NO!

You should NOT use the programfiles folder. It is a restricted folder.



AAAAAAAH
now I get it !! I'm sorry !


i created the folder here.
C:\LibAgg

Now to add the library in the program, I go to add file?
 
Upvote 0

stefano cavallari

Member
Licensed User
Sorry for the inconvenience, could someone help me?
To show the project libraries what should I do?

Forgive me, but I still don't know how to handle these things.
 
Upvote 0

DonManfred

Expert
Licensed User
copy the three files to C:\LibAgg
open the ide and check the library jcif-ng

I can´t believe why you get my example working and inplemented in your app not.

After beeing member since 5 year i would expect you know the basics on how to add a library to your project. If not then maybe you should consider reading the documentation and/or Klaus booklets. Or watching some Videos

 
Upvote 0
Top