Jenkins does not start properly after reboot on GCE
If I need to restart Jenkins due to installing a plugin for instance the slaves are never turned on. I am using Google Compute Engine. I followed this...
View ArticleWhen to use a "has_many :through" relation in Rails?
I am trying to understand what has_many :through is and when to use it (and how). However, I am not getting it. I am reading Beginning Rails 3 and I tried Googling, but I am not able to understand.
View ArticleMultipleBagFetchException thrown by Hibernate
I want to have an option in my repository layer to eager load entites, so I tried adding a method that should eager load a question entity with all the relationships, but it throws...
View ArticleWhy do we use a DataSource instead of a DriverManager?
I am reading the Java JDBC specification (vr. 4) and I encountred this statement:DataSource — this interface was introduced in the JDBC 2.0 Optional Package API. It is preferred over DriverManager...
View ArticleDocker: Multiple Dockerfiles in project
How do you organize the Dockerfiles belonging to a project when you have one Dockerfile for the database, one for the application server, and so on? Do you create some sort of hierachy in the source?A...
View ArticleMargin/padding in GridBagLayout Java
Is it possible to set an margin/padding in GridBagLayout for the whole row/column? I use the inset on the constraints-object however, using this approach I need to set padding from bottom on every...
View ArticleUsing Spring MVC Test to unit test multipart POST request
I have the following request handler for saving autos. I have verified that this works when I use e.g. cURL. Now I want to unit test the method with Spring MVC Test. I have tried to use the...
View ArticleHow does apply-templates work?
I have just started learning XSL(T) and I wonder how apply-templates work? I do not understand the recursively applies templates part of it as it is written in my book.I understand the XPath-part of...
View ArticleDifference between one-to-one and one-to-many relationship in a database
When having a one-to-one relationship in a database the other table has a foreign key ID (in this example). And in a one-to-many relationship the table contains many foreign keys.But does the database...
View ArticleWhat is an index in Elasticsearch
What is an index in Elasticsearch? Does one application have multiple indexes or just one?Let's say you built a system for some car manufacturer. It deals with people, cars, spare parts, etc. Do you...
View ArticleHow to POST JSON and a file to web service with Angular?
How do I send a POST request with AngularJS? The JSON part is required but the file is not. I have tried this based on other blog posts but it does not work. I get a Bad request 400 error.var test = {...
View ArticleEqual height of UICollectionViewCell's and UICollectionView
How am I supposed to set the height of the cells in UICollectionView equal to the height of whatever the collection view is? The code below doesn't work because the collection views height is not known...
View ArticleShould I use @EJB or @Inject
I have found this question: What is the difference between @Inject and @EJB but I did not get any wiser. I have not done Java EE before nor do I have experience with dependency injection so I do not...
View ArticleHow to get URL for application's document directory iPhone
This code is a part of Core Data. The URLsForDirectory....method does not run on iOS < 4 so I need to know some other methods/objects to call. I would also appriciate documentation for future...
View ArticleWhat are "connecting characters" in Java identifiers?
I am reading for SCJP and I have a question regarding this line:Identifiers must start with a letter, a currency character ($), or a connecting character such as the underscore ( _ ). Identifiers...
View ArticleWhere is my app placed when deploying to Tomcat using IntelliJ IDEA?
I am deploying an application from IntelliJ IDEA to the local Tomcat server. I thought the apps you deploy are placed in the webapps folder, however it does not turn up there.Is this correct? Where is it?
View ArticleProblems with making a query when using Enum in entity
I have the following in a Question entity:@NamedQuery(name = "Question.allApproved", query = "SELECT q FROM Question q WHERE q.status = 'APPROVED'")and@Enumerated(EnumType.STRING)private Status...
View Article