ejb

Add Security Role References programmatically (without using declarative EJB Deployment Descriptor)

I'm developing a Java EE 6 application using Glassfish 3.1, B06. To secure my app, i'm using a JDBCRealm and programmatic security. This works fine to check username and password. But when it comes to declaring security roles, i have a problem: To use Security Roles in Java EE 6, i have to declare those roles both in the EJB deployment ...

Why not use Session Beans instead of Message Driven Beans ?

I'm wondering, why not use Session Beans instead of Message Driven Beans ? If you can call remote methods from EJBs, so why bother sending/receiving messages with Message Driven Beans (which is more difficult to develop than session beans) ? In which scenarios Message Driven Beans become useful ? ...

What about OpenEJB? Is it worth it? Any opinions?

Hi, I whould like to know some opinions about OpenEJB: we are considering to use it on a new project, but really didn't found many opinions about it. So, here is my question: how about it? Does it perform well? Is it stable enough for a production environment? ...

How to access entity beans from a remote client ?

i have this in the server: class Person{...} and @Stateless public class HelloServiceBean implements HelloServiceLocal, HelloServiceRemote { public Person getPerson(String name) { return new Person(name); } } And i have this in my client (in some different JVM): public static void main(String[] a) throws Exceptio...

EJB remote application-client

Hello guys! I am starting a new enterprise project and use Glassfish 3 as an application server and NetBeans 6.9 as an IDE. I have some EJBs which I want to access remotely from a desktop Swing application. AFAIK there are two options - either use plain JNDI lookup or run the Swing application in an application-client container and use ...

How to get one instance of list using select statement in EJB 3 and JSF

Hello All! Now i'm working with EJB 3 in Stateless Bean i create method get all instance of entity About public List<About> retrieveAllAbout(){ return em.createNameQuery("About.findAll").getResultList(); } Now i want get one row of list to pass to js page. How can i do it in jsf page ( xhtml) i want show one value of li...

EJB3 - JSF cannot update entity it excute insert statement why?

hello all new problem i cant solved i have 1 entity below package com.entity; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.NamedQueries; import javax.persistence.NamedQue...

How to use an external instance of ActiveMQ with OpenEJB?

Hi, how can I configure OpenEJB to work with an external instance of ActiveMQ? We already tried the configuration on this link http://openejb.apache.org/3.0/jms-resources-and-mdb-container.html but it did'nt work at all. What should we do? ...

Enterprise Aplication with EJB, JSF and JAX-RS

What is the best Maven archetype to use on enterprise application in java using EJB and JAX-RS, considering that in a near future i will have to make a front-end in JSF2 using as the backend EJBs used with the JAX-RS? ...

Null Pointer exception in ejb 2.0 while referring a local beans home interface

Hi Guys I am just trying out examples of entity beans. I am using JBOSS 4.0.0, EJB 2.0, MyEclipse 8.6. Reason for using JBOSS 4.0.0 and EJB 2.0 is just for learning sake. I am reading head first book. In the process help me if I made any mistakes. I wrote a build file using ant to deploy this in deploy directory of JBOSS. Don't know whe...

JPA: question about merging an entity before removing it.

I know I have to merge the entity before removing it, but I never thought I have to do it inside EJB. First I have these: e = (Event) scholarBean.merge(e); scholarBean.remove(e); in my managed bean. It give me this error java.lang.IllegalArgumentException: Entity must be managed to call remove: com.scholar.entity.Event@998, try mergi...

how to start, where to start

hi expert, i'm new for web application, previously I did mobile app, now start doing web app, I'm intermediate for java,jsp,servlet, and plan to learn hibernate, spring, struts, ejb, which one i should learn first and where to start, bit confusing thanks in advance ...

Spring-WS and Straight-JPA (EclipseLink) Configuration and Deployment

Hey guys, I've implemented an EJB3/JPA web service without any major problems, and now I've moved on a Spring-WS/JPA web service. Both are being deployed to Glassfish. My understanding of JPA is limited, but by default transactions are container managed? How do you change this? With EJB3 things were straight forward as I could just inj...

Socket Programming

Does EJB internally uses Sockets while exchanging Beans to Clients? ...

EJB explanation EAR vs WAR

Hi I have just begun reading up on EJB's. Even as I venture into it I have a few questions based on what I have heard about them. Do applications using ejb's always have to be deployed as EAR ? Can applications containing EJB's be deployed just like other other java web projects using ECLIPSE and without using ANT ...

Hibernate session.close() not returning connection to pool

My application has long running transactions and hence I tried the option session.close() at the end of every method to ensure that the connection objects are not held indefinitely for long time. When session.close() option is used, I could see that the Hibernate's session object and the corresponding Connection object obtained from se...

Using the Seam framework without Stateful Session Beans?

Has anyone had success building a SEAM Application without using Stateful session beans? There is some confusion on a new project in which I think several stakeholders have essentially 'banned' stateful session beans... but some development is being done in SEAM. Most of the literature on SEAM encourages the use of Stateful Session B...

InitialContext.lookup of remote EJB fails after remote server restart

We have a setup in which EJB A is running on server A, and another EJB B is running on server B. EJB A connects to EJB B via IIOP. This setup normally works, but if server B is restarted, EJB A will fail until server A is restarted too. The issue is that if server B is restarted, all calls to InitialContext.lookup by EJB A fails with a...

Logging from EJB module in JavaEE, maven configuration

I have tried for hours to get my project working but the EJB part is still failing with a java.lang.ClassNotFoundException: org.slf4j.LoggerFactory (I want to output some log in my EJB). The layout of the project is the following: |-- nnWeb-ear | |-- pom.xml | `-- src | `-- main | |-- application | | `-...

Do I need to use @Remote when I want to expose an EJB to a different application on same app server?

I have a @Stateless @Local Bean successfully deployed in an ear. I can see the new EJB 3.1 standard global JNDI name when I browse the JNDI tree. (java:global/product/product-ejb/ProductManagement) I want to use this EJB in a different application on the same app server. Do I need to add a remote interface for this EJB? ...