PersistenceContext EntityManager injection NullPointerException

An entity manager can only be injected in classes running inside a transaction. In other words, it can only be injected in a EJB. Other classe must use an EntityManagerFactory to create and destroy an EntityManager. Since your TestService is not an EJB, the annotation @PersistenceContext is simply ignored. Not only that, in JavaEE 5, … Read more

Weblogic or JBoss? [closed]

I suspect the reason Weblogic gets chosen is a pleasant sales person comes to visit a manager with money to spend, gives him the sales pitch and hey-presto, the company is using Weblogic. I don’t know if the JBoss support contract comes with a sales force, but would be surprised if it did and that … Read more

Keycloak retrieve custom attributes to KeycloakPrincipal

To add custom attributes you need to do three things: Add attributes to admin console Add claim mapping Access claims The first one is explained pretty good here: https://www.keycloak.org/docs/latest/server_admin/index.html#user-attributes Add claim mapping: Open the admin console of your realm. Go to Clients and open your client This only works for Settings > Access Type confidential … Read more

Hot deploy on JBoss – how do I make JBoss “see” the change?

I had the same problem in my bundle: (Eclipse IDE + JBoss server adapter) + JBoss AS 7.0.1 (community project). My solution is very simple – you should go to JBoss administrative panel (by default localhost:9990), there in profile settings open Core – Deployment Scanners. Turn on Autodeploy-Exploded (set to true), and by your wishes … Read more

Difference between standalone.xml and standalone-full.xml

standalone.xml: Support of Java EE Web-Profile plus some extensions like RESTFul Web Services and support for EJB3 remote invocations standalone-full.xml: Support of Java EE Full-Profile and all server capabilities without clustering standalone-ha.xml: Default profile with clustering capabilities standalone-full-ha.xml: Full profile with clustering capabilities Answer taken from: The Differences Between JBoss EAP 5 and EAP 6

How to enable TLS 1.2 in Java 7

There are many suggestions but I found two of them most common. Re. JAVA_OPTS I first tried export JAVA_OPTS=”-Dhttps.protocols=SSLv3,TLSv1,TLSv1.1,TLSv1.2″ on command line before startup of program but it didn’t work for me. Re. constructor Then I added the following code in the startup class constructor and it worked for me. try { SSLContext ctx = … Read more

How do you specify the root context in your tags in web.xml?

This can’t be done in an appserver agnostic way. Context root isn’t part of the standard web.xml file. It’s either specified when you deploy the app or in an appserver specific descriptor. Glassfish: sun-web.xml; JBoss: jboss-web.xml; Weblogic: weblogic.xml; Tomcat: context.xml; WebSphere: ibm-web-ext.xml. Note: the above applies to deploying WAR files. EAR files are a different … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)