tomee-7

TomEE CDI @Inject NullPointerException

家住魔仙堡 提交于 2021-02-17 02:14:11
问题 I'm trying to get CDI to work in my application, but I only get NullPointerExceptions when I do. When normally instantiating the playlistService, it works perfectly fine, but when I try to use CDI, it doesn't anymore. The server is able to start, but when I add beans.xml to META-INF/ and WEB-INF/ it's also not able to start anymore. PlaylistRESTController.java import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.*; import javax.ws.rs.core.*; @Path("/api

NoClassDefFoundError: javax/faces/component/UIViewAction on TomEE startup

随声附和 提交于 2020-01-06 01:58:08
问题 I'm trying to migrate a web project (all JARs in WEB-INF/lib ) to a maven web project (all JARs in pom.xml ). This project uses following libraries: JSF 2.2 PrimeFaces BootsFaces OmniFaces It runs on TomEE. The following error appears on TomEE startup: NoClassDefFoundError: javax/faces/component/UIViewAction But JSF2 library is provided by TomEE on classpath. Here is my pom.xml . <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

Why Entitys uninitialized collection is initialized automatically only for Entities persisted before current transaction?

醉酒当歌 提交于 2019-12-25 08:53:50
问题 (Please feel free to edit the title after reading this question) I have quite simple @ManyToOne bidirectional mapping between entities Parent and Child . The list of children Collection<Child> children in Parent is never initialized so it should be null . When using EntityManager.find(...) for previously persisted Parent and then getting the list from that Parent gives ArrayList even there are no children yet with this Parent and it is fine. However if persisting or merging a new Parent in

p:datatable filter: cannot validate component with empty value

吃可爱长大的小学妹 提交于 2019-12-20 06:15:31
问题 Is there a way to filter a p:datatable column by clicking on the text inside and making this text the filter ? In other words, if I click on a session ID, I would like the datatable to filter this column by the clicked ID, as if I had entered it manually in the filter above ? I am using Primefaces 6 UPDATE This is my complete Datatable with the suggested solution: <p:dataTable id="tablealltx" var="transaction" value="#{pastTxModel.txList}" paginator="true" rows="20" sortBy="#{transaction

tomee - how to use RESOURCE_LOCAL datasource

吃可爱长大的小学妹 提交于 2019-12-13 04:28:47
问题 I have some classes (ejb, webservices, mdb, etc..) that can use JTA. For some classes I need RESOURCE_LOCAL (can't be injected). However I can't get tomee to reference the jndi name of RESOURCE_LOCAL . How do you setup tomee and RESOURCE_LOCAL ? I can't seem to find one good example online, I would prefer not to put any usernames and passwords in my persistence.xml file. tomee.xml has this: <Resource id="MYDS" type="DataSource"> JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://127.0.0.1

Remote EJB lookup using OpenEJB in Tomee

六眼飞鱼酱① 提交于 2019-12-12 04:44:19
问题 Am trying to use example given here http://openejb.apache.org/hello-world.html With OpenEJB I am able to output HelloWorld I am trying same in Apache Tomee I have Remote EJB bean like this @Remote public interface Hello{ public String sayHello(); } @Stateless public class HelloBean implements Hello{ public String sayHello(){ return "Hello World!!!!"; } } packed it in a jar jar cvf hello.jar org Deployed on Apache Tomee Tomee Log after deploying hello.jar 03-Oct-2017 15:55:51.778 INFO

java.lang.ClassNotFoundException: javax.ws.rs.ext.MessageBodyReader in Apache TomEE when trying to use Jackson instead of Johnzon as JSON provider

二次信任 提交于 2019-12-11 16:04:37
问题 Starting from my original problem, I get that I need to specifically configure Apache TomEE to use Jackson as JSON provider (instead of the default Johnzon). I imported the following in my pom.xml <dependency> <!-- I only need this first one because otherwise it's ommited due to a conflict.... --> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.9.9</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId

How to use Jackson as JSON provider for JAX-RS-Client instead of Johnzon in TomEE 7?

喜夏-厌秋 提交于 2019-12-07 11:40:32
问题 I use TomEE 7.0.1 with Jackson 2 as JAX-RS JSON provider (configured in openejb-jar.xml ). Posting json to jax-rs services works perfectly well and uses the jackson annotations. But using JAX-RS client (or cxf webclient) always uses Johnzon even if I provide Jackson to the Webclient.create method. After some debugging I am sure that TomEE adds Johnzon to the client factory somehow and no other message body parser for json can be used. Is this a bug with the TomEE CXF integration or do I miss

How to use Jackson as JSON provider for JAX-RS-Client instead of Johnzon in TomEE 7?

被刻印的时光 ゝ 提交于 2019-12-05 17:01:47
I use TomEE 7.0.1 with Jackson 2 as JAX-RS JSON provider (configured in openejb-jar.xml ). Posting json to jax-rs services works perfectly well and uses the jackson annotations. But using JAX-RS client (or cxf webclient) always uses Johnzon even if I provide Jackson to the Webclient.create method. After some debugging I am sure that TomEE adds Johnzon to the client factory somehow and no other message body parser for json can be used. Is this a bug with the TomEE CXF integration or do I miss something? Romain Manni-Bucau Johnzon is registered on the bus by default to have a default JSON