I wanted a place where I can post technical articles only. This is the place to find out my tips and tricks for being a Java web applications developer. I hope it helps you.
This could be due to the fact that JUnit itself brings along its own version of Hamcrest as a transitive dependency. Now if you would be using JUnit 4.11 it would depending on Hamcrest 1.3 already – see here. Getting above error would be weird – since the describeMismatch method is present in org.hamcrest.Matcher interface. --Ted Vinke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is extremely discouraging that BOTH Junit and Mockito would embed hidden transitive dependencies that are almost impossible to find without looking into the contents of the jars in the classpath.
I wanted a way to filter generally without using Lambda or Java 8.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
determine current filesystem location of executed class from the code of this class, in runtime, given that it's executed using java command?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CORS is the ability to allow cross domains scripting. This can be important if you say want to host your website on S3 and have those pages access web services in EC2. I spent TONS of time trying to find how to configure AngularJS to use CORS and what I generally saw was people saying...
"You need to configure the server side for access control, not the client."
Well that's not entirely true.
The example I am using is based on the Spring, Jersey, run-as-ajar example you can find on GitHub. So lets start with the server side then:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is the basic log4j configuration I use with all the basics. Hope this helps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I hate face2face interview problems. I am horrible at them. I need the mental space of the IDE to work out the problem and think about it, something I dont do well in interviews.
Ah the classic interview question. Recurse Binary Trees. I don't know why they just love to give this one but I have some time off so I thought I would solve it. This is for a github project where I will point interviewers at so maybe they will just believe I can do this stuff.
The key to this is to check the other node in the recursion of the find or it will go down the right or left leg and get lost. There are some good Data Structures articles on BTS that I used to come to this solution. Here you go:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have been having all kinds of problems figuring out how to use SSL with AWS Load balancers in a way that keeps users from being redirected in weird ways that look like the site has problems or dropping them out of SSL. The only way I have found that lets you do SSL without being a complete expert is to install the cert on a load balancer and then proxy to port 80. This can have some unexpected outcomes *(see bottom section) Really would appreciate help configuring either my load balancer, domain records, or the apache2 server to make this behave more professionally.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failed to upload SSL certificate: java.lang.ClassCastException: org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMKeyPair
Private Key:* Use a text editor and copy the contents of mysite_com_pem.key
Public Key Certificate:* Use a text editor and copy the contents of mysite_com.crt
Successfully created load balancer
Load balancer mysitecom-lb was successfully created.Note: It may take a few minutes for your instances to become active in the new load balancer.
Modify Host Records
@ https://www.mysite.com Record Type: URL Redirect www mysite-lb-1551430537.us-east-1.elb.amazonaws.com. Record Type: CName
Problems with this approach
https://www.mysite.com is properly certified and encrypted (not a problem)
There is no cert for the named domain https://mysite.com, in fact DNS doesnt know how to resolve to ssl version of the naked domain at all.
The non naked version of http://mysite.com does redirect to https://www.mysite.com, while it is good that it redirects to an encrypted version it would be better if it redirected to the SSL based naked domain of https://mysite.com
http://www.mysite.com/ does not redirect, it should redirect to https://www.mysite.com/