Weblogic with twitter API


#1

I am using weblogic 10.3.4 using twitter4j Api running behind the proxy. I am not sure why I am getting this error. I do have the proxy name,port number, userid and password set in the twiiter4j api. The same code works fine for me in tomcat behind proxy. When I was trying to migrate from tomcat to weblogic i am getting following error. Any help is really appreciated.

Please help me

Thanks for the help
Vinoj

<Net> <BEA-000903> <Failed to communicate with proxy: tmsproxy.tms.toyota.com/80. Will try c
onnection stream.twitter.com/443 now.
weblogic.net.http.HttpUnauthorizedException: Proxy or Server Authentication Required
        at weblogic.net.http.HttpURLConnection.getAuthInfo(HttpURLConnection.java:297)
        at weblogic.net.http.HttpsClient.makeConnectionUsingProxy(HttpsClient.java:440)
        at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:351)
        at weblogic.net.http.HttpsClient.New(HttpsClient.java:527)
        at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:239)
        Truncated. see log file for complete stacktrace
> 
Dumping beanImpl -> ejbName map
weblogic.management.j2ee.mejb.MejbBean: Mejb
connect timed out
Relevant discussions can be found on the Internet at:
        http://www.google.co.jp/search?q=944a924a or
        http://www.google.co.jp/search?q=24fd66dc
TwitterException{exceptionCode=[944a924a-24fd66dc 944a924a-24fd66b2], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLim
itStatus=null, version=3.0.4-SNAPSHOT(build: f34757f6d8512eca8028601d9de303e0173d8d42)}
        at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
        at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
        at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98)
        at twitter4j.TwitterStreamImpl.getFilterStream(TwitterStreamImpl.java:304)
        at twitter4j.TwitterStreamImpl$7.getStream(TwitterStreamImpl.java:292)
        at twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java:462)
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at weblogic.net.http.HttpsClient.openWrappedSSLSocket(HttpsClient.java:565)
        at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:287)
        at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:364)
        at weblogic.net.http.HttpsClient.New(HttpsClient.java:527)
        at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:239)
        at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:255)
        at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java

#2

Hi Vinoj:

Without knowing much about your environment or setup, it looks like the problem is with WebLogic.

Are you able to access the Streaming API using the command line (e.g., using a curl command)? You can easily generate OAuth-signed cURL commands by going to https://dev.twitter.com/apps and selecting your application, then going to the “OAuth tool” tab.

Another thing you might try is creating a very basic test app within WebLogic, without any of the customization or complexity in the app that was running in Tomcat. That can help you to discern whether what’s causing the error is an incompatibility between your app and WebLogic.

I hope that helps!