Instantly share code, notes, and snippets.

What would you like to do?

Ask questions and see you at November, 5th, 6.PM. CET:

Also checkout recent episode:


Please keep the questions Java EE-stic. Means: as short and as concise as only possible.


This comment has been minimized.

Zodzie commented Oct 6, 2018

Hi Adam! Thanks for hosting an opportunity for questions.

I am thinking about the best way for me to store secrets for my Java ServerSocket app, with the only non-standard lib I'd like to depend on is javax.json.

With regard to storing secrets, I was thinking about encrypting the string using openssl, storing the encrypted string as a resource packed in the jar, and decrypting by providing the private key like so:
/bin/openssl rsautl -inkey ../../key.txt -decrypt < ../../password

But then I'm wondering how to store the private key and so forth...

Can you please offer some advice or best method to handle these types of secrets?


This comment has been minimized.

vanuatoo commented Oct 7, 2018

Objective is to prevent other transaction insert a row in a table during another transaction is manipulating on the data.
With JDBC you can use Connection.setTransactionIsolation(TRANSACTION_SERIALIZABLE) to lock the table.
How can you achieve the same effect with JPA? Even if you use Pessimistic Write it locks the object (row in a table) not the whole table.


This comment has been minimized.

kret11 commented Oct 8, 2018

How to implement data internationalization for rest api javaee server? i mean something like cms backend


This comment has been minimized.

tnsasse commented Oct 11, 2018

You develop an application like GitHub that is hosted on the cloud. You would like to offer an on-premise Version like GitHub Enterprise for premium clients. What’s the best way to ensure that users have a valid license and remain in the negotiated constraints, like number of servers / users?


This comment has been minimized.

noherczeg commented Oct 17, 2018

Hello Adam,

You've been talking about using the platform for web applications without frameworks. I find this a really nice way to go but I have a few questions regarding how is it achievable in a production ready way.

So my questions are:

  • what about uglifying sources?
  • cache busting suffixes?
  • concatenation where there is no HTTP2 support?

Thank you,


This comment has been minimized.

dempile commented Oct 17, 2018

Hi Adam

  • If we consider a context of large application with a thousands of users and alot of forms, is it more suitable from performance perspective to use JSF ( primefaces ) or using one of the frontend javascript based frameworks like React, Angular or even WebStandart.?

  • If we use React or Angular what do you suggest , server side rendring , or client side rendring ?
    I have seen a project of a java EE CRUD operations where the JSF page is related to a CDI Bean (@nAmed) which uses a Rest service that invokes an EJB. Is this a good architecture for JSF. I would like to know if it will benefits with the performance like in the of frontend apps.

  • Drools is a business rule management system , can we use it to make a system where rule are outsite of the running application in order to be changed from the user of the application without touching the code or reduilding the system , ( like in the case of pay formula )


This comment has been minimized.

jumarome commented Oct 19, 2018

Hi Adam,

  • how do you see the future of GraphQL? do you think it could be the new standard for development of web API's?

  • I have to develop a new app for a company in which I will be the only developer, I already know JSF ,JEE and also javascript but I'm new in the world of webcomponents and SPA, based on that and in the fact that time is not a contraint, should I go with jsf or with web standards and web components? what criteria should I consider?



This comment has been minimized.

sebargarcia commented Oct 19, 2018

HI Adam, I read your blog post about EJB wiht or wihtout CDI
Now with JavaEE 8 do you think we still need EJBs ? In terms of scalability, What scale better? CDIs Beans with @transactional methods or EJBs (with the container EJB pool) ?
Thanks in advance.


This comment has been minimized.

robertBrem commented Oct 20, 2018

Hy Adam

  • I really like the direction in which is going. Do you know if there is a site/table that shows which feature is implemented in which application server?
  • I’ve problems to use lit-html with Edge. Have you tried it with Edge? Do I need some polyfills? I’ve already shadow-dom and web-components polyfills in place.
  • How do you write your Jenkinsfile? What I've seen so far there are two different approaches:
    Everything is configured over attributes, there are no stages to configure by yourself. Everything is done in the library.
library "build"

