ejb

Why is an injected value sometimes null inside my custom ConstraintValidator?

痞子三分冷 提交于 2020-01-06 13:27:17
问题 i created a custom ConstraintValidator Annotation which called APIAuth , and i tried to fetch the remote user IP Address Using @Context HttpServletRequest , but the problem is when calling the APIAuth inside my Stateless , the APIAuth custom validator work , and it fetch the remote user ip address , but when i try to refresh the request again quickly , it throw an exception , because of @Context HttpServletRequest be null at this case , it need from me to wait some seconds before trying to

How can I identify the client or caller of an EJB within the request?

萝らか妹 提交于 2020-01-06 08:48:07
问题 I have a system where several (20 or so) web app servers (hosting a website) talk to the same 2 - 4 EJB servers (through a VIP). I'd like to know if it is possible to identify which one of those app servers generated a specific request. For example: Website example.com works by sending HTTP requests to any of 20 app servers to handle the request. These servers are named (internally) app01 through app20 . It is ensured that all requests with the same session ID will be routed to the same app

Best way to schedule a job in glassfish/centos

喜你入骨 提交于 2020-01-06 08:24:09
问题 I need to run a daily job which will run once a day and get some data from a different database. The task is developed as an EJB. I tried the @Schedule with EJB, and it is working fine. But the issue is if there is a change in the schedule, the code has to be changed and the app to be redeployed. Is there a way to avoid this? May be by using configuration files etc. I am using JSF 2.2, glassfish3.4.2 in CentOS. 回答1: You can do this by creating your timer programmatically something like this .

Is it possible to have EJBs in domain1/lib using GlassFish?

…衆ロ難τιáo~ 提交于 2020-01-06 08:17:11
问题 I use GlassFish 4 web profile and I have the following interface and class. @Local public interface SomeService { ... } @Singleton public class SomeServiceBean implements SomeService { ... } When I put interface and class in .war archive (that is in domain1/autodeplay) everything works fine. However, when I put interface and class in separate .jar archive (that is in domain1/lib) then deploying war application I get: java.lang.RuntimeException: Cannot resolve reference Local ejb-ref name=com

How can one isolate logical layers of an Java EE application

扶醉桌前 提交于 2020-01-06 08:16:19
问题 I'm not really sure if this is actually a real problem or a stupid beginner question. Maybe I have missed some point and this question is rather trivial, so please bear with me. If I got it right, then the difference between layers and tiers is that layers relate to logical separation whereas tiers imply physical separation of portions of an application. One can implement layers as separate tiers to shield the application from users making direct calls e.g. to data access objecs. But my

My EJB throws a transaction required exception although another EJB setup in the same way with same persistence unit throws no excpetion

随声附和 提交于 2020-01-06 07:16:33
问题 First here is my entire EJB file: package enkia.pulse.indexing.beans; import enkia.pulse.core.Category; import enkia.pulse.core.Product; import enkia.pulse.core.Review; import enkia.pulse.core.Twitter; import enkia.utils.HarvestingConstants; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Resource; import javax.ejb.SessionContext; import javax.ejb

Remote ejb call failed after successful calls

浪子不回头ぞ 提交于 2020-01-06 07:15:06
问题 I've a strange problem. I've install JbossAS 7.1.1 and deployed my ear file successfully. My client is running to tomcat 6.035. I can make successful EJB calls to my jboss deployment - but one specific EJB calls fails. my client environment setup is as below :- Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); env.put

Remote ejb call failed after successful calls

徘徊边缘 提交于 2020-01-06 07:15:00
问题 I've a strange problem. I've install JbossAS 7.1.1 and deployed my ear file successfully. My client is running to tomcat 6.035. I can make successful EJB calls to my jboss deployment - but one specific EJB calls fails. my client environment setup is as below :- Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); env.put

What are the consequences of opening/closing connections within a transaction?

坚强是说给别人听的谎言 提交于 2020-01-06 04:41:26
问题 I'm trying to wrap my ahead around some strange errors, where code that seemingly should run as one transaction does not. I'll try to get all the relevant parts down, but it's quite a lot so. The project contains both Spring and EJB, so I'm not really sure if one of them is actually used here, or both. The Spring configuration contains this: <jee:jndi-lookup id="platformTransactionManager" jndi-name="java:appserver/TransactionManager" resource-ref="false" expected-type="javax.transaction

Scheduled task executed twice

三世轮回 提交于 2020-01-05 22:22:13
问题 I have a Stateless session bean with two @Schedules : @ConcurrencyManagement(ConcurrencyManagementType.CONTAINER) @Stateless @Lock(LockType.WRITE) @AccessTimeout(value = 0) public class ScheduledTask { @EJB private SomeClass sClass; @Schedules({ @Schedule(hour = "*", minute = "*/10", info = "Automatic timer to send")}) public void send() { sClass.doWork(true); } @Schedules({ @Schedule(hour = "*", minute = "*/35", info = "Automatic timer to receive")}) public void receive() { sClass.doWork