pdfparser - document structure metadata - pdfbox

I would appreciate a quick pointer on finding out the structural information inside a PDF file - something like the H1, H2, H3 in Microsoft Word. I have been catching up on the stream-oriented PDF file format and am not familiar with the heading operator. Or whether there is such a concept of a heading. I plan to use these heading features to break the PDF down for indexing and searching. That way, I can break down the PDF file into multiple sections for searching.
I found the following in log file. I am guessing this is the beginning of a page but not sure about the significance of them.
2018-11-24 16:43:05 DEBUG PDFStreamEngine:260 - processing substream token: PDFOperator{BT}
2018-11-24 16:43:15 DEBUG PDFStreamEngine:260 - processing substream token: COSName{GS0}
2018-11-24 16:43:21 DEBUG PDFStreamEngine:260 - processing substream token: PDFOperator{gs}
2018-11-24 16:43:27 DEBUG PDFStreamEngine:260 - processing substream token: COSName{TT0}
2018-11-24 16:43:38 DEBUG PDFStreamEngine:260 - processing substream token: COSInt{1}
2018-11-24 16:43:41 DEBUG PDFStreamEngine:260 - processing substream token: PDFOperator{Tf}
2018-11-24 16:43:42 DEBUG PDFStreamEngine:260 - processing substream token: COSFloat{0.0031}
2018-11-24 16:43:42 DEBUG PDFStreamEngine:260 - processing substream token: PDFOperator{Tc}
2018-11-24 16:43:43 DEBUG PDFStreamEngine:260 - processing substream token: COSFloat{-0.0038}
2018-11-24 16:43:43 DEBUG PDFStreamEngine:260 - processing substream token: PDFOperator{Tw}
2018-11-24 16:43:44 DEBUG PDFStreamEngine:260 - processing substream token: COSFloat{9.96}
2018-11-24 16:43:44 DEBUG PDFStreamEngine:260 - processing substream token: COSInt{0}

Related

AWS SDK for Java V2: PutObject corrupts uploaded file when checksumAlgorithm is specified

