glassfish-3

Ejb Code with NetBeans and GlassFish

拥有回忆 提交于 2019-12-11 00:32:36
问题 I am very new in Ejb and with very few knowledge about it. I have download NetBeans (7.01) and GlassFish (3.01). But, as I have no idea about Ejb, I am not getting how to run the code which includes a simple Statefull Session Bean, a jsp page and a back end database. For example, I found some example code like this code or many "shopping cart"examples. Can any body help me by giving a step by step procedure how to run it . Or can anybody suggest a nice tutorial or book which shows step by

How inject EJB into abstract CDI class?

拥有回忆 提交于 2019-12-11 00:26:26
问题 I have a problem with injecting an EJB into an abstract class which is the parent of my JSF CDI beans. In my project I am using MyFaces CODI 1.0.5 (ViewScope), Omnifaces 1.3, PrimeFaces 3.4.2 and GlassFish 3.1.2. The application is an EAR, the abstract class is in an EJB module and the JSF CDI beans are in a WAR module: webframework-demo.ear |__ webframework-war.war -> concrete JSF CDI bean |__ webframework-ejb-lib.jar -> abstract class with EJB injection |__ lib\ |__ shared libs My abstract

@SessionScoped does not work when adding @Named

谁说胖子不能爱 提交于 2019-12-10 21:34:09
问题 Consider the following backing bean: import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean @SessionScoped public class Counter { int counter; public Counter() { this.counter = 0; } public void Increment() { this.counter++; } public void Decrement() { this.counter--; } public int getCounter() { return this.counter; } } I have created a JSF-page that displays the value of the counter and has two buttons to increment and decrement it. It works as expected.

What causes a full request on this page?

萝らか妹 提交于 2019-12-10 20:27:57
问题 Consider the following jsf page: <h:body> <h:form id="SessionStartDialog"> <table> <tr> <td class="label"> <h:outputLabel value="Enter your username:" for="UsernameField"/> </td> <td class="input"> <h:inputText id="UsernameField" value="#{login.username}" validator="#{login.validateUsername}" tabindex="1"> <f:ajax render="SelectWorkingSetListbox StartSessionButton UsernameMessage" /> </h:inputText> <h:message id="UsernameMessage" for="UsernameField" /> </td> </tr> <tr> <td class="label"> <h

CDI inject EJB into POJO on Glassfish v3

流过昼夜 提交于 2019-12-10 17:45:48
问题 Is it possible to inject EJB 3.1 beans into POJO using CDI on Glassfish v3? My classes (in EJB module): @Singleton @LocalBean @Startup @Named public class NewSingletonBean { @PostConstruct public void init(){ System.out.println("NewSingletonBean INIT"); } } _ @Singleton @LocalBean @Startup @DependsOn(value="NewSingletonBean") public class NewSingletonBean2 { @Inject NewSingletonBean newSingletonBean; @PostConstruct public void init(){ System.out.println("NewSingletonBean2 INIT"); System.out

Manager Bean do not returns when the project is online

泪湿孤枕 提交于 2019-12-10 17:10:11
问题 I have a JSF project working with JPA, I do this : retrive some data from mysql database then plot the data in a chart. Locally works pretty fine, as you can see here: So I deploy the project in my GlassFish 3 Open Source, which is running in a EC2 instance, then I try to make the same operation again but it seems the ManagedBean do not returns to the page correctly: This is my ManageBean : @ManagedBean(name="reportc") @SessionScoped public class ReportControl implements Serializable {

does glassfish support password aliases in jvm args?

陌路散爱 提交于 2019-12-10 16:39:11
问题 I'm trying to use an aliased password as a jvm arg, but the aliased password does not seem to be provided to the web app. Here is my domain.xml config: <jvm-options>-Dmy_password=${ALIAS=my_password_alias}</jvm-options> However, trying to retrieve the password just returns null String password = System.getEnv("my_password"); // returns null and String password = System.getProperty("my_password"); // returns "${ALIAS=my_password_alias}" I've tried on: GlassFish Server Open Source Edition 3.1.2

Use ContainerRequestFilter in Jersey without web.xml

怎甘沉沦 提交于 2019-12-10 15:59:18
问题 I am trying to intercept requests in Jersey running inside Glassfish. I created an implementation of ContainerRequestFilter package mycustom.api.rest.security; @Provider public class SecurityProvider implements ContainerRequestFilter { @Override public ContainerRequest filter(ContainerRequest request) { return request; } } My app is started using a subclass of PackagesResourceConfig . When Glassfish starts, Jerseys find my provider: INFO: Provider classes found: class mycustom.rest.security

Make EJB call with timeout

三世轮回 提交于 2019-12-10 14:55:32
问题 I have an EJB A that invokes EJB B . The UI should not wait for more than 30 seconds for a response. If some data is missing, it should return a partial response. How can I define a timeout (time limit of 30 seconds) on EJB B ? I can define EJB B as Asynchronous that returns Future , and then do Future.get(30, TimeUnit.SECONDS) . But is it the best solution? thank you P.S. I use glassfish 3.1 回答1: To configure timeout for a bean which applies to all its methods, you have to configure the

Turn off Glassfish Log Rotation

坚强是说给别人听的谎言 提交于 2019-12-10 11:40:48
问题 I know that it is possible to configure log rotation options based on file size. I could not find and option to turn off the rotation rules completely at Glassfish 3.1? Is it possible to disable log rotation at Glassfish 3.1? 回答1: You can turn off log rotation by setting the File Rotation Limit (server-config -> Logger Settings) to 0 bytes in the glassfish admin gui or via asadmin command: asadmin set-log-attributes --target server com.sun.enterprise.server.logging.GFFileHandler