java-ee-6

Java EE 6: controlling startup of managed beans with dependencies: CDI, EJB

守給你的承諾、 提交于 2020-01-11 09:29:11
问题 I just read the very nice explanation of the various managed beans and their relations on Java EE 6 @javax.annotation.ManagedBean vs. @javax.inject.Named vs. @javax.faces.ManagedBean and as i face a annoying problem in my application i want to know if it is possible to control or influence the way how and when beans are started. In my Java EE application I use EJB, CDI and JSF2 as view technology. Via SPI a service from a third party is booted and it configures a job executor which starts

JPA 2.0 (logging and tracing through) with Glassfish 3.0.1 and NetBeans 6.9.1:

我的未来我决定 提交于 2020-01-11 04:46:09
问题 I am using JPA 2.0 ( EclipseLink provider) with Glassfish v3.0.1 and NetBeans 6.9.1 and am NOT able to see the queries and other logging information from JPA 2.0. Essentially I want to be able to see all the SQL statements which are being generated by JPA and other related debugging information... Has anyone successfully been able to configure the logging to provide such feedback? I've tried several things to no avail... Any help would be greatly appreciated. Thanks much. 回答1: What eventually

Can't instantiate javax.servlet.ServletException

谁都会走 提交于 2020-01-10 01:14:07
问题 I am trying to create instance of class javax.servlet.ServletException with following code public class MyTroubleViewer { public static void main(String[] args) { javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello"); System.out.println(servletException.getMessage()); } } But I get exception on creating: Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet

what is the right path to refer a jar file in jpa persistence.xml in a web app?

两盒软妹~` 提交于 2020-01-08 17:15:21
问题 persistence.xml looks like this: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>jdbc/test</non-jta-data-source> <jar-file>../../lib/app-services-1.0.jar</jar-file> <exclude-unlisted-classes>false</exclude-unlisted-classes> </persistence-unit> It is a web project, so the deployment unit is a war file. The jar file I tried to refer is in WEB-INF/lib/ folder , persistence.xml is in WEB-INF

what is the right path to refer a jar file in jpa persistence.xml in a web app?

折月煮酒 提交于 2020-01-08 17:15:11
问题 persistence.xml looks like this: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <non-jta-data-source>jdbc/test</non-jta-data-source> <jar-file>../../lib/app-services-1.0.jar</jar-file> <exclude-unlisted-classes>false</exclude-unlisted-classes> </persistence-unit> It is a web project, so the deployment unit is a war file. The jar file I tried to refer is in WEB-INF/lib/ folder , persistence.xml is in WEB-INF

Why can't I get ViewScope to work? Throws errors every time

天涯浪子 提交于 2020-01-07 03:12:15
问题 Ok I'm trying to do something real simple. Just to note this works fine with SessionScope. I have a datatable and when I select a row it needs to update a form that a user could edit. Every time I try and fire the row selector it comes back with this. SEVERE: Error Rendering View[/index.xhtml] java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2867) at org.apache.catalina

EJB3.1 Timer cancel issue

三世轮回 提交于 2020-01-06 03:58:25
问题 I have a problem with EJB3.1 Timer service. I find this issue quite strange! I have a stateless session bean like below deployed on JBoss7.1.1 application server. import javax.annotation.Resource; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.ejb.Timeout; import javax.ejb.Timer; import javax.ejb.TimerService; import javax.interceptor.Interceptors; @Stateless @Local(HelloUserLocal.class) @Remote(HelloUserRemote.class) public class HelloUserBean

Create an “Application Client” with Maven in Java EE

断了今生、忘了曾经 提交于 2020-01-06 03:41:07
问题 I am trying to create a maven based Enterprise Application with an Application Client which runs in the Application Client Container from GlassFish. It should fit togheter as the Project template from Netbeans "Enterprise Application" + "Enterprise Application Client" but with maven and not ant. Until now I have following projects Assembly Maven Project EAR-Module EJB-Module WEB-Module (works well with inside the ear) Swing Client Module The Assembly pom.xml looks like: <project xml...

How to put JSF provided by JBoss AS7 on the classpath of a JAR module?

我怕爱的太早我们不能终老 提交于 2020-01-05 08:23:34
问题 Overview : I have a JEE6 project that uses Apache Maven as the build system. My project produces an EAR that contains some common JARs, some EJB modules and a WAR. The produced EAR should be deployed to JBoss AS 7 (7.1.1 for now). Best practices : If you have a web-application (like mine) and the classes for the webapp (managed beans) might be reused in other projects, it is the recommended way ( the maven way ) to package these classes into a separate JAR and make the WAR depend on this JAR.

javax.ejb.EJBException java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName

一个人想着一个人 提交于 2020-01-02 20:13:13
问题 I'm working on a JavaEE application with EJB. I have an Entity called Medico which code is: @Entity public class Medico implements Serializable{ /** * */ private static final long serialVersionUID = 1L; /** * */ public Medico(String nome_medico, String morada_medico, String esp, GregorianCalendar dnasc_medico, int tel_medico) { //construtor parametrico super(); this.nome_medico = nome_medico; this.morada_medico = morada_medico; this.esp = esp; this.dnasc_medico = dnasc_medico; this.tel_medico