ejb-3.0

Why use stateful session beans?

I'm learning ejb3 and I'm just curious when it's convenient to use SFSB? I can't find any nice example when SFSB realy solve easily some complex problem. Actually I see that SLSB can be used as web-services and this is convinient. But I don't know when to use SFSB. I see only problems with it because we should learn something about it, ...

Proparing EJB3 and WAR projects for deployment

Hello, perhaps someone can help me - I have EJB project (in Netbeans) which is deployed to Glassfish. I also have a WAR project (not part of EAR containing the previous EJB JAR) which has a dependency on the EJB JAR mentioned. The calls between WAR and EJB are remote EJB calls. If I use EJB JAR as library in WAR, it seems that Glassfi...

Better EJB3 IOC

Hello, does anyone knows how to "plug in" or enable IOC for injecting @EJB in classes which are not EJBs or Servlets (but rather POJOs)? So, if EJB and Servlet use helper classes, their EJB annotations are not processed. Application server is Glassfish v2.1. Is there a way to enable this with some lightweight framework? Guice doesn't...

How to develop a Desktop Application when you only know EJB3 JPA and JSF ?

Hello everyone ! For almost a year know, i developped applications in EJB3/JPA for persistence and business and Seam/JSF for presentation. I had an idea for a desktop app, but i don't know what to use. Using an embedded jboss would be the easy thing, because i don't have to change the way i code, but it's not realistic, and i don't th...

EJB help needed

public void runTest() throws Exception { InitialContext ctx = new InitialContext(); ResourceManager bean = (ResourceManager) ctx.lookup("ejb/ResourceManagerJNDI"); System.out.println(bean.DummyText()); } Hello. So i'm trying to create an EJB application, and this is the test client for it. the JNDI lookup is successful b...

Some limitations about EJB 3.0 and Toplink framework

I have project use EJB 3.0 and implement Toplink framework for model layer. When using EJBQL to process data, I see it seems have some limitation: It cannot process datatime such as find a part of date such as day, month or year It cannot find datetime among from...to It cannot comparison datetime field It cannot map a class not entit...

why pool stateless bean?

Normally we use singleton instance for business / dao layer. What is the reason behind pooling stateless session beans in case of EJBs? ...

Where can I find good unit testing resources for EJB and J2EE?

Which online resources, tutorials or books can you recommended to get started with unit testing J2EE / EJB3 applications? So far I have found ejb3unit, Jakarta Cactus and the Maven Cargo plugin. It would be helpful if there are complete working examples, ready to run. Target containers are the open source products GlassFish, JBoss and ...

translating outer join SQL query into EJB entity beans

I'm new to EJB and trying to get my head around translating SQL concepts to EJB entity beans. Suppose I have two tables: PEOPLE (id, name), CONTACT(pid, phone_number). If I want to get a list of all people whether or not they have phone #s, in my EJB session bean I simply issue a SQL query via JDBC such as: SELECT PEOPLE.name, CONT...

weblogic 10.3: EJB JAR is getting deployed as "Library" and not "EJB"

In Weblogic 10.3, the JAR containing the EJB below along with the persistence file, is deployed. But Weblogic deploys it as Type "Library" instead of an "EJB", which is not what I want. package com.sajee; import javax.persistence.*; @Entity @Table(name="REGISTRAR") public class Registrar implements java.io.Serializable { privat...

Weblogic 10.3.1 gives 'Dependency injection failure' warning when publishing code

Weblogic 10.3.1 gives me a "Dependency injection failure" when I publish my code; the publish itself succeeds. I am working via Eclipse. Basically I publish an ear with a web service aaa.MyWebServicePort that has a bean bbb.MyBean declared as local variable with the ejb 3.0 @EJB annotation. bbb.MyBean is also in the ear as well as a cl...

Custom resource in @Resource annotations added at runtime

Hello, I want to be able to do something like this in a stateless Session Bean @Resource(name="mycustomthingie") private CustomClass stuff; The value injected is context (speak: Thread) dependant. I guess this would be possible if I bind an ObjectFactory into the JNDI Context that delivers the correct Object when requested. As I und...

Examples or Uses Cases to explain EJB Transaction Attributes

There are some good explanations of EJB Transaction Attributes (and annotations) out there, for example, OpenEJB's. But sometimes when I try to cover this with someone who hasn't worked with many transactional resources, I see their eyes start to glaze over. So my question - how would you explain EJB Transaction Attributes to your gr...

Spring vs EJB. Can Spring replace EJB?

Since Spring is able to use transactions just like EJB. For me, Spring is able to replace the requirement of using EJB. Can anyone tell me what are the extra advantages of using EJB? ...

EJB3.0- Converting MDB stateless bean to stateful bean

Hi all. I am new to EJB, and I have a question regarding MDB. How do I convert MDB stateless beans to stateful beans? Options: using bean passivation only. using bean activation only. using both activation and passivation. None of the above. Thanks in advance. ...

Jboss5, unauthenticated calls to secured EJB via @RunAs

I'm attempting to call methods on a secured EJB from an unauthenticated source (a Message Driven Bean hooked up to a queue). The MDB has an EJB injected into it via @EJB, which is fine, but the target EJB has @SecurityDomain("stuff") and @RequireRole("user"), and on execution generates huge stack traces around: 17:14:03,275 ERROR [STD...

How to use Quartz with EJB3 ?

Hello everyone. I want to be able to : define different jobs and triggers. modify the expirations dates and intervals on demand pause or cancel an execution (trigger) the jobs would be ejbs or call ejbs and i would want to manage everything from the website (the user will have to define the executions) So i looked at the timerservi...

Force clear EJB3 cache in Glassfish

I have application written in Java that is using EJB3 + Toplink. I'm using Glassfish as my app. server. Sometimes the data that has been cached is old and I need to clear my cache manually. I know that we can set time to clear it, but I would like to make a button that will manually clear it for me. Is is possible to do? ...

JPA and EJB - OneToMany problem

Hello, I try to build simple Java EE application that uses JPA + EJB3 and Stripes. It's a little address book. I'm using 2 JPA entities, Person and Email. Every person can have more emails, but each email can only belong to one person. My entities looks like this (with default setters and getters): Person.java: @Entity public class Per...

Problem with Stripes' submit

Hello, I'm currently experiencing a problem with submit button in Stripes. It completely ignores event, that it should call. Actionbean is working on links with no problems... Im stuck on that for like 3 hours. event in actionbean @HandlesEvent("addc") public Resolution addc() { log.debug("addc() contract={}", contract); contra...