java-ee

Calling servlet's destroy method

泄露秘密 提交于 2019-12-18 14:16:33
问题 As per the link http://www.xyzws.com/Servletfaq/when-is-destroy-of-servlets-called/20, one of the reason of calling destroy method is when the servlet hasn't got a request in a long time . I was thinking there could be some pages that don't get called for a long time. So, does that mean destroy will be called and they will be no longer used? Actually, I was asked this question in interview and he told me that destroy method will only be called when server is shut down. Appreciate any help on

WebLogic stuck thread protection

爷,独闯天下 提交于 2019-12-18 14:09:37
问题 By default WebLogic kills stuck threads after 15 min (600 s), this is controlled by StuckThreadMaxTime parameter. However, I cannot find more details on how exactly "stuckness" is defined. Specifically: What is the point at which 15 min countdown begins. Request processing start? Last wait() -like method? Something else? Does this apply only to request-processing threads or to all threads? I.e. can a request-processing thread "escape" this protection by spawning a worker thread for a long

WebLogic stuck thread protection

点点圈 提交于 2019-12-18 14:09:34
问题 By default WebLogic kills stuck threads after 15 min (600 s), this is controlled by StuckThreadMaxTime parameter. However, I cannot find more details on how exactly "stuckness" is defined. Specifically: What is the point at which 15 min countdown begins. Request processing start? Last wait() -like method? Something else? Does this apply only to request-processing threads or to all threads? I.e. can a request-processing thread "escape" this protection by spawning a worker thread for a long

JAXB XJC Possible to suppress comment creation in generated classes?

孤街浪徒 提交于 2019-12-18 13:54:19
问题 Our project uses XJC to generate Java classes from an XSD. I'm using JAVA EE 6. When all the XSDs we have are re-generated, the generated classes include this comment at the top of the file: // Generated on: 2011.02.23 at 02:17:06 PM GMT Is it possible to suppress this comment? The reason is that we use SVN for version control, and every time we regenerate our classes, every single file shows as being changed in SVN, even though the only thing that differs is this comment. So I'd like to

If I access UserTransaction does this mean that I use 2 phase commit or XA?

℡╲_俬逩灬. 提交于 2019-12-18 13:47:30
问题 UserTransaction ut=lookup.... ut.beginTransaction(); saveToFooDB(); statelessEjb.transactionSupportedMethod(); //saves something to the Foo DB saveToFooDB(); ut.commit(); If i was doing the above then my understanding is that it is not an XA transaction as it doesn't span across multiple resources (like DB plus JMS). Is my understanding correct? 回答1: Data source can be configured of two kinds: XA : these datasource can participate in distribute transactions Local : also called non-XA, they

javax.validation.ConstraintViolationException

时光总嘲笑我的痴心妄想 提交于 2019-12-18 13:38:56
问题 I am using JSF+JPA iam not fix this error: javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details. @ManagedBean(name = "clientCon") public class ClientController { @PostConstruct public void init() { System.out.println("Salam"); clients = new Clients(); } private EntityManagerFactory emf = null; public ClientController() { emf =

Replacing Websphere's WorkManager in JBoss?

萝らか妹 提交于 2019-12-18 13:38:35
问题 We're moving from Websphere to JBoss, but some of the code has dependencies on Websphere's WorkManager (com.ibm.websphere.asyncbeans.WorkManager). Has anyone dealt with this before and have recommendations on how to replace Websphere's WorkManager and what you'd replace it with? 回答1: Unfortunately, there is currently no Java EE standard for a WorkManager equivalent; however, JSR-236 (Concurrency Utilities for Java EE) may be back as a candidate for inclusion in Java EE 7. Until then,

User login with JSF 2.0 [duplicate]

假装没事ソ 提交于 2019-12-18 13:38:32
问题 This question already has answers here : Performing user authentication in Java EE / JSF using j_security_check (4 answers) Closed 3 years ago . I am trying - with JSF 2.0 - to implement in a neat way the login/remember me/logout management. Since the traditional <form action="j_security_check" ... way lacks of flexibility I decided to follow a different path, but I found a problem. Declarative security is properly set both in the application server through <security-domain> and in web.xml

How can I inject an EJB from an other application on the same GlassFish Server?

随声附和 提交于 2019-12-18 13:36:56
问题 I have two applications running on my local glassfish server. One to rent bicylces and one to buy train tickets. I now wanted to call a remote ejb from the train application to allow the rental of bicycles for the chosen time but I'm not really sure how to do it. I already tried a few different approaches. Both applications are in different packages and the train application has to know the bicycle remote interface but I don't know how to accomplish that. The remote interface (bicyle app):

Read Environment Variables in persistence.xml file

家住魔仙堡 提交于 2019-12-18 13:28:40
问题 I want to read environment variables inside persistence.xml file. Idea is that i don't want my database details to be read from properties file as there is a change of getting properties file override.Instead i want to read details from environment variables. Is there any way to achieve this criteria. Iam using Spring 3 my standalone application will be deployed in unix machine. 回答1: You can update properties in a persistence unit by supplying a Map (see this). Conveniently, environment