Search the FirstSpirit Knowledge Base
Hi,
I'm trying to get a remote connection with our FS server.
After run my class I get a connection but the the function .connect() block my script.
Please wrap the "connect" in a "try .. catch" block.
Use the IntelliJ IDEA function "Take a thread dump" (camera icon on the left) to see where the thread is blocked. Maybe the thread is hanging in the network stack until a timeout occurs. A network timeout be something as long as 90 seconds...
2012-12-18 16:57:05
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.12-b01-434 mixed mode):
"Poller SunPKCS11-Darwin" daemon prio=1 tid=10c24f000 nid=0x10dd9e000 waiting on condition [10dd9d000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at sun.security.pkcs11.SunPKCS11$TokenPoller.run(SunPKCS11.java:692)
at java.lang.Thread.run(Thread.java:680)
"HttpServerCaller.cleaner" daemon prio=5 tid=10c0a8000 nid=0x10dc9b000 waiting on condition [10dc9a000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <7f43b42c0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:680)
"cache evictor" daemon prio=5 tid=10186d800 nid=0x10db98000 in Object.wait() [10db97000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f43321c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <7f43321c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at de.espirit.common.util.CacheImpl$1.run(CacheImpl.java:27)
at java.lang.Thread.run(Thread.java:680)
"Monitor Ctrl-Break" daemon prio=5 tid=10c03d800 nid=0x10d901000 runnable [10d900000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
- locked <7f37d0dc8> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
- locked <7f37d0dc8> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at com.intellij.rt.execution.application.AppMain$1.run(AppMain.java:85)
at java.lang.Thread.run(Thread.java:680)
"Low Memory Detector" daemon prio=5 tid=10c001800 nid=0x10bf0a000 runnable [00000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" daemon prio=9 tid=10c001000 nid=0x10be07000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=9 tid=10c000000 nid=0x10bd04000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=9 tid=10b016000 nid=0x10bc01000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=10b015000 nid=0x10b901000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=8 tid=1030d1800 nid=0x10a0ea000 in Object.wait() [10a0e9000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f481d038> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <7f481d038> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=1030d1000 nid=0x109fe7000 in Object.wait() [109fe6000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f481d050> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <7f481d050> (a java.lang.ref.Reference$Lock)
"main" prio=5 tid=103000800 nid=0x100501000 runnable [1004ff000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
- locked <7f44398d0> (a java.io.BufferedInputStream)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at de.espirit.firstspirit.client.io.HttpClient.executeMethod(HttpClient.java:167)
at de.espirit.firstspirit.client.io.HttpSSLServerChannel.callServer(HttpSSLServerChannel.java:284)
at de.espirit.firstspirit.client.io.HttpSSLServerChannel.doHandshake(HttpSSLServerChannel.java:219)
at de.espirit.firstspirit.client.io.HttpSSLServerChannel.wrap(HttpSSLServerChannel.java:150)
at de.espirit.firstspirit.client.io.HttpSSLServerChannel.writeAndRead(HttpSSLServerChannel.java:80)
at de.espirit.firstspirit.client.io.HttpServerCaller.call(HttpServerCaller.java:321)
at de.espirit.firstspirit.client.io.HttpServerCaller.authorize(HttpServerCaller.java:259)
at de.espirit.firstspirit.client.io.HttpServerCaller.authorize(HttpServerCaller.java:245)
at de.espirit.firstspirit.client.io.HttpServerCaller.createClient(HttpServerCaller.java:216)
at de.espirit.firstspirit.client.io.HttpServerCaller.leaseClient(HttpServerCaller.java:170)
at de.espirit.firstspirit.client.io.HttpServerCaller.leaseClient(HttpServerCaller.java:40)
at de.espirit.firstspirit.client.io.ServerCaller.call(ServerCaller.java:232)
at de.espirit.firstspirit.client.io.ServerCaller._call(ServerCaller.java:518)
at de.espirit.firstspirit.client.io.ServerCaller.ping(ServerCaller.java:449)
at de.espirit.firstspirit.client.io.HttpServerCaller.doConnect(HttpServerCaller.java:103)
at de.espirit.firstspirit.client.io.ServerCaller.connect(ServerCaller.java:139)
at de.espirit.firstspirit.client.io.ConnectionImpl.connect(ConnectionImpl.java:177)
at de.itelligence.firstspirit.app.baymevbm.automation.AutomationSiteStore.getProject(AutomationSiteStore.java:39)
at de.itelligence.firstspirit.app.baymevbm.automation.AutomationSiteStore.main(AutomationSiteStore.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
"VM Thread" prio=9 tid=1030cc000 nid=0x109ee4000 runnable
"Gang worker#0 (Parallel GC Threads)" prio=9 tid=103002000 nid=0x102401000 runnable
"Gang worker#1 (Parallel GC Threads)" prio=9 tid=103002800 nid=0x102504000 runnable
"Gang worker#2 (Parallel GC Threads)" prio=9 tid=103003000 nid=0x102607000 runnable
"Gang worker#3 (Parallel GC Threads)" prio=9 tid=103004000 nid=0x10270a000 runnable
"Concurrent Mark-Sweep GC Thread" prio=9 tid=10307f000 nid=0x109bf0000 runnable
"VM Periodic Task Thread" prio=10 tid=10c013800 nid=0x10c901000 waiting on condition
"Exception Catcher Thread" prio=10 tid=103001800 nid=0x1017fb000 runnable
JNI global references: 1238
Heap
par new generation total 19136K, used 10288K [7f3000000, 7f44c0000, 7f44c0000)
eden space 17024K, 48% used [7f3000000, 7f37fc2a8, 7f40a0000)
from space 2112K, 100% used [7f42b0000, 7f44c0000, 7f44c0000)
to space 2112K, 0% used [7f40a0000, 7f40a0000, 7f42b0000)
concurrent mark-sweep generation total 63872K, used 43009K [7f44c0000, 7f8320000, 7fae00000)
concurrent-mark-sweep perm gen total 21248K, used 9625K [7fae00000, 7fc2c0000, 800000000)
I wrap the connect function, and above the shot from intelliJ
Hi Peter,
if I set my Logger to debug level i get this...
before
main DEBUG io.AbstractServerConnection - disconnect - de.espirit.firstspirit.client.io.ConnectionImpl@6ab30913[session=null]
main DEBUG access.ConnectionManager - connect http://fs-backend.i-telligence.de:8000/
main DEBUG httpclient.HttpClient - Java version: 1.6.0_37
main DEBUG httpclient.HttpClient - Java vendor: Apple Inc.
main DEBUG httpclient.HttpClient - Java class path: /Users/zava/Sites/baymevbm/baymevbmApp/bin:/Users/zava/Sites/baymevbm/fs/fs-access.jar:/Users/zava/Sites/baymevbm/fs/fs-client.jar:/Users/zava/Sites/baymevbm/fs/fs-webrt.jar:/Users/zava/Sites/baymevbm/log4j-1.2rc1-2002-04-16.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/annotations-api.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/catalina-ant.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/catalina-ha.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/catalina-tribes.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/catalina.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/el-api.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/jasper-el.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/jasper-jdt.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/jasper.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/jsp-api.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/mysql-connector-java-5.1.21-bin.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/servlet-api.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/tomcat-coyote.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/tomcat-dbcp.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/tomcat-i18n-es.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/tomcat-i18n-fr.jar:/Library/Tomcat/apache-tomcat-6.0.20/lib/tomcat-i18n-ja.jar
main DEBUG httpclient.HttpClient - Operating system name: Mac OS X
main DEBUG httpclient.HttpClient - Operating system architecture: x86_64
main DEBUG httpclient.HttpClient - Operating system version: 10.6.8
main DEBUG httpclient.HttpClient - SunPKCS11-Darwin 1.6: SunPKCS11 accessing Mac OS X SmartCardServices
main DEBUG httpclient.HttpClient - SUN 1.6: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)
main DEBUG httpclient.HttpClient - Apple 1.0: Apple Provider (implements DES, Triple DES, AES, Blowfish, PBE, Diffie-Hellman, HMAC/MD5, HMAC/SHA1)
main DEBUG httpclient.HttpClient - SunRsaSign 1.5: Sun RSA signature provider
main DEBUG httpclient.HttpClient - SunJSSE 1.6: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
main DEBUG httpclient.HttpClient - SunJCE 1.6: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
main DEBUG httpclient.HttpClient - SunJGSS 1.0: Sun (Kerberos v5, SPNEGO)
main DEBUG httpclient.HttpClient - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
main DEBUG httpclient.HttpClient - XMLDSig 1.0: XMLDSig (DOM XMLSignatureFactory; DOM KeyInfoFactory)
main DEBUG httpclient.HttpClient - SunPCSC 1.6: Sun PC/SC provider
main DEBUG params.DefaultHttpParams - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1
main DEBUG params.DefaultHttpParams - Set parameter http.protocol.version = HTTP/1.1
main DEBUG params.DefaultHttpParams - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
main DEBUG params.DefaultHttpParams - Set parameter http.protocol.cookie-policy = default
main DEBUG params.DefaultHttpParams - Set parameter http.protocol.element-charset = US-ASCII
main DEBUG params.DefaultHttpParams - Set parameter http.protocol.content-charset = ISO-8859-1
main DEBUG params.DefaultHttpParams - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@26b496d
main DEBUG params.DefaultHttpParams - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
main DEBUG params.DefaultHttpParams - Set parameter http.method.retry-handler = de.espirit.firstspirit.client.io.HttpClient$RetryHandler@26aae86e
main DEBUG params.DefaultHttpParams - Set parameter http.connection-manager.timeout = 15000
main DEBUG params.DefaultHttpParams - Set parameter http.socket.timeout = 60000
main DEBUG params.DefaultHttpParams - Set parameter http.protocol.cookie-policy = ignoreCookies
main DEBUG params.DefaultHttpParams - Set parameter http.connection.stalecheck = false
main DEBUG params.DefaultHttpParams - Set parameter http.method.response.buffer.warnlimit = 5242880
main DEBUG httpclient.HttpConnection - Open connection to fs-backend.i-telligence.de:8000
main DEBUG wire.header - >> "POST /servlet/ClientIO/0/o0/1 HTTP/1.1[\r][\n]"
main DEBUG httpclient.HttpMethodBase - Adding Host request header
main DEBUG wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
main DEBUG wire.header - >> "Host: fs-backend.i-telligence.de:8000[\r][\n]"
main DEBUG wire.header - >> "Content-Length: 5[\r][\n]"
main DEBUG wire.header - >> "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - >> "[\r][\n]"
main DEBUG wire.content - >> "FS[0x3][0x1][0x2]"
main DEBUG methods.EntityEnclosingMethod - Request body sent
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - << "Set-Cookie: JSESSIONID=1264jas24clyq138zcokjlduhm;Path=/[\r][\n]"
main DEBUG wire.header - << "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]"
main DEBUG wire.header - << "Content-Length: 13[\r][\n]"
main DEBUG wire.header - << "Server: Jetty(8.1.3.v20120416)[\r][\n]"
main DEBUG wire.header - << "[\r][\n]"
main DEBUG httpclient.HttpMethodBase - Buffering response body
main DEBUG wire.content - << "112ba2bnjegha"
main DEBUG httpclient.HttpMethodBase - Resorting to protocol version default close connection policy
main DEBUG httpclient.HttpMethodBase - Should NOT close connection, using HTTP/1.1
main DEBUG httpclient.HttpConnection - Releasing connection back to connection manager.
main DEBUG wire.header - >> "POST /servlet/ClientIO/112ba2bnjegha/s1/2 HTTP/1.1[\r][\n]"
main DEBUG httpclient.HttpMethodBase - Adding Host request header
main DEBUG wire.header - >> "Cookie: JSESSIONID=1264jas24clyq138zcokjlduhm[\r][\n]"
main DEBUG wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
main DEBUG wire.header - >> "Host: fs-backend.i-telligence.de:8000[\r][\n]"
main DEBUG wire.header - >> "Content-Length: 49[\r][\n]"
main DEBUG wire.header - >> "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - >> "[\r][\n]"
main DEBUG wire.content - >> "[0x80]/[0x1][0x3][0x1][0x0][0x6][0x0][0x0][0x0] [0x0][0x0]4[0x0][0x0][0xff]P[0xd0][0x95]%[0xd7]:/[0x9b]k[0xa6][0xbb][0x95][0xd2][0xdf])[0xb8][0xe6]h[0xe5][0x84][0xaa][0x88][0xfb][\n]"
main DEBUG wire.content - >> "[0x1e]y[0xa0][0x84]S[0xbb][0x1c]`"
main DEBUG methods.EntityEnclosingMethod - Request body sent
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - << "Content-Length: 0[\r][\n]"
main DEBUG wire.header - << "Server: Jetty(8.1.3.v20120416)[\r][\n]"
main DEBUG wire.header - << "[\r][\n]"
main DEBUG httpclient.HttpMethodBase - Buffering response body
main DEBUG httpclient.HttpMethodBase - Resorting to protocol version default close connection policy
main DEBUG httpclient.HttpMethodBase - Should NOT close connection, using HTTP/1.1
main DEBUG httpclient.HttpConnection - Releasing connection back to connection manager.
main DEBUG wire.header - >> "POST /servlet/ClientIO/112ba2bnjegha/s1/3 HTTP/1.1[\r][\n]"
main DEBUG httpclient.HttpMethodBase - Adding Host request header
main DEBUG wire.header - >> "Cookie: JSESSIONID=1264jas24clyq138zcokjlduhm[\r][\n]"
main DEBUG wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
main DEBUG wire.header - >> "Host: fs-backend.i-telligence.de:8000[\r][\n]"
main DEBUG wire.header - >> "Content-Length: 0[\r][\n]"
main DEBUG wire.header - >> "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - >> "[\r][\n]"
main DEBUG methods.EntityEnclosingMethod - Request body sent
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "HTTP/1.1 200 OK[\r][\n]"
main DEBUG wire.header - << "Content-Type: application/octet-stream[\r][\n]"
main DEBUG wire.header - << "Content-Length: 0[\r][\n]"
main DEBUG wire.header - << "Server: Jetty(8.1.3.v20120416)[\r][\n]"
main DEBUG wire.header - << "[\r][\n]"
this BOLD part looping and never stop
The "loop" could be the keep-alive - are there any exceptions visible? On the server perhaps? Are the libs compatible (i.e. matching the server version)?
Could you try your code from a beanshell console in a java client instance?
Hi Peter,
if I run the script in a beanshell is working...any idea? Rights? Eclipse?
A similar problem has been reported at getUserService() wirft java.lang.SecurityException and at Problem beim Zugriff über eigenes Eclipse Plugin. But in both cases a SecurityException is thrown, which you say you don't have.
Could you please print out the elements of ConnectionManager.class.getSigners() when starting from Eclipse, there should be a certificate by e-spirit AG and by Thawte.
That's ok, it's an older certificate from GlobalSign. So this is obviously not the problem..