Java facebook application to update status
Trying to create a basic application in java that will update my facebook status. So i followed this tutorial: http://blog.theunical.com/facebook-integration/facebook-java-api-example-to-publish-on-wall/

heres my code:

    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.HttpState;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.methods.GetMethod;
    import org.apache.commons.httpclient.methods.PostMethod;
    import org.apache.commons.httpclient.params.HttpClientParams;
    
    import com.google.code.facebookapi.Attachment;
    import com.google.code.facebookapi.AttachmentMediaImage;
    import com.google.code.facebookapi.FacebookException;
    import com.google.code.facebookapi.FacebookJsonRestClient;
    import com.google.code.facebookapi.FeedFacebookPhoto;
    import com.google.code.facebookapi.Permission;
    import com.google.code.facebookapi.TemplatizedAction;
    
    public class SendtoFacebook {
    
    	public static void main (String a[]) throws FacebookException{
    
    	SendtoFacebook sfb=new SendtoFacebook();
    	sfb.send("From My App: publish steven on facebook");
    	}
    	public void send(String message)throws FacebookException{
    
    		String FB_APP_API_KEY = new String("I PUT MY KEY");
    		String FB_APP_SECRET = new String("I PUT MY SECRET");
    		String FB_SESSION_KEY = new String("PROBLEM HERE I THINK");
    		FacebookJsonRestClient facebook = new FacebookJsonRestClient( FB_APP_API_KEY, FB_APP_SECRET, FB_SESSION_KEY );
    
    		//FacebookJsonRestClient facebookClient2 = (FacebookJsonRestClient)facebook.getFacebookRestClient();
    		FacebookJsonRestClient facebookClient = (FacebookJsonRestClient)facebook;
    facebookClient.stream_publish(message, null, null, null, null);
    
    			System.out.println("successfully updated");
    
    	}
    }

Now when i run it i get this error:

    run:
    Exception in thread "main" com.google.code.facebookapi.FacebookException: Session key invalid or no longer valid
            at com.google.code.facebookapi.JsonHelper.parseCallResult(JsonHelper.java:59)
            at com.google.code.facebookapi.ExtensibleClient.extractString(ExtensibleClient.java:2296)
            at com.google.code.facebookapi.ExtensibleClient.stream_publish(ExtensibleClient.java:2150)
            at com.google.code.facebookapi.SpecificReturnTypeAdapter.stream_publish(SpecificReturnTypeAdapter.java:503)
            at SendtoFacebook.send(SendtoFacebook.java:32)
            at SendtoFacebook.main(SendtoFacebook.java:21)
    Java Result: 1

Any ideas what is wrong? its the session key. I get my session key alright, enter it there, but then i still get this error?
Java facebook application to update status
===

Trying to create a basic application in java that will update my facebook status. So i followed this tutorial: http://blog.theunical.com/facebook-integration/facebook-java-api-example-to-publish-on-wall/

heres my code:

    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.HttpState;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.methods.GetMethod;
    import org.apache.commons.httpclient.methods.PostMethod;
    import org.apache.commons.httpclient.params.HttpClientParams;
    
    import com.google.code.facebookapi.Attachment;
    import com.google.code.facebookapi.AttachmentMediaImage;
    import com.google.code.facebookapi.FacebookException;
    import com.google.code.facebookapi.FacebookJsonRestClient;
    import com.google.code.facebookapi.FeedFacebookPhoto;
    import com.google.code.facebookapi.Permission;
    import com.google.code.facebookapi.TemplatizedAction;
    
    public class SendtoFacebook {
    
    	public static void main (String a[]) throws FacebookException{
    
    	SendtoFacebook sfb=new SendtoFacebook();
    	sfb.send("From My App: publish steven on facebook");
    	}
    	public void send(String message)throws FacebookException{
    
    		String FB_APP_API_KEY = new String("I PUT MY KEY");
    		String FB_APP_SECRET = new String("I PUT MY SECRET");
    		String FB_SESSION_KEY = new String("PROBLEM HERE I THINK");
    		FacebookJsonRestClient facebook = new FacebookJsonRestClient( FB_APP_API_KEY, FB_APP_SECRET, FB_SESSION_KEY );
    
    		//FacebookJsonRestClient facebookClient2 = (FacebookJsonRestClient)facebook.getFacebookRestClient();
    		FacebookJsonRestClient facebookClient = (FacebookJsonRestClient)facebook;
    facebookClient.stream_publish(message, null, null, null, null);
    
    			System.out.println("successfully updated");
    
    	}
    }

Now when i run it i get this error:

    run:
    Exception in thread "main" com.google.code.facebookapi.FacebookException: Session key invalid or no longer valid
            at com.google.code.facebookapi.JsonHelper.parseCallResult(JsonHelper.java:59)
            at com.google.code.facebookapi.ExtensibleClient.extractString(ExtensibleClient.java:2296)
            at com.google.code.facebookapi.ExtensibleClient.stream_publish(ExtensibleClient.java:2150)
            at com.google.code.facebookapi.SpecificReturnTypeAdapter.stream_publish(SpecificReturnTypeAdapter.java:503)
            at SendtoFacebook.send(SendtoFacebook.java:32)
            at SendtoFacebook.main(SendtoFacebook.java:21)
    Java Result: 1

Any ideas what is wrong? its the session key. I get my session key alright, enter it there, but then i still get this error?