Cognito authentication keeps retrying forever, without throwing exception - java

I have a simple test code for Cognito authentication code in Java with Spring Boot. It works fine on my local, but when I on my remote server (CentOS) it acts very weirdly. If a user does not exist in the pool. keeps creating and recreating new threads and sending the request.
The code:
protected boolean isValidCognito(String username, String password) {
// Retrieving the AWS credentials from the default instance profile credentials instead of ".withCredentials()".
// More info on https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
AWSCognitoIdentityProvider awsCognitoIDPClient = AWSCognitoIdentityProviderClientBuilder.standard().build();
Map<String,String> authParams =new HashMap<>();
authParams.put("USERNAME", username);
authParams.put("PASSWORD", password);
AdminInitiateAuthRequest initialRequest = new AdminInitiateAuthRequest()
.withAuthFlow(AuthFlowType.ADMIN_NO_SRP_AUTH)
.withAuthParameters(authParams)
.withClientId(COGNITO_CLIENT_ID)
.withUserPoolId(COGNITO_POOL_ID);
try {
// NOTE: I know the request is being sent for sure, so we probably get at least this far
AdminInitiateAuthResult initialResponse = awsCognitoIDPClient.adminInitiateAuth(initialRequest);
Map<String, String> challengeParams = initialResponse.getChallengeParameters();
String cognitoUserIdForSrp = challengeParams.get("USER_ID_FOR_SRP");
String cognitoUserAttributes = challengeParams.get("userAttributes");
logger.debug("Cognito authenticated user ID: " + cognitoUserIdForSrp
+ " with user attributes: " + cognitoUserAttributes);
return true;
} catch (NotAuthorizedException nae) {
logger.error("Invalid Cognito username/password provided for " + authParams.get("USERNAME"));
return false;
} catch (AWSCognitoIdentityProviderException acipe) {
logger.error("Amazon Cognito Identity Provider Error!");
logger.debug("Make sure the user exists in the pool, and ALLOW_ADMIN_USER_PASSWORD_AUTH is enabled.");
return false;
} catch (Exception e) {
logger.error("Unexpected Error: ", e);
return false;
}
}
Logs if it helps:
2020-02-25 17:14:54.919 TRACE 25144 --- [http-nio-8080-exec-98] o.s.t.i.TransactionInterceptor : Getting transaction for [METHOD_NAME]
2020-02-25 17:14:54.926 TRACE 25144 --- [http-nio-8080-exec-98] o.s.t.i.TransactionInterceptor : Completing transaction for [METHOD_NAME]
2020-02-25 17:14:54.935 TRACE 25144 --- [http-nio-8080-exec-98] o.s.t.i.TransactionInterceptor : Getting transaction for [METHOD_NAME]
2020-02-25 17:14:54.942 TRACE 25144 --- [http-nio-8080-exec-98] o.s.t.i.TransactionInterceptor : Completing transaction for [METHOD_NAME]
2020-02-25 17:14:54.950 DEBUG 25144 --- [http-nio-8080-exec-98] c.c.c.r.persistence.CognDaoImpl : There is a user migrated to Cognito with user_id: SOME_UUID
2020-02-25 17:14:54.950 INFO 25144 --- [http-nio-8080-exec-98] c.c.c.r.c.AuthenticationController : my_email#mailinator.com has been migrated. Using Cognito for authentication.
2020-02-25 17:14:56.655 TRACE 25144 --- [http-nio-8080-exec-160] o.s.t.i.TransactionInterceptor : Getting transaction for [METHOD_NAME]
2020-02-25 17:14:56.673 TRACE 25144 --- [http-nio-8080-exec-160] o.s.t.i.TransactionInterceptor : Completing transaction for [METHOD_NAME]
2020-02-25 17:14:56.683 TRACE 25144 --- [http-nio-8080-exec-160] o.s.t.i.TransactionInterceptor : Getting transaction for [METHOD_NAME]
2020-02-25 17:14:56.692 TRACE 25144 --- [http-nio-8080-exec-160] o.s.t.i.TransactionInterceptor : Completing transaction for [METHOD_NAME]
2020-02-25 17:14:56.705 DEBUG 25144 --- [http-nio-8080-exec-160] c.c.c.r.persistence.CogDaoImpl : There is a user migrated to Cognito with user_id: SOME_UUID
2020-02-25 17:14:56.705 INFO 25144 --- [http-nio-8080-exec-160] c.c.c.r.c.AuthenticationController : my_email#mailinator.com has been migrated. Using Cognito for authentication.
...