I'm trying to use the AWS SDK for Java v2 to upload a file to S3 and have the upload integrity checked using the SHA256 trailing checksum. My code works fine to upload the file if the checksumAlgorithm(ChecksumAlorithm.SHA256) property of PutObjectRequest is not present but when it is included the uploaded file has additional characters at its start and is truncated at the end.
Here's the code I'm using:
byte[] smallJsonBytes = getObjectFile("UploadTest\\smallFile.txt");
PutObjectRequest putOb = PutObjectRequest.builder()
.bucket(credsProvider.getS3Bucketname())
.key(s3Key)
**.checksumAlgorithm(ChecksumAlgorithm.SHA256)**
.build();
PutObjectResponse response = this.myS3Client.putObject(putOb, RequestBody.fromBytes(smallJsonBytes));
Below is the debug output when the checksumAlgorithm property is included. You can see the AWS SDK is generating a trailing checksum as expected but, as noted already, the uploaded file is corrupted: You can see the insertion of the string "14" in the debug output and this string appears at the beginning of the uploaded file. Additionally, the uploaded file is truncated.
Clearly from the debug output there is a problem with the evaluation of the file's content length.
I've tried specifying the contentLength directly on the PutObjectRequest (as per documentation - .contentLength(long length)), and also tried converting smallJsonBytes to a ByteArrayInputStream and specifying the contentLength in the RequestBody.fromInputStream, both with the same result.
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "x-amz-content-sha256: STREAMING-UNSIGNED-PAYLOAD-TRAILER[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "X-Amz-Date: 20230216T215655Z[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "x-amz-decoded-content-length: 20[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "x-amz-sdk-checksum-algorithm: SHA256[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "x-amz-trailer: x-amz-checksum-sha256[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 99[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
14:56:56.150 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
14:56:56.206 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 100 Continue[\r][\n]"
14:56:56.206 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
14:56:56.211 [main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 100 Continue
14:56:56.211 [main] DEBUG software.amazon.awssdk.core.internal.io.SdkLengthAwareInputStream - Specified InputStream length of 20 has been reached. Returning EOF.
14:56:56.213 [main] DEBUG software.amazon.awssdk.core.internal.io.SdkLengthAwareInputStream - Specified InputStream length of 20 has been reached. Returning EOF.
14:56:56.216 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "14[\r][\n]"
14:56:56.217 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "Nothing much in here[\r][\n]"
14:56:56.217 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "0[\r][\n]"
14:56:56.217 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "x-amz-checksum-sha256:BthkalBn8SFAnEAFIWr2vtfO0h+TEdX/vOH+iZqKJ4k=[\r][\n]"
14:56:56.217 [main] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
14:56:56.389 [main] DEBUG org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"

Duplicate headers are added at runtime in Rest assured

I am trying to send a request with one header(authorization) but when i check the logs i am seeing same header is added twice to the request which is causing my tests to fail.
Below is the post method which i am using
public static Response doPost(String basePath, Object payload, String header) {
return reqSpec.given().header("X-HSBC-E2E-Trust-Token", header).config(RestAssuredConfig.config())
.body(payload.toString()).log().all()
.post(basePath).then().extract().response();
}
Log:
Request URI: https:Url
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Headers:E2E-Trust-Token=0JDX09VRIMl9TRVJWRVJfREVWIn0.eyJzaXQiOiJhZDp1c3I6ZW1wbG95ZWVJZCIsInN1YiI6IkdCLVNWQy1GV0tUQVBJRlAiLCJhbHQiOlt7InNpdCI6ImVtYWlsIiwic3ViIjoiR0ItU1ZDLUZXS1RBUElGUEBOb3RSZWNlaXZpbmdNYWlmhzYmMuY29tIn0seyJzaXQiOiJuYW1lIiwic3ViIjoiR0ItU1ZDLUZXS1RBUElGUCJ9LHsic2l0IjoibG9naW5JZCIsInN1YiI6IkdCLVNWQy1GV0tUQVBJRlAifV0sImdycCI6WyJDTj1JbmZvZGlyLUFQSUF1dG9GV0stUHJvZFN W5kYXJkLE9VPUlUSURBUEksT1U9QXBwbGljYXRpb25zLE9VPUdyb3VwcyxEQz1JbmZvRGlyLERDPVByb2QsREM9SFNCQyIsIkNOPUluZm9kaXItQVBJQXV0b0ZXSy1Qcm9kQWRtaW4sT1U9SVRJREFQSSxPVT1BcHBsaWNhdGlvbnM1U9R3JvdXBzLERDPUluZm9EaXIsREM9UHJvZCxEQz1IU0JDIl0sInNjb3BlIjoiSVRJREFQSSIsImp0aSI6IjBlMGQ0YzM5LThlMjQtNDI5MC1iZGExLTE0MzllOTRlMzcxYyIsImlzcyI6ImdibDIwMTA5MDk2LmhjLmNsb3VkLnVmhzYmMiLCJpYXQiOjE2NTc1MzE2NTEsImV4cCI6MTY1NzUzMjI1MSwiYXVkIjoiR0ItU1ZDLUFQSUZXREVWQEhCRVUiLCJ1c2VyX25hbWUiOiJHQi1TVkMtRldLVEFQSUZQIn0.HgxR7j7fbl5JRQxTFX0Z7OJLk_11Vc4fUFPEZ9E
Accept=*/*
E2E-Trust-Token=0JDX09BVVRIMl9TRVJWRVJfREVWIn0.eyJzaXQiOiJhZDp1c3I6ZW1wbG95ZWVJZCIsInN1YiI6IkdCLVNWQy1GV0tUQVBJRlAiLCJhbHQiOlt7InNpdCI6ImVtYWlsIiwic3ViIjoiR0ItU1ZDLUZXS1RBUElGUEBOb3RSZWNlaXZmdNYWlsLmhzYmMuY29tIn0seyJzaXQiOiJuYW1lIiwic3ViIjoiR0ItU1ZDLUZXS1RBUElGUCJ9LHsic2l0IjoibG9naW5JZCIsInN1YiI6IkdCLVNWQy1GV0tUQVBJRlAifV0sImdycCI6WyJDTj1JbmZvZGlyLUFQSUF1dG9GV0sHJvZFN0YW5kYXJkLE9VPUlUSURBUEksT1U9QXBwbGljYXRpb25zLE9VPUdyb3VwcyxEQz1JbmZvRGlyLERDPVByb2QsREM9SFNCQyIsIkNOPUluZm9kaXItQVBJQXV0b0ZXSy1Qcm9kQWRtaW4sT1U9SVRJREFQSSxPVT1BcHBsaWN
3VkLnVrLmhzYmMiLCJpYXQiOjE2NTc1MzE2NTEsImV4cCI6MTY1NzUzMjI1MSwiYXVkIjoiR0ItU1ZDLUFQSUZXREVWQEhCRVUiLCJ1c2VyX25hbWUiOiJHQi1TVkMtRldLVEFQSUZQIn0.HgxR7j7fbl5JRQxTFX0Z7OJLk_11Vc4FPEZ9Ec2xVXmUxeE6M3f8wBe4HOrQDJw_gWm_Kvf_hepsvAu0S0ACRQ3P_4i5yf2z0FXtBoUd3v9AvZcB299PZGJhNZ4HxUEP5SdzjQWOuZgdHAFg6GJdgsYBLTuCXQqy-kdqgPczgx7bgKTBfqrWH2I4qH1ZSE2OlksvGPj0Ia1Ts
Content-Type=application/json; charset=UTF-8
Cookies: <none>
Multiparts: <none>
Body:
{
"name": "TestRole11072733",
"requiresApproval": true,
"signatures": [
1091
]
}
10:27:36.574 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Get connection for route {s}->https:URL
10:27:36.574 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator - Connecting to Endpoint
10:27:37.001 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: ignoreCookies
10:27:37.001 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
10:27:37.001 [main] DEBUG org.apache.http.client.protocol.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
10:27:37.001 [main] DEBUG org.apache.http.impl.client.DefaultHttpClient - Attempt 1 to execute request
10:27:37.001 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Sending request: POST Endpoint

Webclient response handler (both success & error) does not execute for empty response body

Have an async REST API client implemented with OkHttp, works just fine.
Trying to convert it to WebClient out of curiosity, observing weird behaviour.
WebClient configuration is just this:
webClient = WebClient.builder()
.defaultHeaders(headers -> headers.add(HttpHeaders.CONTENT_TYPE,
org.springframework.http.MediaType.APPLICATION_JSON_VALUE))
.clientConnector(new ReactorClientHttpConnector(builder -> builder
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, timeout)))
.build();
request code:
void getTokenWithWebClient(Consumer<Try<String>> callback) {
webClient.post()
.uri(url)
.syncBody(new MyRequest())
.retrieve()
.onStatus(status -> status.value() != HttpStatus.OK.value(),
rs -> rs.bodyToMono(String.class).map(body -> new IOException(String.format(
"Response HTTP code is different from 200: %s, body: '%s'", rs.statusCode(), body))))
.bodyToMono(MyResponse.class)
.subscribe(rs -> callback.accept(Try.of(() -> validateResponse(Option.of(rs)))),
ex -> callback.accept(Try.failure(ex)));
}
In the unit test, callback that is passed as an argument to this method, completes a Future, on which I wait.
So, when I run the test in IDEA, and the request results in a response with empty body (content-length: 0), the lambdas in subscribe() never execute - verified using println debugging.
But when I debug the same test, even without any breakpoints set, it completes as expected and the lambdas are invoked depending on the result.
I do see this in the log:
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClientOperations - [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522] Received last HTTP packet
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522] USER_EVENT: [Handler Terminated]
[reactor-http-nio-4] DEBUG reactor.ipc.netty.channel.ChannelOperationsHandler - [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522] Disposing context reactor.ipc.netty.channel.PooledClientContextHandler#3547abe3
[reactor-http-nio-4] DEBUG reactor.ipc.netty.channel.PooledClientContextHandler - Releasing channel: [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522]
[reactor-http-nio-4] DEBUG reactor.ipc.netty.resources.DefaultPoolResources - Released [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522], now 0 active connections
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522] READ COMPLETE
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 - R:localhost/127.0.0.1:58522] READ COMPLETE
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 ! R:localhost/127.0.0.1:58522] CLOSE
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 ! R:localhost/127.0.0.1:58522] INACTIVE
[reactor-http-nio-4] DEBUG reactor.ipc.netty.http.client.HttpClient - [id: 0xeffaded6, L:/127.0.0.1:49265 ! R:localhost/127.0.0.1:58522] UNREGISTERED
but then the Mono with my error gets stuck somewhere.
Running this on Windows 7, Oracle JDK8 x64, IDEA 2018.
Option/Try are vavr classes (io.vavr:vavr), not relevant for this case.
For unit tests, I mock the REST API in question using Ratpack.
Tried using exchange() instead of retrieve() and checking the status code in the subscribe() lambda, without onStatus() - with the same result.
Any ideas?
long story short, rs.bodyToMono(String.class).defaultIfEmpty("") saved the day

playsms - kannel -smsc Able to receive but not to send sms

I use playsms and kannel, I can receive sms but i cannot send sms.
When I try to send a sms I got:
1. 0: Accepted for delivery in the browser
tail -f /var/log/kannel/smsbox.log
sudo tail -f /var/log/kannel/smsbox.log
2015-07-20 15:20:12 [2711] [3] INFO: smsbox: Got HTTP request from <127...*>
2015-07-20 15:20:12 [2711] [3] INFO: sendsms used by
2015-07-20 15:20:12 [2711] [3] INFO: sendsms sender:***> (127...) to:<2*******> msg:
2015-07-20 15:20:12 [2711] [3] DEBUG: Stored UUID f5a87ab8-bd95-413b-a9a6-eb37e9b454da
2015-07-20 15:20:12 [2711] [3] DEBUG: message length 14, sending 1 messages
2015-07-20 15:20:12 [2711] [3] DEBUG: Status: 202 Answer:
2015-07-20 15:20:12 [2711] [3] DEBUG: Delayed reply - wait for bearerbox
2015-07-20 15:20:12 [2711] [0] DEBUG: Got ACK (0) of f5a87ab8-bd95-413b-a9a6-eb37e9b454da
2015-07-20 15:20:12 [2711] [0] DEBUG: HTTP: Destroying HTTPClient area 0x7f827c000a90.
2015-07-20 15:20:12 [2711] [0] DEBUG: HTTP: Destroying HTTPClient for 127...*)'.
2015-07-20 15:31:13 [2711] [2] DEBUG: HTTP: Creating HTTPClient for127...*)'.
2015-07-20 15:31:13 [2711] [2] DEBUG: HTTP: Created HTTPClient area 0x7f827c000a90.
In playsms the sms is pending and not sent
Have you any idea what is my problem?

Maximo Anywhere Not Able To login

I have Maximo Anywhere installed on WebSphere 8.5.5.3 and Maximo installed in Weblogic
i am not able to login to anywhere apps
i tried to debug it from chrome console i found its stuck on loop as the below
> worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149252","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149253"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149253"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149254","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149255"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149255"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:163 [TRACE] [ServerAuthenticationProvider] User test successfully authentication against realm "CustomAuthenticationRealm"
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":true,"userId":"test","attributes":{"Cookie":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=\/","AuthenticationDate":"Wed Jul 08 03:07:48 GST 2015"},"isUserAuthenticated":1,"responseID":"149256","displayName":null}*/
Logger.js:163 [TRACE] User test authenticated successfully on server
Logger.js:163 [TRACE] [COMM] Previous "userInfo" resource data request resolved.
Logger.js:163 [TRACE] [COMM] Getting data from adapter if connectivity is available.
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
Logger.js:163 [TRACE] [COMM] Connectivity is available
Logger.js:163 [TRACE] [COMM] Requesting data for adapter
Logger.js:151 [COMM] resourceUrl: http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier
Logger.js:163 [TRACE] Invoking adapter with these parameters: {"adapter":"OSLCGenericAdapter","procedure":"query","parameters":[{"url":"http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser?savedQuery=currentUser&…Bspi%3Agroupname%7D&oslc.pageSize=300&oslc.orderBy=%2Bdcterms%3Aidentifier","sessionid":"JSESSIONID=0000NpUyrxPJPTCpeahWtAKZ-xr:-1; Path=/","langcode":"en-US"}],"timeout":360000}
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http:\/\/192.168.1.31:7001\/maximo\/oslc\/error\/messages\/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149257"}*/
worklight.js:4675 Procedure invocation error. [object Object]WL.Logger.__log # worklight.js:4675PUBLIC_API.(anonymous function) # worklight.js:4860onInvokeProcedureSuccess # worklight.js:7353window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onSuccess # worklight.js:3240window.WLJSX.Ajax.WLRequest.WLJSX.Class.create.onWlSuccess # worklight.js:3212(anonymous function) # worklight.js:949window.WLJSX.Ajax.Request.WLJSX.Class.create.respondToReadyState # worklight.js:1158window.WLJSX.Ajax.Request.WLJSX.Class.create.onStateChange # worklight.js:1096(anonymous function) # worklight.js:949
Logger.js:163 [TRACE] UserAuthenticationManager.invokeAdapterSecurely: onFailure{"status":200,"invocationContext":null,"errorCode":"PROCEDURE_ERROR","errorMsg":"Procedure invocation error. [object Object]","invocationResult":{"isSuccessful":false,"errors":[{"oslc:extendedError":{"oslc:moreInfo":{"rdf:resource":"http://192.168.1.31:7001/maximo/oslc/error/messages/BMXAA0021E04"}},"oslc:message":"BMXAA0021E04 - User name and password combination are not valid. Try again.","oslc:statusCode":"401","spi:reasonCode":"BMXAA0021E04"}],"responseID":"149257"}}
Logger.js:163 [TRACE] Session for user test expired
Logger.js:163 [TRACE] Reauthenticating
Logger.js:163 [TRACE] Authenticating user test against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
*i tried to call the OSLC Link direct from Maximo its working fine.
*i tried to run the application from eclipse and using Librity server it working fine .
I Restarted the Server where Work-light installed the exception changed to
Authentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94m # dojo.js:89q.reject # dojo.js:92a # dojo.js:90g # dojo.js:89o.then.b.then # dojo.js:92classBody._activateCollections # PersistenceManager.js:303classBody.activateCollectionsOrFail # PersistenceManager.js:284lang.mixin._localAuthentication # UserAuthenticationManager.js:303lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {name: undefined, messageKey: undefined, params: Array[0], stack: "undefined? at http://localhost:9084/worklight/a…fault/js/platform/handlers/LoginHandler.js:72:47)"} "undefined
at http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:308:23
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
----------------------------------------
rejected at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:493)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:304:4)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)
----------------------------------------
Error
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:143)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:304:4)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at Function.g.emit (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:106:485)
at declare.fire (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:306:7)
at declare.release (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/tap.js:104:10)
at declare._process (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojox/gesture/Base.js:273:15)"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94m # dojo.js:89q.reject # dojo.js:92a # dojo.js:90g # dojo.js:89o.then.b.then # dojo.js:92lang.mixin._localAuthentication # UserAuthenticationManager.js:304lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {name: undefined, messageKey: undefined, params: Array[0], stack: "undefined? at http://localhost:9084/worklight/a…fault/js/platform/handlers/LoginHandler.js:72:47)"} "undefined
at http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:308:23
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
----------------------------------------
rejected at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:479)
at o.then.b.then [as then] (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:198)
at classBody._activateCollections (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:303:4)
at classBody.activateCollectionsOrFail (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/store/PersistenceManager.js:284:16)
at Object.lang.mixin._localAuthentication (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:303:23)
at Object.lang.mixin.login (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:133:10)
at declare.loginClickHandler (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/handlers/LoginHandler.js:72:47)
at null.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/ui/control/UserInterface.js:757:47)
at HTMLButtonElement.e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
----------------------------------------
undefined"l # dojo.js:59h # dojo.js:59k.around.advice # dojo.js:95e.(anonymous function).k # dojo.js:94g # dojo.js:90o.then.b.then # dojo.js:92lang.mixin._localAuthentication # UserAuthenticationManager.js:304lang.mixin.login # UserAuthenticationManager.js:133declare.loginClickHandler # LoginHandler.js:72(anonymous function) # UserInterface.js:757e.hitch # dojo.js:34g.emit # dojo.js:106declare.fire # Base.js:306declare.release # tap.js:104declare._process # Base.js:273e._hitchArgs # dojo.js:34
Logger.js:163 [TRACE] Authenticating user test1 against realm CustomAuthenticationRealm
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 0ms
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:231 [TIMER] [COMM] Fetching simulator for connectivity: 1ms
worklight.js:4675 Request [/worklight/apps/services/api/WorkExecution/common/query]
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] false
worklight.js:4675 response [/worklight/apps/services/api/WorkExecution/common/query] success: /*-secure-
{"properties":{"si.auth.type":"maximo"},"isSuccessful":true,"responseID":"7"}*/
Logger.js:163 [TRACE] [COMM] Successfully returned properties: {"si.auth.type":"maximo"}
worklight.js:4675 Request [login]
Logger.js:163 [TRACE] ServerAuthenticationProvider.login
Logger.js:163 [TRACE] [CustomChallangeHandler.isCustomResponse] true - authStatus
Logger.js:151 [_realmAuthentication] Unable to authenticate user test1 on server
Logger.js:151 Loading message showed by application = true
Logger.js:151 Cancel processing requested
Logger.js:163 [TRACE] Closing local storage
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: true
Startup.js:44 Hiding the "Loading..." message in 8 seconds
Startup.js:42 === Global promise rejection handling ===
Startup.js:43 === handled: false
Startup.js:44 Hiding the "Loading..." message in 8 seconds
dojo.js:59 Object {oslcError: "null oslcError", errorMsg: "Your user name and password could not be validated. Connect to the server and try again."} "
----------------------------------------
rejected at Object.<anonymous> (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/js/platform/auth/UserAuthenticationManager.js:523:17)
at e.hitch (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:34:484)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:320)
at m (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:246)
at q.reject (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:92:33)
at a (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:90:226)
at g (http://localhost:9084/worklight/apps/services/preview/WorkExecution/common/0/default/dojo/dojo.js:89:493)
at m
So you said you restarted the server worklight is installed on. The first thing i would ask then is the war file that you deployed to that server, when it was built, was it pointing to a different Maximo than what your adapter currently has?
If it worked in the liberty server, I would say to update the war file that your worklight server is using, there may be a difference in what it is pointing.
This would involve updating your build.properties'
worklight.server.* properties, then rebuild the app, and then redeploy the war file that you will have in your MaximoAnywhere/bin directory
You have a authentication/login error based on "errorMsg: "Your user name and password could not be validated. Connect to the server and try again." and "oslc:statusCode":"401" . I don't know much about Anywhere. Can you explain how the authentication to the backend (OSLC oto Maximo) is hapenning ? What is the security test declared in for "OSLCGenericAdapter" procedure:"query",? It seems you are doing a request to "http://192.168.1.31:7001/maximo/oslc/os/oslcmaxuser" maybe this server is not available ? Are you using some invalid username/pass ?