ejb-3.0

java.lang.ClassCastException: $Proxy99 cannot be cast

Hi, I am using JBoss4.2.2 and java6. The deployed ear's name is apa.ear In a servlet I have the following code line: placeBid = (PlaceBid) context.lookup("apa/" + PlaceBid.class.getSimpleName() + "/remote"); I have a generated jboss-app.xml like this: <jboss-app> <loader-repository>apa:app=ejb3</loader-repository> </jboss-app>...

Returning superclass of return type from remote EJB method

Let's say I have remote interface A: @Remote public interface A { public Response doSomething(); } And implementation: @Stateless public class B implements A { public BeeResponse doSomething() {...} } Where: BeeResponse extends Response. Response is located in the EJB-API jar and BeeResponse is in the implementation jar. Re...

Can I use JPA/EJB3 on a table that was created at runtime?

This is weird and probably not possible but I'll ask anyway. I'm making this app that reads in a meta file and creates some tables then populates them with data. I was wondering if I could somehow use JPA to populate those tables. Obviously, there's no way I could have an entity with annotations on it since the table didn't exist at c...

EJB3 - using 2 persistence units within a transaction (Exception: Local transaction already has 1 non-XA Resource)

I am trying to use 2 persistence units within the same transaction in a JEE application deployed on Glassfish. The 2 persistence units are defined in persistence.xml, as follows: <persistence-unit name="BeachWater"> <jta-data-source>jdbc/BeachWater</jta-data-source> ... <persistence-unit name="LIMS"> <jta-data-source>jdbc/BeachWaterLIM...

ThreadLocal (and Singleton) in EJB Container

I've written an authorization system which relies on objects representing the current user. To simplify programming and increase performance I want to hold those objects in a ThreadLocal after the user has logged in. It looks like this: public class UserCache { private static final ThreadLocal<User> cache = new ThreadLocal<User>(...

PERSISTENCE LOB WITH JPA

Hi, Folks. I have this problem using JBOSS, EJB3 and MSSQL Express . i'm trying to persist an entity with an Blob attribute which was converted into a byte[], apparently it create the entity perfectly, no error was logged at jboss's console. but when i check into database the column is null. i already checked the Object to byte[] method ...

Can i easily use EJB3 Remote with a RAD framework?

Hello, I'm planning to make a webapp and just wonder if someone ever tried to use remote EJBs with a RAD framework like Grails, Play... was it easy? ...

Hows does Seam injection work in Ejb3

Hello We are using Seam 2.2.0 Java 1.6.14 Weblogic 10.3.1.0 (named 11g Doh!) I have looked at Seam reference Seam in action These web pages However I still do not understand how to inject an EJB3 bean into a JSF backing bean. It seems to me that I have to (correct me if I am wrong) Annotate with @Name my backing bean Annotate...

What lift do I gain from using EJB3 in my seam project?

I am starting a new seam project targeted at a JBoss EAP server and I have very little experience with EJB3. What do I gain from using EJB3 over just using a war project with pojos and seam annotation? ...

Calling business logic methods at JBoss Server Startup

Hi, I have an EJB project communicating with a Swing client over RPC. I would like to know how to call EJB or utility class methods on the business logic at server startup. Thanks. ...

Can't create EntityManager

New to EJB3, please help/explain. Inside a session bean I declare an EntityManager as follow @PersistenceContext(unitName="ScheduleUnit") private EntityManager em; and this works. But when I do this private EntityManager em; private EntityManagerFactory emf; public void myFunction() { emf = Persistence.createEntityManagerFactory...

How to receive Email in JEE application

Obviously it's not so difficult to send out emails from a JEE application via JavaMail. What I am interested in is the best pattern to receive emails (notification bounces, mostly)? I am not interested in IMAP/POP3-based approaches (polling the inbox) - my application shall react to inbound emails. One approach I could think of would be...

Communication between EJB3 Instances (JEE inter-bean communication) possible?

I'm designing a part of a JEE6 application, consisting of EJB3 beans. Part of the requirements are multiple parallel (say a few hundred) long running (over days) database hunts. Individual hunts have different search parameters (start time, end time, query filter). Parameters may get changed over time. Currently I'm thinking of the foll...

Transaction management in iBATIS 3 inside an EJB (3.1) container

Is anybody out there using iBATIS 3 as their persistence framework inside an EJB container? I recently started building a new system for which I choose EJB 3.1 (the version of EJB is actually irrelevant to this question) as my app framework and iBATIS 3 (this version is relevant!) as my persistence framework. My business logic is impleme...

EJB3 + JEE6: What is a persistent Timer?

I'm just about to use the new EJB3 TimerService (as part of Java EE 6), and as usual, I'm impressed by the brevity of JavaDoc :) Do you know what is the effect of the persistent property of the TimerConfig object? JavaDoc TimerConfig says: The persistent property determines whether the corresponding timer has a lifetime that spans the ...

Server-initiated Rendering: EJB -> FacesContext?

I've already asked this question on the Icefaces forum, but meanwhile I realized that this is a more generic problem. I'd like to update parts of a JSF page when I get a message in my MDB. The problem is, how do I get the FacesContext from the EJB container? In the message processing function FacesContext.getCurrentInstance() returns...

Servlet receives empty object from Remote EJB3 Session Bean

I'm sure this is a beginner error... So I have a JEE6 application with entities, facades (implementing the persistence layer) and Stateless Session Beans (EJB3) with Remote interfaces (providing access to the entities via facades). This is working fine. Via the SLSB I can retrieve and manipulate entities. Now, I'm trying to do this fr...

Good book suggestions for building enterprise software

Enterprise software are built using technologies/softwares/terminologies/APIs such as EJB, JBoss, Seam, Hibernate(JPA), Maven, Eclipse, Spring, JTS, JMS, JNDI etc. I know there are great books out there for each of these individually, however can someone suggest a book or two that covers all (or most of) these topics in lesser detail and...

Am I using EJBs properly?

I am using a JEE6 stack including JPA 2.0, JSF 2.0, EJB 3.1 etc. The way my architecture is setup is the following: I have JPA annotated DAOs using hibernate as my JPA provider. I have JSF Managed beans which correspond to my facelet/xhtml pages. I have EJBs that handle all of my database requests. My XHTML pages have JSF EL which ma...

A cycle in object graph detected in JPA.

Hello, I am trying to figure out this error since 5 hours without any success. SO i finally thought of posting in here. Please help i am really in big trouble. I am stuck on this and see no way of solving this error. This is my database structure tblBlogRegion BlogRegionId (primary key) ...