jakarta-ee

Using TomEE and open JPA, i get the following error: SEVERE: JAVA AGENT NOT INSTALLED

末鹿安然 提交于 2021-02-19 07:45:08
问题 I'm getting the following error using TomEE and JPA: SEVERE: JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent. See http://openejb.apache.org/3.0/javaagent.html Is having a java agent required for openJPA to function properly? (Specifically is it needed for "openjpa.jdbc.SynchronizeMappings") If so, how do I install it properly in eclipse? 回答1: -javaagent:openejb-javaagent-3.0-beta-2.jar Add that to your VM

How to specify the EJB bean name in the JNDI tree in JEE7

送分小仙女□ 提交于 2021-02-19 05:20:28
问题 I'm not sure if this is a generic JEE6 question or if it is a Wildfly 10/JBoss7 EAP implementation specific question. I'm trying to specify/override the default beanName used in my EJB JNDI mapping to something more meaningful to me. For example: LoginManagerBean: @Stateless public class LoginManagerBean extends BaseManagerBean implements LoginManager { .... } LoginManager: @Local public interface LoginManager{ .... } In this context, WF10 will automatically create a JNDI mapping for this EJB

How to specify the EJB bean name in the JNDI tree in JEE7

社会主义新天地 提交于 2021-02-19 05:18:45
问题 I'm not sure if this is a generic JEE6 question or if it is a Wildfly 10/JBoss7 EAP implementation specific question. I'm trying to specify/override the default beanName used in my EJB JNDI mapping to something more meaningful to me. For example: LoginManagerBean: @Stateless public class LoginManagerBean extends BaseManagerBean implements LoginManager { .... } LoginManager: @Local public interface LoginManager{ .... } In this context, WF10 will automatically create a JNDI mapping for this EJB

What is the shortest, best, cleanest way to set a private field via Reflection in Java?

怎甘沉沦 提交于 2021-02-18 22:30:32
问题 Hi I've already worked with Reflection in Java. But if you are using the java standards (e.g. injecting a private field) you have to write a lot of code to get the job done. What is the shortest way to inject a private field in a Java Object? Are there implementations in widely used and production ready libraries? 回答1: Without using external libraries you need to: get the Field instance set the field instance as accessible set the new value As follow: Field f1 = obj.getClass()

Merge an entity, change its id, merge again, cause “mapped to a primary key column in the database. Updates are not allowed” error

百般思念 提交于 2021-02-18 05:20:44
问题 I have a JPA program where EclipseLink is the Persistence provider. When I merge an user entity, change its ID, and try to merge the same user instance again, an error is thrown. I rewrite my code to illustrate my problem in the simplest way. User user = userManager.find(1); userManager.merge(user); System.out.println("User is managed? "+userManager.contains(user); user.setId(2); userManager.merge(user); The above code is not in a transaction context. userManager is a stateless session bean

JSF: initial request and postback request?

こ雲淡風輕ζ 提交于 2021-02-17 09:38:12
问题 Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com: For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces

JSF: initial request and postback request?

扶醉桌前 提交于 2021-02-17 09:38:01
问题 Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com: For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces

Hibernate 5 - java.lang.NoSuchMethodError: javax.persistence.Table.indexes()

别来无恙 提交于 2021-02-10 12:04:41
问题 I'm trying to test some POJOs with hibernate annotations and I'm getting the same error on and on. I used the same configuration in another project and it all worked fine. I tested the jdbc connection that is used when the hib objects are tested - and the connction works fine. I have found a few other questions asked about the same error but nothing was helpful. The code in testing class with main method: public static void main(String[] args) { SessionFactory factory = new Configuration()

Why do we need jackson databind?

别来无恙 提交于 2021-02-10 11:57:59
问题 I am new in JAVA EE. My question is, why do we need jackson databind? Because We can receive the Request Params by @ModelAttribute and requests through http PUT or POST by @RequestBody . I can't find a reason why we need jackson databind to convert json/xml to POJO or vice versa. Thanks. 回答1: Why do we need jackson databind? Because representing structured data is much easier using XML (or JSON) than using simple name-value pairs. Because it is more convenient to send and receive JSON from

Why do we need jackson databind?

喜欢而已 提交于 2021-02-10 11:50:38
问题 I am new in JAVA EE. My question is, why do we need jackson databind? Because We can receive the Request Params by @ModelAttribute and requests through http PUT or POST by @RequestBody . I can't find a reason why we need jackson databind to convert json/xml to POJO or vice versa. Thanks. 回答1: Why do we need jackson databind? Because representing structured data is much easier using XML (or JSON) than using simple name-value pairs. Because it is more convenient to send and receive JSON from