ejb

Is it possible to upgrade the DB schema with EJB?

Dear folks, lets say I have an EJB application wich defines some entities and relations among them. I figured the DB schema can easily be created from the entities. So now the app works but after a while a need to change some relations, e.g. a one-to-one needs to become a one-to-many, can I upgrade my DB to do so WITHOUT losing the old ...

Spring & Hibernate EJB Events

Is it possible to define a spring-managed EJB3 hibernate listener? I have this definition in my persistence.xml: <properties> <property name="hibernate.ejb.interceptor" value="my.class.HibernateAuditInterceptor" /> <property name="hibernate.ejb.event.post-update" value="my.class.HibernateAuditTrailEventListene...

Message Driven Bean with a Datasource

My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss. For example, my MDB looks something like: @MessageDriven(mappedName = "ExampleMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @A...

java ee | ejb3 | runtime dispatch

Hi, I would like to call an ejb3 at runtime. The name of the ejb and the method name will only be available at runtime, so I cannot include any remote interfaces at compile time. String bean = 'some/Bean'; String meth = 'doStuff'; //lookup the bean Object remoteInterface = (Object) new InitialContext().lookup(bean); //search the meth...

How to close EnityManager when not injected?

I have a servlet running in an Oracle OCCAS server. Currently I map some data in a database to an entity class in my application using @Entity annotaion. I fail to inject the EntityManager (@PersistenceContext) though, and to my understanding that is because it is running in my servlet context and not as a separate Entity EJB. Creating t...

Best way to configure a Java enterprise application

Hello all, I have a set of EJBs and other Java classes which need to be configured differently based on the system environment in which they are deployed: production, test, or lab. The configuration information includes stuff like URLs and database connection information. We'd like to deploy the same exact product (EAR file) in each en...

How do I get user information within a stateless session bean

I'm working on an existing j2ee app and am required to remove some vendor specific method calls from the code. The daos behind a session facade make calls into the ejb container to get the user's id and password - in order to connect to the database. The user id and password part of the initialContext used to connect to the server. I ...

Error is loading the jars

i`m getting NoClassDefintion found error in my application even though i had the associated jars in my lin folder of my ear the error is java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.NoClassDefFoundError: com/sun/rave/web/ui/model/Option Note i had added the same user library to my eclipse its not s...

RMI, EJB and callback

Is it possible for a client to pass an RMI object as an argument to an EJB so that the EJB may callback the client? ...

Toplink Objects not showing up under the Toplink Map node in JDeveloper

Hello, for some reason I cannot see any of the generated objects under the TL Map. See the included image (Sorry but it will not render using the community wiki software.... http://img261.imageshack.us/my.php?image=nothingundernodetn5.png ...

Are EJB Timers supposed to be persistent/reliable ?

E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation. Is there a way to make this timer triggers the callback as soons as the server restart ? PS: I know about Quartz, i'm evaluating EJB ...

EJB Transactions in local method-calls

In the following setup, does method B run in a (new) transaction? An EJB, having two methods, method A and method B public class MyEJB implements SessionBean public void methodA() { doImportantStuff(); methodB(); doMoreImportantStuff(); } public void methodB() { doDatabaseThing(); } } The ...

Transaction rollback and web services

Given an example of calling two web services methods from a session bean, what if an exception is thrown between the calls to two methods? In the case of not calling the web services the transaction will rollback and no harm done. However, the web service will not rollback. Of course, even with a single web service there is a problem. Wh...

Can someone explain the difference between @Remote / @Local or only @Stateless in ejb?

I guess the topic says it. I have tried googling this, but havent gotten the answer I am looking for. I have many EJB's with only @Stateless. And sometimes I put @Local on them withouth really knowing why, and the benefits/cons. I also know I can put @Remote, but really dont know the difference. Hope someone can give a clear descriptio...

Hibernate equivalent to EclipseLink's batch query hint?

One thing I like about EclipseLink has this great thing called the batch query hint, which I'm yet to find a Hibernate equivalent of. Basically doing a whole bunch of joins gets messy real quick and you end up querying way more data than you necessarily want (remember that if you join person to 6 addresses the person information is retu...

Share static singletons through EJB's

I'm trying to create a cache in a webservice. For this I've created a new Stateless Bean to provide this cache to other Stateless beans. This cache is simply a static ConcurrentMap where MyObject is a POJO. The problem is that it seems as there are different cache objects. One for the client beans, and another locally. -CacheService -Ca...

Choosing embedded EJB 3.x container to run JEE 5 app on Tomcat

I am sorry in advance if my question sounds too generic - I am doing all preliminary research myself but nothing substitutes real experience... My goal is to port a legacy JEE application (pre-EJB 3.x) to Tomcat with embedded EJB container. My choices currently stand as follows: JBoss Embeddable EJB Apache OpenEJB OW2 Consortium EasyB...

Keeping a DCOM object alive from Java server on a REST invocation

Hi, I'm implementing a REST API for my Java server. One of the of the resources obtained through the API is actually creating a C++ DCOM object and reflecting its values. The Java to COM bridge I'm using is J-Integra. The problem is that I need to keep that DCOM object alive for subsequent REST calls, but the object is alive just as lo...

Thread in App Server

I have a Java program/thread that I want to deploy into an App Server (glassfish). The thread should run as a "service" that starts when the App server starts and stops when the App Server closes. How would I go about doing this? Its not really a Session Bean or MDB.. Its just a thread. ...

NamingException when trying RMI/HTTP from JBoss 4.0.1 to 4.2.3

I've got an application that is trying to call a method on an EJB running on JBoss 4.2.3 GA. The application is a legacy app; it works when it accesses the original server which ran on JBoss 4.0.1. Its RMI code is in jbossall-client.jar from JBoss 4.0.1. It is trying to call a method which will give it new code to allow it to update it...