I'm having exactly the same problem as this person:
https://groups.google.com/forum/#!topic/google-appengine-java/4y90M9NlWsA
but there are no responses and I can't see anything else on the internet that helps. Does anyone know why this would happen?
RemoteApiOptions options = new RemoteApiOptions()
.server("localhost", 8888)
.credentials("blah#blah.blah", "");
RemoteApiInstaller installer = new RemoteApiInstaller();
installer.install(options);
The stacktrace is:
Exception in thread "main" java.io.IOException: unexpected response from remote api: {rtok: null, app_id: MyCorrectAppId}
at com.google.appengine.tools.remoteapi.RemoteApiInstaller.getAppIdFromServer(RemoteApiInstaller.java:326)
at com.google.appengine.tools.remoteapi.RemoteApiInstaller.loginImpl(RemoteApiInstaller.java:278)
at com.google.appengine.tools.remoteapi.RemoteApiInstaller.login(RemoteApiInstaller.java:239)
at com.google.appengine.tools.remoteapi.RemoteApiInstaller.install(RemoteApiInstaller.java:106)
at uk.blah.blah.MyClass.main(MyClass.java:114)
I've noticed you've set the <application> element inside appengine-web.xml to MyCorrectAppId. That's the problem. As Eugene rightly pointed out, the ID must be all lowercase, like mycorrectappid. Quoting Dan Sanderson's book Programming Google App Engine:
Because the application ID is used in the domain name, an ID can contain only lowercase letters, numbers, or hyphens, and must be shorter than 32 characters. Additionally, Google reserves every Gmail username as an application ID that only the corresponding Gmail user can register.
If you are working in Eclipse, you need to remember that when setting up a new web application project (there is an option towards the bottom of the "New Web Application Project" dialogue that allows you to specify the ID instead of leaving it blank).
For a standalone environment, I think you're probably fine if you leave the ID blank (it will default to "no_app_id").
Hope that helps!
According to the code of the RemoteApiInstaller.getAppIdFromServer method the exception unexpected response from remote api can be thrown when no app_id property found in the response body. And it seems that in your case it is probable that MyCorrectAppId does not match the PAIR_REGEXP pattern, i.e. it contains any characters other than digits, letters in lower case, tilde, underscore or minus sign.
Related
I'm using Spring Boot 2.4.6. For delete APIs getting 405 method not found. My endpoint is like: beauty/v1/sites/addressTemplates/:templateId
Path variable: ##$%#
Can someone please suggest what can be done to make this behavior as not complaining for 405? Please direct me to other questions in case I'm missing something.
I guess that your issue has nothing to do with Spring. Maybe you are trying to compose the whole URL by using reserved characters.
In a URL, a hash mark, number sign, or pound sign ( # ) points a browser to a specific spot in a page or website. It is used to separate the URI of an object from a fragment identifier. Source.
Which means that an URL which looks like:
beauty/v1/sites/addressTemplates/##$%#
is not exactly what you imagine it to be because # is interpreted in a special way. What you have to do is to percent encode the "special" path variable so it will look like this at the end:
beauty/v1/sites/addressTemplates/%23%40%24%25%23
Then Spring will not complain anymore and will resolve properly the endpoint.
In NetBeans 8 running on JDK 8u25 When i was adding a Web Service Client. I inserted WSDL address, but the environment constantly returned "Problem with downloading wsdl(Web Service Description Language) or schema file", although it worked in other applications.
The problem is that the address contained underscores and the error is invoked by the IllegalArgumentException("Invalid characters in hostname") that was thrown by toLowerCase() method in java.net.HostPortrange.
toLowerCase() checks the characters of an address and if they are not within [a-z0-9A-Z.-] an exception is thrown even though also other characters are valid in URL.
Please provide me any idea for the resolution of this problem.
It's a bug in JDK 8 b177. It is fixed in b122 Please refer below link:
https://bugs.openjdk.java.net/browse/JDK-8029354
I wanted to use the Braintree Marketplace (I've got the approval and signed to use the marketplace functionality). I used JAVA for my backend and played with the Sandbox account.
I was trying to create a submerchant accorinding to the tutorials in the overview and the specific section. E.g., the code I directly copied from the guide is (I'VE ALSO TRIED TO USE MY VALID PERSONAL INFORMATION BELOW):
MerchantAccountRequest request = new MerchantAccountRequest().
individual().
firstName("Jane").
lastName("Doe").
email("jane#14ladders.com").
phone("5553334444").
dateOfBirth("1981-11-19").
ssn("456-45-4567").
address().
streetAddress("111 Main St").
locality("Chicago").
region("IL").
postalCode("60622").
done().
done().
funding().
descriptor("Blue Ladders").
destination(MerchantAccount.FundingDestination.BANK).
email("funding#blueladders.com").
mobilePhone("071101307").
accountNumber("1123581321").
routingNumber("071101307").
done().
tosAccepted(true).
masterMerchantAccountId("14ladders_marketplace").
id("blue_ladders_store");
Result<MerchantAccount> result = gateway.merchantAccount().create(request);
I've also tried to use the testing first name
com.braintreegateway.test.MerchantAccount.Approve
so that the creation should always succeed. The code snippet is:
Result<MerchantAccount> result = gateway.merchantAccount().create(
new MerchantAccountRequest().
individual()
.firstName(com.braintreegateway.test.MerchantAccount.Approve)
.done()
);
However, in any case, when I tried to check if the result is successful (and if not, what the errors are):
logger.info("Is the result successful? " + result.isSuccess());
ValidationErrors errors = result.getErrors();
logger.info("Number of errors returned " + result.getErrors().size());
The result.isSuccess() always returns false, while there are no errors in result.getErrors(). I also cannot find any (error) information from the sandbox web account. Any insights what might go wrong? or is this because I haven't enabled the marketplace functionality?
Thanks!
I work at Braintree. If you have more questions, you can always get in touch with our support team. It looks like you already have an open ticket with us and got a response, but I'll post his here for others who have the same problem.
You're looking for result.getErrors().getAllDeepValidationErrors() not just result.getErrors().
For more information on this type of failure, see the validation errors page in the Braintree docs.
EDIT: Code for InstallCerts is here:
http://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java
I am trying to run a java program in eclipse that takes a URL (eg https://myurl.com) as an argument. When I go to Run Configurations -> Arguments and paste in the URL, it looks fine. I click Apply.
The problem starts when I click Run. For some reason, eclipse removes the https: at the start of the URL and I get an error saying:
Exception in thread "main" java.lang.NumberFormatException: For input string: "//myurl.com"
Notice the lack of https:?
Anyway, if someone can point me in the right direction to resolve this, I'd be very grateful.
I should also point out, I tried to create a Variable as well, to hold the URL, but I got the same error. Likewise when I quoted the URL.
Thanks.
You are getting a "NumberFormatException" which means you are trying to convert a String to int in your code . I think thats the real problem.
Quote it.
"https://myurl.com"
EDIT : I just tried quote/unquote - it works either way. Can you post your code?
Cheers,Eugene
The trick is that class searches for port. Do not use https://, instead refer to secure port e.g. my.site.com:443!
I'm using Javamail to get the FROM address of a message.
The problem is I always get the following exception.
javax.mail.internet.AddressException: Local address contains control or whitespace in string ``ÇáÞÑíÉ ÇáÅáßÊÑæäíÉ''
another exception is like
javax.mail.internet.AddressException: Nested group in string ``.:DoWnLoAdiZ:.FiLMs <900000009#google.com>'' at position 12
How can I format the string before showing it and replace all those illegal white spaces,..etc ?
These are in messages you've received, right? They're almost certainly spam,
just throw them away. Spammers are notoriously bad about following internet
standards.
If you really want to try to read these messages, set the System property
"mail.mime.address.strict" to "false", as described in the javadocs for the
javax.mail.internet package.