There is nothing inherently wrong with "creating and recreating threads". If you have too many threads, your jvm will run out of memory or your process will die because you have hit some system limits. If you think your code is going into a loop, you need to find out who is calling your code and analyze that part of your code. Perhaps a thread-dump may help.

Related

how to fix 'resource not found' when trying to download file in spring boot REST API?

I'm new to spring framework and REST, and now trying to migrate REST from jersey to spring boot 2.1
The controller works fine with jax-rs, however, I don't want to use jax-rs in spring boot. So, I tried spring Mvc and I get 'resource not found' error. Please I'd really appreciate any help.
I tried this
#GetMapping(value ="/generic/download_file/{path:[^\\.+]*}", consumes ="application/vnd.X-FileContent")
public ResponseEntity<?> downloadFile(#PathVariable("path") String filePath){
String actualFilePath = "";
try {
actualFilePath = filePath.replaceAll("\\/", "\\\\");
File file = new File(actualFilePath);
if (file.exists()) {
return ResponseEntity.ok().header("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"").body(file);
} else {
return errorHandling.errorResponseFactory("1.0.0", Thread.currentThread().getStackTrace()[1], "",
RecommendedSolution.UseValidDirectoryPath, "File not exist.");
}
} catch (Exception ex) {
ActionLog.writeLog("program_library_v510", "1.0.0", "Exception occur during gettig generic package file",
ActionLogType.DebugLog);
ActionLog.writeLog("program_library_v510", "1.0.0", "Exception occur during getting generic package file",
ActionLogType.ErrorLog);
return errorHandling.errorResponseFactory("1.0.0", Thread.currentThread().getStackTrace()[1], "",
RecommendedSolution.UnexpectedErrorMsg, "");
}
}
2019-01-07 17:17:23.930 INFO 13664 --- [nio-9090-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 10 ms
2019-01-07 17:17:23.947 DEBUG 13664 --- [nio-9090-exec-2] o.s.web.servlet.DispatcherServlet : GET "/packages/download_file/D:/xfolder/test.txt", paramete
rs={}
2019-01-07 17:17:24.002 DEBUG 13664 --- [nio-9090-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/
resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2019-01-07 17:17:24.006 DEBUG 13664 --- [nio-9090-exec-2] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found
2019-01-07 17:17:24.007 DEBUG 13664 --- [nio-9090-exec-2] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2019-01-07 17:17:24.015 DEBUG 13664 --- [nio-9090-exec-2] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={}
2019-01-07 17:17:24.029 DEBUG 13664 --- [nio-9090-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServ
letRequest)
2019-01-07 17:17:24.077 DEBUG 13664 --- [nio-9090-exec-2] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [/] and supported [applic
ation/json, application/+json, application/json, application/+json]
2019-01-07 17:17:24.078 DEBUG 13664 --- [nio-9090-exec-2] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Mon Jan 07 17:17:24 SGT 2019, status=40
4, error=Not Found, message=No message available, path=/packages/download_file/D:/xfolder/test.txt}]
2019-01-07 17:17:24.146 DEBUG 13664 --- [nio-9090-exec-2] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404
I suspect two things here. Let me clarify this.
What is the API url you are calling?
/generic/download_file/{path:[^\\.+]*} or /packages/download_file/D:/xfolder/test.txt
both are looks different. Please see generic and packages
The better way to pass filenames in URL is using #RequestParam instead of #PathVariable
#GetMapping(value ="/generic/download_file/", consumes ="application/vnd.X-FileContent")
public ResponseEntity downloadFile(#RequestParam("path") String filePath){

Why Cryptoki.C_OpenSession disconnect from HSM sometimes

I' created a web service isAlive to check if I can create session with the HSM soft using the Cryptoki ,I automated the execution of my web service using SoapUI so I execute my service in a loop each 40s ,it work well but after a number of call I can't connect to my HSM until I restart my App : this the part of code that I used to connect to HSM
// create session handle
CK_SESSION_HANDLE session= new CK_SESSION_HANDLE();
// return code
CK_RV retcode;
// get session
retcode=Cryptoki.C_OpenSession(safeNetSlot, CKF.RW_SESSION, null, null, session);
checkRetCode(retcode, "Could not open session on HSM");
log.debug("Session [{}]",session.longValue());
// do login
final String recovHsmPassword = PasswordManagement.recoverPassword(hsmPassword);
retcode=Cryptoki.C_Login(session, CKU.USER, recovHsmPassword.getBytes(), recovHsmPassword.length());
checkRetCode(retcode, "Could not login as user");
During the execution of my service I watch logs I look that the session.longValue() incremented with each calls :
This's the logs :
INFO 5056 --- [nio-8191-exec-5] ccom.test.app.V1Controler : Request for isAlive API
DEBUG 5056 --- [nio-8191-exec-5] com.test.app.hsm.HsmService : Session [1]
INFO 5056 --- [nio-8191-exec-5] com.test.app.V1Controler : Request for isAlive API
DEBUG 5056 --- [nio-8191-exec-5] com.test.app.hsm.HsmService : Session [2]
INFO 5056 --- [nio-8191-exec-5] com.test.app.V1Controler : Request for isAlive API
DEBUG 5056 --- [nio-8191-exec-5] com.test.app.hsm.HsmService : Session [3]
INFO 5056 --- [nio-8191-exec-5] com.test.app.V1Controler : Request for isAlive API
......
INFO 5056 --- [nio-8191-exec-5] com.test.app.V1Controler : Request for isAlive API
DEBUG 5056 --- [nio-8191-exec-5] com.test.app.hsm.HsmService : Session [1176]
INFO 5056 --- [nio-8191-exec-5] com.test.app.V1Controler : Request for isAlive API
2018-08-14 10:39:06.550 ERROR 1 --- [nio-8443-exec-3] com.test.app.hsm.HsmService : HSM return error [MSG_ERROR general error]
I ask if someone have an idea how Cryptoki.C_OpenSession works and why I desconnect from my HSM
Generally HSM's have a bounded number of sessions available. Currently you are opening sessions, but you are never closing them with C_CloseSession. You should handle sessions as if they are resources, and resources may be sparse.
Note that there is also a function called C_TokenInfo that can be used to check the token status. Make sure you are using the right function for the job. You don't want to use a password when not required.

How do I display SQL errors from Spring and MyBatis?

I have the following code that I ran in the debugger with --debug but it won't print out any SQL errors. It fails silently with an exception and returns from the servlet request.
System.out.println("sourceMapper = " + sourceMapper);
Source source = sourceMapper.findByHost(host);
System.out.println("source = " + source);
This is the output
2018-05-11 13:47:58.080 INFO 29392 --- [nio-8080-exec-2] c.s.shorturl.apis.ShortUrlApiController : Method name: doUrlRequest() user agent is = curl/7.59.0
sourceMapper = org.apache.ibatis.binding.MapperProxy#30a1e904
2018-05-11 13:47:58.359 INFO 29392 --- [nio-8080-exec-2] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2018-05-11 13:47:58.489 INFO 29392 --- [nio-8080-exec-2] o.s.jdbc.support.SQLErrorCodesFactory : SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]
2018-05-11 13:47:58.541 DEBUG 29392 --- [nio-8080-exec-2] o.s.b.w.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade#645ec595
How do I print the SQL errors that it is encountering? Or find out why it's failing and what the exception is?
MyBatis 3.4.5, MyBatis Spring 1.3.1, MyBatis Spring Boot Autoconfigure 1.3.1, MyBatis Spring Boot Starter 1.3.1, Spring Boot 1.5.6
You could add a try/catch around your code and log a caught exception:
try {
System.out.println("sourceMapper = " + sourceMapper);
Source source = sourceMapper.findByHost(host);
System.out.println("source = " + source);
} catch (Exception e) {
// log using slf4j's Logger
logger.error("An exception caught", e);
// or print it to standard output
e.printStackTrace();
}
There should be a Logger instance somewhere (probably in the same class):
private final Logger logger = LoggerFactory.getLogger(this.getClass());

Eclipse milo: Session closed when trying to read data

I have an external OPC UA server, from which I would like to read data. I use username and password authentication, so my client is initialized like follows:
public class MyClient {
// ...
public MyClient() throws Exception {
EndpointDescription[] endpoints =
UaTcpStackClient.getEndpoints(OPCConstants.OPC_SERVER_URI).get();
// using the first endpoint
EndpointDescription endpoint = endpoints[0];
// client configuration
OpcUaClientConfig config = OpcUaClientConfig.builder()
.setApplicationName(LocalizedText.english("Example Client"))
.setApplicationUri(String.format("some:example-client:%s",
UUID.randomUUID()))
.setIdentityProvider(new UsernameProvider(USERNAME, PWD))
.setEndpoint(endpoint)
.build();
}
}
The client's request is the following:
public CompletableFuture<DataValue> getData(NodeId nodeId) {
LOGGER.debug("Sending request");
return client.readValue(60000000.0, TimestampsToReturn.Server, nodeId);
}
I call this request from the main method after initializing the client and connecting it to the server:
MyClient client = new MyClient();
NodeId requestedData = new NodeId(DATA_ID, DATA_KEY);
LOGGER.info("Sending synchronous TestStackRequest NodeId={}",
requestedData);
client.connect();
DataValue response = client.getData(requestedData).get();
LOGGER.info("Received response value={}", response.getValue());
client.disconnect();
However, this code doesn't work (the session is closed when trying to read informations from the server). I get the following output:
2018-04-12 17:43:27,765 DEBUG --- [ua-netty-event-loop-0] Recycler : -Dio.netty.recycler.maxCapacity.default: 262144
2018-04-12 17:43:27,777 DEBUG --- [ua-netty-event-loop-0] UaTcpClientAcknowledgeHandler : Sent Hello message on channel=[id: 0xfd9519e3, L:/172.20.100.54:55805 - R:/172.20.100.135:4840].
2018-04-12 17:43:27,786 DEBUG --- [ua-netty-event-loop-0] UaTcpClientAcknowledgeHandler : Received Acknowledge message on channel=[id: 0xfd9519e3, L:/172.20.100.54:55805 - R:/172.20.100.135:4840].
2018-04-12 17:43:27,793 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : OpenSecureChannel timeout scheduled for +5s
2018-04-12 17:43:27,946 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : Sent OpenSecureChannelRequest (Issue, id=0, currentToken=-1, previousToken=-1).
2018-04-12 17:43:27,951 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : OpenSecureChannel timeout canceled
2018-04-12 17:43:27,961 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : Received OpenSecureChannelResponse.
2018-04-12 17:43:27,967 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : SecureChannel id=1698234671, currentTokenId=1, previousTokenId=-1, lifetime=3600000ms, createdAt=DateTime{utcTime=131680285857690000, javaDate=Thu Apr 12 19:43:05 CEST 2018}
2018-04-12 17:43:27,968 DEBUG --- [ua-netty-event-loop-0] UaTcpClientMessageHandler : 0 message(s) queued before handshake completed; sending now.
2018-04-12 17:43:27,968 DEBUG --- [ua-shared-pool-1] ClientChannelManager : Channel bootstrap succeeded: localAddress=/172.20.100.54:55805, remoteAddress=/172.20.100.135:4840
2018-04-12 17:43:27,996 DEBUG --- [ua-shared-pool-0] ClientChannelManager : disconnect(), currentState=Connected
2018-04-12 17:43:27,997 DEBUG --- [ua-shared-pool-1] ClientChannelManager : Sending CloseSecureChannelRequest...
2018-04-12 17:43:28,000 DEBUG --- [ua-netty-event-loop-0] ClientChannelManager : channelInactive(), disconnect complete
2018-04-12 17:43:28,001 DEBUG --- [ua-netty-event-loop-0] ClientChannelManager : disconnect complete, state set to Idle
2018-04-12 17:43:28,011 INFO --- [main] OpcUaClient : Eclipse Milo OPC UA Stack version: 0.2.1
2018-04-12 17:43:28,011 INFO --- [main] OpcUaClient : Eclipse Milo OPC UA Client SDK version: 0.2.1
2018-04-12 17:43:28,056 DEBUG --- [main] OpcUaClient : Added ServiceFaultListener: org.eclipse.milo.opcua.sdk.client.session.SessionFsm$FaultListener#46d59067
2018-04-12 17:43:28,066 DEBUG --- [main] OpcUaClient : Added SessionActivityListener: org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaSubscriptionManager$1#78452606
2018-04-12 17:43:28,189 INFO --- [main] CommunicationMain : Sending synchronous TestStackRequest NodeId=NodeId{ns=6, id=::opcua:opcData.outGoing.basic.cycleStep}
2018-04-12 17:43:28,189 DEBUG --- [main] ClientChannelManager : connect(), currentState=NotConnected
2018-04-12 17:43:28,190 DEBUG --- [main] ClientChannelManager : connect() while NotConnected
java.lang.Exception
at org.eclipse.milo.opcua.stack.client.ClientChannelManager.connect(ClientChannelManager.java:67)
at org.eclipse.milo.opcua.stack.client.UaTcpStackClient.connect(UaTcpStackClient.java:127)
at org.eclipse.milo.opcua.sdk.client.OpcUaClient.connect(OpcUaClient.java:313)
at com.mycompany.opcua.participants.MyClient.connect(MyClient.java:147)
at com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:69)
at com.mycompany.opcua.participants.CommunicationMain.main(CommunicationMain.java:51)
2018-04-12 17:43:28,190 DEBUG --- [main] MyClient : Sending request
2018-04-12 17:43:28,197 DEBUG --- [ua-netty-event-loop-1] UaTcpClientAcknowledgeHandler : Sent Hello message on channel=[id: 0xd9b3f832, L:/172.20.100.54:55806 - R:/172.20.100.135:4840].
2018-04-12 17:43:28,204 DEBUG --- [ua-netty-event-loop-1] UaTcpClientAcknowledgeHandler : Received Acknowledge message on channel=[id: 0xd9b3f832, L:/172.20.100.54:55806 - R:/172.20.100.135:4840].
2018-04-12 17:43:28,205 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : OpenSecureChannel timeout scheduled for +5s
2018-04-12 17:43:28,205 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : Sent OpenSecureChannelRequest (Issue, id=0, currentToken=-1, previousToken=-1).
2018-04-12 17:43:28,208 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : OpenSecureChannel timeout canceled
2018-04-12 17:43:28,208 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : Received OpenSecureChannelResponse.
2018-04-12 17:43:28,209 DEBUG --- [ua-shared-pool-0] UaTcpClientMessageHandler : SecureChannel id=1698234672, currentTokenId=1, previousTokenId=-1, lifetime=3600000ms, createdAt=DateTime{utcTime=131680285860260000, javaDate=Thu Apr 12 19:43:06 CEST 2018}
2018-04-12 17:43:28,209 DEBUG --- [ua-netty-event-loop-1] UaTcpClientMessageHandler : 0 message(s) queued before handshake completed; sending now.
2018-04-12 17:43:28,209 DEBUG --- [ua-shared-pool-1] ClientChannelManager : Channel bootstrap succeeded: localAddress=/172.20.100.54:55806, remoteAddress=/172.20.100.135:4840
2018-04-12 17:43:28,210 DEBUG --- [ua-shared-pool-0] SessionFsm : S(Inactive) x E(CreateSessionEvent) = S'(Creating)
Exception in thread "main" java.util.concurrent.ExecutionException: UaException: status=Bad_SessionClosed, message=The session was closed by the client.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)2018-04-12 17:43:28,212 DEBUG --- [ua-shared-pool-1] SessionFsm : Sending CreateSessionRequest...
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:70)
at com.mycompany.opcua.participants.CommunicationMain.main(CommunicationMain.java:51)
Caused by: UaException: status=Bad_SessionClosed, message=The session was closed by the client.
at org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:100)
at org.eclipse.milo.opcua.stack.core.util.FutureUtils.failedUaFuture(FutureUtils.java:88)
at org.eclipse.milo.opcua.sdk.client.session.states.Inactive.(Inactive.java:28)
at org.eclipse.milo.opcua.sdk.client.session.SessionFsm.(SessionFsm.java:69)
at org.eclipse.milo.opcua.sdk.client.OpcUaClient.(OpcUaClient.java:159)2018-04-12 17:43:28,212 INFO --- [NonceUtilSecureRandom] NonceUtil : SecureRandom seeded in 0ms.
at com.mycompany.opcua.participants.MyClient.(MyClient.java:112)
at com.mycompany.opcua.participants.CommunicationMain.testClient(CommunicationMain.java:60)
... 1 more
I use Eclipse milo 0.2.1 as OPC UA library.
Could you please tell me hat can cause this issue and how to fix it? Can it be a race condition related to this?
I can connect to the same server using other client (UaExpert).
Thank you in advance.
All of the calls you're making (connect(), disconnect(), and readValues()) are asynchronous, so what's likely happening here is you're not connected when you attempt the read.
Make sure for these examples you block for the result before moving to the next step. (you're not doing this on connect())

Error in request sent to appengine backend devserver

I have a bunch of code which would run on backend but when testing locally I am getting memcache related error
INFO : { AppEngineUserRealm isUserInRole } - Checking if principal test#example.com is in role admin
SEVERE : { ShardedMemcacheUtil get } - Error encountered while getting [ configuration ] from memcache.
java.lang.ClassCastException: com.google.appengine.tools.appstats.StatsProtos$RequestStatProto$Builder cannot be cast to com.google.appengine.tools.appstats.StatsProtos$RequestStatProto$Builder
at com.google.appengine.tools.appstats.MemcacheWriter.write(MemcacheWriter.java:210)
at com.google.appengine.tools.appstats.Recorder.processRecordingFuture(Recorder.java:456)
at com.google.appengine.tools.appstats.Recorder.processAsyncRpc(Recorder.java:404)
at com.google.appengine.tools.appstats.RecordingFuture.maybeRecordStats(RecordingFuture.java:140)
at com.google.appengine.tools.appstats.RecordingFuture.get(RecordingFuture.java:110)
at com.google.appengine.tools.appstats.RecordingFuture.get(RecordingFuture.java:20)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
at com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:26)
at com.google.appengine.api.memcache.MemcacheServiceImpl.get(MemcacheServiceImpl.java:49)
The request was sent to the following URL so that the code is executed in backend.
http://localhost:52843/
The above request runs fine when sent to
http://localhost:8888/
Which is actually devserver.
Any clue what's wrong with it when run inside backend ? Also why there are two ports opened for backend 58251 and 58252
INFO : { JettyLogger info } - Started SelectChannelConnector#127.0.0.1:8888
INFO : { AbstractModule startup } - Module instance default is running at http://localhost:8888/
INFO : { AbstractModule startup } - The admin console is running at http://localhost:8888/_ah/admin
INFO : { JettyLogger info } - jetty-6.1.x
INFO : { ApiProxyLocalImpl log } - javax.servlet.ServletContext log: Initializing Spring FrameworkServlet 'dispatcher'
INFO : { JettyLogger info } - Started SelectChannelConnector#127.0.0.1:58251
INFO : { ServerWrapper startup } - server: -1.backend1 is running on port 58251
INFO : { JettyLogger info } - jetty-6.1.x
INFO : { ApiProxyLocalImpl log } - javax.servlet.ServletContext log: Initializing Spring FrameworkServlet 'dispatcher'
INFO : { JettyLogger info } - Started SelectChannelConnector#127.0.0.1:58252
INFO : { ServerWrapper startup } - server: 0.backend1 is running on port 58252
INFO : { DevAppServerImpl doStart } - Dev App Server is now running
UPDATE Looks like it was happening because I compiles with Jdk8. I came to know only after I deployed to cloud and it gave me version error. Still not sure why only backend was effected locally.

Categories

Resources