java-ee-6

Does ProGuard work with JavaEE 6 applications?

我是研究僧i 提交于 2019-12-04 12:15:24
I'm trying to get Proguard to obfuscate a simple .war file. According to the docs Proguard handles .war files, but when I try I get this: Warning: class [WEB-INF/classes/com/corp/gr/t2b/T2BChannel.class] unexpectedly contains class [com.corp.gr.t2b.T2BChannel] The docs mention something about Proguard not liking .war files with classes in the WEB-INF/classes directory. So I put all the .class files in their own .jar file in WEB-INF/lib. Then Proguard complains that it cannot find any of the JavaEE 6 classes, even though I've given it the javaee.jar file with -libraryjars C:/bin/glassfish-3.0.1

what is meant by context in CDI?

你说的曾经没有我的故事 提交于 2019-12-04 12:09:15
I am new to CDI. While reading, I am always encountering contextual objects, non contextual objects. What does they mean? For example the below link http://docs.jboss.org/weld/reference/latest/en-US/html/beanscdi.html#d0e881 Message-driven and entity beans are by nature non-contextual objects and may not be injected into other objects The context of a CDI framework is basically a big map of objects*. You can add objects to the context or make the CDI framework create objects from your service classes by using any CDI configuration method (spring xml beans/annotations like @Component/@Service).

Startup bean not called

纵饮孤独 提交于 2019-12-04 12:05:20
问题 I created a Java Web Application Project in NetBeans, and created a startup bean in it: package malibu.util; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ejb.LocalBean; @Stateless @LocalBean @javax.ejb.Startup public class Startup { @EJB private ProviderEJB providerEJB; @PostConstruct public void onStartup() { System.err.println("Initialization success."); } } But the code is not called after I deploy the application. What can cause

How to layout Java EE projects using common JPA entities?

微笑、不失礼 提交于 2019-12-04 11:46:07
I have two eclipse Java EE 6 projects packaged in a WAR-file using maven 3. Now they should share JPA entities in a 3rd project among them, since they both use the same database. When doing the research for my question, I found some hints mentioning for example a reference in a persistence.xml to a common jar, but I wasn't successful to make it work. So specifically asked: 1) Does the project, containing the common entities, has a persistence.xml file? If so, how does it differ from the one in the other projects? 2) How exactly are the commonly used entities referenced in the two projects? Do

EJB3.1 System Exceptions vs javax.ejb.EJBException

落花浮王杯 提交于 2019-12-04 11:44:42
问题 Just a bit of background on EJB3.1 exceptions before bringing up my question - Application exceptions comprise of User defined checked or unchecked exceptions which have @ApplicationException annotation All checked exceptions java.lang.Exception & it's subclass exceptions except java.rmi.RemoteException & it's subclass exceptions System exceptions comprise of java.rmi.RemoteException and it's subclass exceptions All unchecked exceptions java.lang.RuntimeException and it's subclass exceptions

Hold session in stateful EJB 3.1 bean?

不羁岁月 提交于 2019-12-04 11:35:39
问题 I'm working on a Java webapp trying to combine the following technologies: Java EE 6 CDI JSF 2 EJB 3.1 Spring Security I provide CDI-based backing beans (@ViewScoped, @Named) for my JSF pages. I use @Stateless EJB beans for the actual work to be done. I only need few session information like jSessionCookie (managed by container), internal username and some other internal IDs. Now, I wonder where to put this session information so that I can access it in the backing beans for JSF, but also

Scope of jsp:useBean

你离开我真会死。 提交于 2019-12-04 09:50:04
问题 home.jsp <jsp:useBean id="username" class="java.lang.String" scope="application"/> <% username="Jitendra"; %> <jsp:include page="include.jsp"/> include.jsp <%=username%> This gives an error saying “username” is undefined in include.jsp, even though the scope of Bean is application… 回答1: As to your problem, anything which you declare locally using the old fashioned scriptlets is not linked with a jsp:useBean . Also, declaring a local scriptlet variable is not visible in the included pages, you

How to refresh parent jsf page from richfaces popup

偶尔善良 提交于 2019-12-04 09:13:42
I have a JSF page with a few fields. I followed this tutorial from BalusC and all is good. I then added RichFaces support to it, which is working fine. I can see popups etc working. Now what I am trying to do is that once a person has been registered, I want to show the name in the popup (this is also fine I can see that in the popup). Then I want to be able to change that name inside the popup and have that reflected in the parent, but I have no clue how to do that. Please have a look. XHTML Page <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com

Java EE 6 @Inject lazy? [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 09:13:14
This question already has an answer here: How to make a CDI bean lazily initialized? 3 answers I am doing some refactoring and reviewing of the application that we are currently developing. While doing this I found that more beans are injected and I think making they loading in an lazy manner would be better suited for their purpose. I am using Java EE 6 and tend to use more CDI than EJB injection. So the question is whether it is possible to inject the beans lazily and if so, how can you do it? What about using @Inject private Instance<?> lazyProvider; ? That allows Getting instance of "?"

Where can I configure the thread pool behind the @Asynchronous calls in Java EE 6?

扶醉桌前 提交于 2019-12-04 08:33:06
问题 I recently learned that I can easily make any session bean method Asynchronous by simply adding the @Asynchronous annotation. E.g. @Asynchronous public Future<String> processPayment(Order order) throws PaymentException { ... } I know that Java EE 7 added Concurrency Utilities, but in Java EE 6, where is the thread pool configuration of the @Asyncronous methods? is there a way to set a timeout? is it a fixed thread pool? a cached one? what is it's priority? Is it configurable somewhere in the