java-ee

joinTransaction has been called on a resource-local EntityManager in JBoss

点点圈 提交于 2019-12-12 04:37:09
问题 I have earlier worked with application-managed RESOURCE-LOCAL transaction but now I want to use container-managed JTA transaction. Everything seems to be ok while I am using @Stateless but as soon as I use @Stateful I get an exception as below javax.ejb.EJBException: javax.persistence.TransactionRequiredException: joinTransaction has been called on a resource-local EntityManager which is unable to register for a JTA transaction. I am using JBoss eap 6.2 with eclipselink2.5 and Java8 and

I need help figuring out why Ant is giving me this error messages(setting up Java Pet Store)?

ⅰ亾dé卋堺 提交于 2019-12-12 04:31:45
问题 I have no idea where ContainerBaCommand is coming from, but here's my error: I first had to add javax.jar (which has the servlet ) class into the C:\JEE6SDKglassfish3\glassfish\lib\endorsed directory, and it gave me a new error, here: Buildfile: C:\petstore~svn\trunk\ws\apps\petstore\build.xml check: tools: -pre-deploy: deploy: [exec] Deprecated syntax, instead use: [exec] asadmin --user admin --passwordfile c:/JEE6SDKglassfish3/glassfish/samples/bp-project/passwordfile --host localhost -

MyBatis CDI class loader issue in case of EAR

为君一笑 提交于 2019-12-12 04:31:27
问题 I have an EAR which at the moment contains only one WAR. My issue is if the mybatis-....jar files locate under web-module.war\WEB-INF\lib then everything works fine. BUT if I create a skinny war with maven and the two mybatis related jars locate under EAR/lib I get a " There are no SqlSessionFactory producers properly configured. " error. I seems that it is a classpath related issue. I am planning to add more WAR into my EAR and I would like to avoid the situation to put these two jars into

Liferay Service Builder failing

家住魔仙堡 提交于 2019-12-12 04:27:35
问题 I'm doing some tests on Liferay. For this, I'm following the MVC tutorial, and got stuck in the services stuff. I created a simple entity for testing purposes, "Miclase": public class Miclase { int id; int num1; String string1; } Pretty simple, huh. Well, after this, I started the service builder and created a file like this, with the Overview pane: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd

JPA lookups with arrays

孤街浪徒 提交于 2019-12-12 04:24:08
问题 I have an unidirectional relationship. Here i have Employee and Andress entities. In Employee entity i have the following code: @OneToOne(cascade=CascadeType.ALL) @JoinColumn(name = "HOME_ADDRESS") private Address homeAddress; I have an array of Adress objects and want to write a lookup that would return an array of Customer objects mapped to those adresses. select e from Employee e where e.homeAddress.id IN '?' I don't know what to do with the '?' part. Is the only option to loop over the

Disable @Alternative classes

a 夏天 提交于 2019-12-12 04:23:11
问题 In my Java EE 7 program, I want to use @Alternative to inject different implementation depending on the context, production or test for example. What I did is to declare my class annotated with @Alternative in my beans.xml file. It works great and my alternative class is injected wherever I want instead of the default one. But I don't know if there is a way to skip this behavior and inject the default class other than removing the declaration in the beans.xml file. Which is not possible

Matlab Java Interoperability

倖福魔咒の 提交于 2019-12-12 04:23:07
问题 Our web app acts as an integration layer which allows the users to run Matlab code (Matlab is a scientific programming language) which was compiled to Java, packaged up as jar files via browser (selected ones as in above image, except for remote_proxy-1.0.0.jar which is not, it is used for RMI). The problem is that, Matlab Java runtime, contained inside the javabuilder-1.0.0.jar file, has a process-wide blocking mechanism which means if the first user sends an HTTP request to execute the cdf

Storing trailing zeroes in database with JPA and Oracle

我与影子孤独终老i 提交于 2019-12-12 04:22:39
问题 I need to store prices in my database. I'm using JPA, so I've got a model like this: @Entity @Table(name="products") public class Product { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private long id; @Column(name="price") private float price; } The problem is that when I fill price form inputs with values like "4.20", on my Oracle database I get "4.2", losing the trailing zero. How can I solve this problem? EDIT: Since I'm using JPA, I have to avoid writing queries in native Oracle

Primefaces 3.0 DataTable inCell editing , RowEditEvent doesn't retrieve updated field

﹥>﹥吖頭↗ 提交于 2019-12-12 04:09:26
问题 I am working on a sample app with primefaces 3 , using datatables incell editing mode. Although when i edit , i see the event.getObjects gives me the object which is not modified. Changed the property of the object on debug mode, it does update. So i couldn't figure out why i cant get the edited property. Below are my eventlistener method and the xhtml; Any pointers are welcomed Thanks in advance EventListener public void editListener(RowEditEvent event){ System.out.println("EDIT LISTENER");

JPA class loading issue with Hibernate

巧了我就是萌 提交于 2019-12-12 03:59:53
问题 When I am attempting to fetch an entry from my database, the type returned from the EntityManager differs from the type specified in my code. They are both com.mycompany.Foo, but they have been instanciated with two different class loaders. I have found out that the class loader for the second type has repositories set to WEB-INF/classes/ with jarPath set to /WEB-INF/lib. This is all set up using JPA with Hibernate. persistence.xml: <persistence xmlns="http://java.sun.com/xml/ns/persistence"