jcifs null pointer exception

Posted on 2014-08-20
Last Modified: 2014-08-24

I am under windows environment and i am using intellij. I had to extract jcifs classes and i did and the following code doesn't give any compiler error but once I run my code, it fails as follows:

NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("mydomain","test", "test");
                    SmbFile smbFile = new SmbFile(path,auth);
                    SmbFileOutputStream smbfos = new SmbFileOutputStream(smbFile);
                    smbfos.write("testing....and writing to a file".getBytes());
                    System.out.println("completed ...nice !");

Open in new window

2014-08-20 19:59:39,219 ERROR - java.lang.NoClassDefFoundError: jcifs/smb/NtlmPasswordAuthentication

Open in new window

My settings is as follows:
Question by:jazzIIIlove
    LVL 86

    Expert Comment

    jcifs null pointer exception

    But you don't have that ...

    2014-08-20 19:59:39,219 ERROR - java.lang.NoClassDefFoundError: jcifs/smb/NtlmPasswordAuthentication

    Open in new window

    I don't see any sign from your code that the jcifs classes are actually in the classpath
    LVL 12

    Author Comment

    How can i verify this? (Via Windows as i code in Windows)
    LVL 86

    Accepted Solution

    You just did verify it ;) (That jcifs in not in the classpath)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now