java-ee-6

How does @SessionScoped work with EJB? Is CDI only for web-tier?

拜拜、爱过 提交于 2019-12-22 04:07:37
问题 How is the session defined in @SessionScoped CDI bean? Is this annotation valid only when called from Servlet container, where the session is well defined in form of HttpSession ? If not, than how an EJB with @Inject @SessionScoped MyBean myBean can know what the session really is ? I mean, methods of this EJB could have been invoked by a standalone client, RESTful WS or by some other view. What should happen in such case? Should the annotation have no meaning, should it inject fresh MyBean

Deploy JSF composite components for shared use

时光总嘲笑我的痴心妄想 提交于 2019-12-21 20:37:35
问题 I work on a Java EE project which is planned to become quite large in future and I want to share as much code as possible. This included not only Java code, but also code for UI elements. I think about developing enterprise components based on clear defined subjects (like user administration, taxes, products) which interact on basis of messages, beans and so on. I also think about giving all these components some managed beans and JSF composites to provide some basic functionality for later

Application Client access EJB on Glassfish via a remote interface. Can I do it via local interface?

一曲冷凌霜 提交于 2019-12-21 20:27:47
问题 I recently gone through a Netbeans article about how to create and Enterprise Application Client that access EJB deploy on Glassfish.(Article Link Here) I have couples questions about this article. The article exposes the EJB via a remote interface, I think this will result in application client have to make a remote invocation. There are overheads for doing this. While local interface parameters are passed by reference, remote interface parameters are passed by value, which results in

How to refresh parent jsf page from richfaces popup

十年热恋 提交于 2019-12-21 17:50:24
问题 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

How to deploy a JSF 2.1 webapp in Oracle Weblogic 12.1?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 16:58:08
问题 I am trying to deploy a JSF 2.1 webapplication to a Weblogic 12.1 application server, but the deployment fails with the following exception <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Critical error during deployment: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.oracle.injection.integration.jsf.WeblogicFacesConfigResourceProvider cannot be cast to com.sun.faces.spi.ConfigurationResourceProvider at com.sun.faces.config.ConfigManager.initialize

“Unable to convert ejbRef for ejb” on CDI (Weld) injection of @Stateless EJB into @SessionScoped JSF2 bean in Glassfish

99封情书 提交于 2019-12-21 12:33:10
问题 [ UPDATE : After discussion on the Glassfish forums/ML at http://forums.java.net/jive/thread.jspa?messageID=480532 a bug was filed against Glassfish https://glassfish.dev.java.net/issues/show_bug.cgi?id=13040 for this issue.] I'm trying to inject a local no-interface view of a @Stateless EJB into a JSF2 @Named @javax.enterprise.context.SessionScoped backing bean. The EJB is one of several that extend an abstract generic base class. Injection of "@Inject TheEJBClass varName" fails with "Unable

Storing and editing configuration for Java EE applications

流过昼夜 提交于 2019-12-21 07:29:46
问题 UPDATE : See my blog post on this topic about a year after this was written: http://blog.ringerc.id.au/2012/07/java-ee-7-needs-improvements-in-app.html ... for references to the Java EE 7 planning discussion on this topic. I've mostly finished writing a small Java EE 6 application, and am in the process of replacing the hard-coded preferences with a proper dynamic configuration interface. I'm not sure how - or, more specifically, where - to store settings. There must be some obvious,

Storing and editing configuration for Java EE applications

妖精的绣舞 提交于 2019-12-21 07:29:05
问题 UPDATE : See my blog post on this topic about a year after this was written: http://blog.ringerc.id.au/2012/07/java-ee-7-needs-improvements-in-app.html ... for references to the Java EE 7 planning discussion on this topic. I've mostly finished writing a small Java EE 6 application, and am in the process of replacing the hard-coded preferences with a proper dynamic configuration interface. I'm not sure how - or, more specifically, where - to store settings. There must be some obvious,

What does “org.hibernate.DuplicateMappingException” error mean?

强颜欢笑 提交于 2019-12-21 07:15:34
问题 I'm trying to force JPA/Hibernate to generate and use only lowercase tablenames. I've implemented a NamingStrategy like this: public class MyNamingStrategy extends DefaultNamingStrategy { @Override public String classToTableName(String className) { return super.classToTableName(className).toLowerCase(); } } I have applied it by setting this property in persistence.xml: <property name="hibernate.ejb.naming_strategy" value="entities.strategy.MyNamingStrategy"/> When I do this I get this

“@inject”-ed attribute remains null

社会主义新天地 提交于 2019-12-21 07:15:08
问题 I am trying to inject a service into my bean but it is always null . I get the following error: WELD-001000 Error resolving property userBean against base null. Some code snippets: index.xhtml <h:body> Hello from Facelets #{userBean.name} </h:body> userbean.java package beans; import Domain.User; import java.io.Serializable; import javax.enterprise.context.SessionScoped; import javax.inject.Inject; import javax.inject.Named; import service.UserService; @Named @SessionScoped public class