lokivog / google-voice-java

Automatically exported from code.google.com/p/google-voice-java
0 stars 0 forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: gvjava/org/json/JSONException #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Use this code:
import com.techventus.server.voice.Voice;
import javax.swing.JOptionPane;
import java.io.IOException;

public class gvoice
{
    public static void main(String[] args)
    {
        String userName, pass, toNum, recvdMsg, sentMsg;

        userName = JOptionPane.showInputDialog("Enter your username");
        pass = JOptionPane.showInputDialog("Enter your password");

        try
        {
         Voice voice = new Voice(userName, pass);
         toNum = JOptionPane.showInputDialog("Enter the number you'd like to text");
         sentMsg  = JOptionPane.showInputDialog("Enter your message");

         voice.sendSMS(toNum, sentMsg);
        }

        catch (IOException e) 
        {
    // Print out the exception that occurred
    System.out.println(e.getMessage());
        }

    }
}

Then it gives me this error:

Exception in thread "main" java.lang.NoClassDefFoundError: 
gvjava/org/json/JSONException
    at gvoice.main(gvoice.java:16)
Caused by: java.lang.ClassNotFoundException: gvjava.org.json.JSONException
    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:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

Original issue reported on code.google.com by N.Tyler1...@gmail.com on 25 Dec 2011 at 10:02

GoogleCodeExporter commented 8 years ago
using 1.10

Original comment by N.Tyler1...@gmail.com on 25 Dec 2011 at 10:05

GoogleCodeExporter commented 8 years ago
Tyler, have you tried importing the json.jar file we provide?  That is the 
missing dependency I believe.

Original comment by malone.j...@gmail.com on 26 Dec 2011 at 1:15

GoogleCodeExporter commented 8 years ago
No I have not.

Thanks,
Nick

Original comment by N.Tyler1...@gmail.com on 27 Dec 2011 at 1:43

GoogleCodeExporter commented 8 years ago
Where can I get json.jar file ? I am having the same issue.

Original comment by RajeshSh...@gmail.com on 9 Jan 2012 at 12:25

GoogleCodeExporter commented 8 years ago
Ok I found the JSON Jar file.

I get the following messages: 

https://www.google.com/accounts/ClientLogin - OK
Logged in to Google - Auth token received
https://www.google.com/voice/ - OK
Successfully Received rnr_se.

I believe everything is fine here. But still not getting SMS on my phone.
Is it because I am accessing it from India ?
Please help here.

thanks,
Rajesh

Original comment by RajeshSh...@gmail.com on 9 Jan 2012 at 1:20

GoogleCodeExporter commented 8 years ago
where u got JSON Jar file?

Original comment by devendra...@gmail.com on 3 May 2012 at 1:27

GoogleCodeExporter commented 8 years ago
Closing issue

Original comment by teisentr...@gmail.com on 11 Dec 2012 at 11:16

GoogleCodeExporter commented 8 years ago
where's json.jar?

Original comment by an...@anjul.com on 27 Mar 2013 at 5:57

GoogleCodeExporter commented 8 years ago
i found it by anonymously checking out the source read-only and looking in the 
libs directory

Original comment by an...@anjul.com on 27 Mar 2013 at 6:18

GoogleCodeExporter commented 8 years ago
i have already added json2.1.jar.But still i am getting the same error.pls help 
me

Original comment by chandu8...@gmail.com on 1 Jul 2013 at 3:50