standardBuild {
  … a lot more ...

In the second approach I try to abstract as much boilerplate code as I can in a library but try to give full control to the team that edits the Jenkinsfile directly in the application/service repository. For example all the proxy configuration and the settings.xml with the Nexus credentials are hidden in the library but the team can use it with mvn(‘clean build’).

node('mypod') {
                            logRotator(artifactDaysToKeepStr: '',
                                    artifactNumToKeepStr: '',
                                    daysToKeepStr: '',
                                    numToKeepStr: '30'

            stage('checkout & unit tests & build') {
                git url: ''
                mvn('clean package')
                junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml'

            stage('vulnerability check for java libraries') {

            stage('build image & git tag & docker push') {
                env.VERSION = semanticReleasing()
                currentBuild.displayName = env.VERSION

I personally think the first approach contains too much magic and the implementation contains of too much if-else-statements.

The second approach is more like reusable methods, no endless blocks of if-else statements. You can also see the visualized stages from the Jenkins UI directly in your Jenkinsfile to adapt the pipeline.

In most projects I’m coming they are using the first approach, but the team is not happy. They don’t know what to do and start copy pasting the implementation of the library because they are afraid the changes will break the existing pipelines.

Do I miss something? Why do unconnected good companies/teams do the first approach?

Sorry for the long question!

Thanks and see you again in December :-)


This comment has been minimized.

mehaouihoussem commented Oct 20, 2018

Hi Adam

  • What do you prefer , Hibernate or EclipseLink as a JPA Vendor? , and which one of them you use in your production apps ?
  • Why most of European companies use Spring framework instead of Java EE, because they look for Spring developers and not for Java EE ?

This comment has been minimized.

VAGGELIS commented Oct 20, 2018

Hi Adam

I'm working on a project where we have too many relationship with a main jpa entity. Let's say entity A, which has @OneToMany and @manytoone relationship whith 10 other different entities. But this way the project is tiglhy coupled.
We are trying to find a way to separate code. Maybe by splittin the server side app in microservices. Or simpler by splitting server side code in different jars packaged all of them to one ear or war(i checked your plugin implementation in jee )

If we want to pass a feature in another microservice or jar and want to gve the posibbility of producing different packages of our app with more or less features included , and if there is an entity which is tiglhy coupled with @OneToMany with the A @entity this could not happen.

How to handle with this problem?



This comment has been minimized.

dennysq commented Oct 24, 2018

Hi Adam, Could you give your opinion? If I want to migrate a JSF application in the future, should I use an existing frameworks, like vue.js?, or Do I use web components?, Which one could be more cost-benefit better in a long term period?

What do you think about RxJava, Is this similar to the non blocking architecture of node.js? Is this better than use @asynchronous annotations? Is this compatible with a JEE application at specification level (compliance)?


This comment has been minimized.

robert-niestroj commented Oct 26, 2018

Regarding Apache POI in JavaEE. In you say that you make a docker base image, put POI there and all microservices rely on this base image.
Do you mean by that, that you put POI jar's in for example WildFly in a jboss module (\modules\system\layers\base\org\apache\poi), reference this module in jboss-deployment-structre.xml and in pom.xml use POI as <scope>provided</scope>?


This comment has been minimized.

orlovskyjavaprofi commented Oct 31, 2018

Hi Adam, i would like to know you opinion about the IBM-RedHat merging in regards to Java EE ecosystem, i mean we have now Jakarta EE and the specs of "new" framework are not set It is even more interesting , because some of my clients expressed a concern about further support of legacy Java EE based projects, i know that first version of Jakarta EE would be backwards compatible with Java EE8 , but what will happen after that? I saw the discussion on google mailing list and majority of people wish to drop some old technology (EJB, JMS) in favor of new solutions, so what is your take on this problem? My current best advise to the clients basically will be just to get active and raise some concerns in Jakarta EE Specification Process in eclipse community.


This comment has been minimized.

omega09 commented Nov 5, 2018

Hi Adam,

  1. If an exception/error occurs in a JAX-RS method on the server, the stack trace is returned to the client. The client shouldn't see these details. How to prevent it?

  2. I am using an H2 in-memory database during development for my JPA entities (Wildfly default I think). How can I view the tables during runtime? Anything that integrates with Eclipse?


This comment has been minimized.

UlrichCech commented Nov 5, 2018

Hi Adam,

I have a short question for the BCE-structuring with multiple implementations of a given "domain-aspect". Given the case, there is a payment-feature in an application. And the payment can be performed via different payment-providers.
So, basically, I would have:
/business/payment/ [b/c/e] but inside, I will have PaymentProviderA, PaymentProviderB and so on. All payment-provider should behave the same, so there is an "AbstractPaymentController", so that the concrete PaymentControllers only need to implement there specific API-implementation of the specific PaymentProvider.

Would it be correct to structure the packages as following, or do you have a better idea:


Thank you very much in advance from Hamburg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment