tomee

java.lang.IllegalAccessError while trying to test a jersey REST webservice deployed on TomEE

给你一囗甜甜゛ 提交于 2019-12-18 06:53:52
问题 I have a Jersey-based REST webservice which is working fine when deployed on Glassfish. When I deploy the same war file on Apache TomEE+ 1.6 version, i get the exception java.lang.IllegalAccessError: tried to access method com.sun.jersey.core.reflection.ReflectionHelper.getContextClassLoader()Ljava/lang/ClassLoader; from class com.sun.jersey.spi.scanning.AnnotationScannerListener com.sun.jersey.spi.scanning.AnnotationScannerListener.<init>(AnnotationScannerListener.java:89) com.sun.jersey.spi

How to avoid stalled DB connections with TomEE's JDBC connection pool?

大兔子大兔子 提交于 2019-12-14 01:50:25
问题 I'm creating a JSF web app on TomEE1.7.2 (over tomcat7, javaEE6). I have JDBC to mysql5.6.23 connection setting which look like below, and it is working just good, for only some hours. My data access super class: public class BaseDao { @javax.ejb.EJB MyEnvironmentService env; @javax.persistence.PersistenceContext(unitName = "persistence-unit-stg") protected javax.persistence.EntityManager em_stg; @javax.persistence.PersistenceContext(unitName = "persistence-unit-prd") protected javax

Conflict between Omnifaces cdi param and JSF 2.3

梦想的初衷 提交于 2019-12-13 18:15:20
问题 My web app encountered a problem with Omnifaces cdi param after upgrading the server from tomee plume 7 to tomee plume 8. I tested with a bare bone webapp and confirmed this. My bean: @javax.faces.view.ViewScoped @javax.inject.Named public class Bean2 implements java.io.Serializable { @javax.inject.Inject @org.omnifaces.cdi.Param private String tag; private String tag2; @javax.annotation.PostConstruct public void init() { if (getTag() == null || getTag().length()==0) { setTag2("None injected"

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

JSF2.0 Some facesmessages not sent to redirected page on error handling

拥有回忆 提交于 2019-12-13 02:15:43
问题 I'm building a JSF2.0 application on TomEE1.7.3, and I've created a custom ExceptionHander, and overrided handle() method, which looks like below: @Override public void handle() { for (Iterator<ExceptionQueuedEvent> it = getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();) { ExceptionQueuedEventContext eventContext = it.next().getContext(); FacesContext facesContext = eventContext.getContext(); ExternalContext externalContext = facesContext.getExternalContext(); Throwable throwable

How to make Concurrency utilities (JSR 236) work in plain non-EE Tomcat 8?

守給你的承諾、 提交于 2019-12-12 12:13:25
问题 My technical stack includes Tomcat 8.5.47 (plain, not EE) Weld 2.4.8.Final (as a reference implementation of CDI 1.2) To be able to use ManagedExecutorService and manage threads more wisely and in a safer manner, I would like to include this dependency org.glassfis:javax.enterprise.concurrent (as a reference implementation of JSR 236 [Concurrency Utilities]) I tried to inject the bean in different ways and into differently-scoped beans (view-, session-, application-based). @Inject private

Tomee error: javax.persistence.JoinColumn.foreignKey()

为君一笑 提交于 2019-12-12 03:52:03
问题 I was building my first webapp. I am using hibernate, postgresql, and tomee as container. I am using beans and faces. When i try to run my webapp on my tomee localhost everything works as expected. When i load it on my AWS (wich has the same version of tomee installed) i get this error. I'm stick since hours without getting at the solution. Here is my catalina.out May 26, 2016 4:18:24 AM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing

Insert the contents of one file into another file before the line that matches a regular expression

对着背影说爱祢 提交于 2019-12-12 03:38:59
问题 In a DockerFile, I'm starting with a TomEE base image. I need to modify the "conf/tomee.xml" to add a DataSource resource. I've stored the DataSource definition in a separate file. I want to find the "" end tag and insert the DataSource definition before that line. I found this SO posting, which seems to be what I need, but for some reason this just isn't replacing the contents of the original file. I tried piping the result to the file, but that results in a zero-length file (as if it's

JSON output of JavaEE Entity with TomEE server

心不动则不痛 提交于 2019-12-12 03:28:40
问题 I try to make output of my Entity Flight, which have OneToOne relationship with my other Entity Airplane. Before I add airplaneDetail field in my Flight Entity the result was perfect, but I after that I get empty result and Eclipse start throwing exceptions in gson. My Flight class : @Entity @NamedQueries({ @NamedQuery(name = "Flight.getAll", query = "SELECT f FROM Flight f"), }) @NamedQuery(name = "Flight.getByDestination", query = "SELECT f FROM Flight f WHERE f.destinationFrom=

TomEE deploy failed datasource not found

吃可爱长大的小学妹 提交于 2019-12-12 03:22:43
问题 I want to deploy a war file to TomEE but fails with: Caused by: javax.naming.NameNotFoundException: Name openejb/Resource/application_name/mysql_ds" not found. If I restart the server, the deploy goes fine but only once, then the same error encounters. I have defined datasource in WEB-INF/resources.xml file <tomee> <Resource id="mysql_ds" type="javax.sql.DataSource"> JdbcDriver = com.mysql.jdbc.Driver JdbcUrl = jdbc:mysql://IP:3306/db?serverTimezone=UTC&autoReconnect=true UserName = user