title: using xpages with twitter4j to get access token on server
body: <p>I am using twitter4j to show some tweets on my webpage. The code works fine when I am running it locally. If I put it on the server I got an error.</p>
  
  <p>The code looks like</p>
  
  <pre><code>Twitter twitter = TwitterFactory.getSingleton();
  twitter.setOAuthConsumer(consumerKey, consumerSecret);
  </code></pre>
  
  <p><strong>error:</strong></p>
  
  <pre><code>java.lang.AssertionError: java.lang.reflect.InvocationTargetException
  twitter4j.TwitterFactory.(TwitterFactory.java:76)
  java.lang.J9VMInternals.initializeImpl(Native Method)
  java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
  de.workm.java.xc.twitter11.TwitterOAuthCredentials.getRequestURL(TwitterOAuthCredentials.java:167)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  java.lang.reflect.Method.invoke(Method.java:611)
  com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:321)
  com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
  com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:197)
  com.ibm.jscript.ASTTree.ASTVariableDecl.interpret(ASTVariableDecl.java:82)
  com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
  com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
  com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
  com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
  com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
  java.security.AccessController.doPrivileged(AccessController.java:310)
  com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
  com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
  com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
  com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:222)
  com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
  com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
  javax.faces.component.UICommand.broadcast(UICommand.java:324)
  </code></pre>
  
  <p>Thanks
  Armin</p>