0
голосов
1ответов
1691 просмотров

Lookup Local EJB from Glassfish LifeCycle module

I can look up the remote interface of an EJB3 from a Glassfish 2.1 using the global jndi name. However, as I understand, if this were not a LC module but an EJB (Servlet), I would have an ejb-local-ref entry in its ejb-jar.xml (web.xml). Is there a place to define Local references for an LC modu...

5
голосов
3ответов
3615 просмотров

Criteria queries in EJB 3

Can I use Criteria queries with EJB3 entities? If so, how can I combine them with EntityManager?

1
голосов
1ответов
474 просмотров

EJB3/DB2 Transactions not rolling back

I have a situation where I have a tree of Entities, and a Session Bean. The Session Bean simply persists or merges the entities, and the method in question is marked as @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW). Now in the case that a child entity fails to be persisted/merged...

4
голосов
1ответов
2358 просмотров

EJB Authentication and Authorization

Is there any way to extend the authentication operation which connects a client application to an EJB, using standard JAAS/container-based security? I'm looking for a way to use more than just a username to authenticate the user (in this case a domain name is also needed). Ideally I'd like to be ...

9
голосов
3ответов
1597 просмотров

How to get notification about EJB deployment (to set up a timer)?

I'm deploying an EJB which should set a timer and be triggered by it every 24 hours. But where should I set the timer? @PostConstruct does not help -- this is a session bean, so post-construct method will be invoked when the actual instance is created (this never happens as the sole purpose of th...

8
голосов
3ответов
3357 просмотров

Is it possible to use @EJB annotation to inject EJBs through different servers?

I have 2 session beans, OrderBean and InventoryBean which are deployed at different weblogic servers. The OrderBean needs to access the InventoryBean to check if the supply is sufficient. Currently, I use JNDI look up to locate the InventoryBean and it works fine. Now I'm wondering if it is ...

0
голосов
1ответов
1367 просмотров

Where exactly is the JTA Transaction demarcation for CMT respected?

I'm trying to fully understand the JTA demarcation with CMT. The behavior I am experiencing is that only the first @TransactionAttribute of the method is respected on the EJB and subsequent method invocations of the same bean with different @TransactionAttribute annotations are not. Example: ...

6
голосов
5ответов
19402 просмотров

JNDI lookup of EJB3 inside an EAR file on Glassfish

I have an EAR file with a bunch of JARs in it, and one of these JARs contains Local Session Beans (EJB3). I need to perform a JNDI lookup of these Session Beans from within an unmanaged POJO, also contained in the EAR (and in this case in the same JAR as the EJBs as well). I tried following the G...

4
голосов
4ответов
834 просмотров

EJB3 Getting at original JDBC Errors

I am using EJB3 on Glassfish using the default TopLink persistance manager. Within a Session Bean, when the persistence manager catches a DB exception, it marks the transaction to be rolled back, and throws an EJBException, in turn wrapping a RollbackException. Now I was expecting to be able to g...

1
голосов
1ответов
1994 просмотров

Can I call a Stateful Session Bean through a Stateless Session Bean?

Can I call a Stateful Session Bean through a Stateless Session Bean? Is the client of the SFSB then automatically the client of the SLSB for state preservation purposes? The problem is that because of the design being set in stone, I am not easily allowed to call the SFSB directly.

0
голосов
1ответов
172 просмотров

Sequence / Identity support in python webframeworks

Currently I'm evaluating web frameworks with an ORM layer and I've stumbled upon an interesting issue. I used tables with an ID column in a Java EE (EJB3/JPA) application with different databases. In SAPDB I could define a sequence and use the jpa sequence generator annotation to deal with it, th...

0
голосов
1ответов
510 просмотров

Java EE deployment patterns resourses

I'm looking book/online resources about Java EE application deployment pattens. Especially I want to know patterns when to use local interfaces when remote ones (how many nodes I need to?). The key question is to use single EAR (EJB and WAR) or separate nodes for EJB and WARs. Resources I've fou...

0
голосов
1ответов
1746 просмотров

Why and when to use EJB-based web services?

To transfer data from one system to another, through data interface, by web services, we normally get a result set by SQL query, and format them as a web service endpoint, and allow it to be retrieved by another side. With EJB 3.0, it seems we can replace the result set by stateless session bean...

5
голосов
3ответов
1472 просмотров

How does a java web project architecture look like without EJB3?

A friend and I are building a fairly complex website based on java. (PHP would have been more obvious but we chose for java because the educational aspect of this project is important to us) We have already decided to use JSF (with richfaces) for the front end and JPA for the backend and so far ...

0
голосов
1ответов
2647 просмотров

Ant for EJB project

I am trying to make an ant script for an EJB project. I am using Jboss for this. I am new to both EJB and Ant and am having problems in getting the beans to compile from ant. It gives me number of errors of the kind package javax.persistence does not exist @MappedSuperclass - Cannot find symbo...

3
голосов
3ответов
8877 просмотров

EJB 3 with JDBC

Is it possible to use EJB 3 with JDBC. I read somewhere, that it's allowed. However, I hear that EJB 3 implementation uses JTA, by default. What does that mean for JDBC? Is it only for the transaction support? That means JTA is used for transaction when using JDBC code? Meaning that even local t...

2
голосов
1ответов
1024 просмотров

EJB3 Annotation

I am using JBoss 5 GA, I created a test Session bean, and local interface. I have created a servlet client. I tried to inject the interface in the servlet using @EJB.. But when I call this servlet I got the requested resource is not available!!!! When I comment the //@EJB, the page run successfu...

0
голосов
2ответов
2619 просмотров

JAXB only marshals/unmarshals root node

I am new to JAXB. All I want to do is, given an existing xml string marshal it, and return it in an ejb. The problem is the following code only seems to work for the root node, and not the children. I would like it to work for the whole thing. If it is any help, I have not altered any of the code...

0
голосов
2ответов
4490 просмотров

JBoss EJB3 MDB config

I am trying to understand some EJB 3 code running in JBoss 4.3. We've got an ejb3-interceptors-aop.xml file configured in JBoss with some MDB configuration and then we've got the MDB Java class. What I'd like to understand is when and how does the MDB get "bound" to the MQ? That is, when/how ...

0
голосов
2ответов
1915 просмотров

Java Persistence API(JPA) - Overriding MappedSuperClass's attributes

I have the following questions I have the '@Id' annotated field as part of my '@MappedSuperClass' and I am letting all my entities extend the MappedSuperClass.Now,how do I override the super class 'id' if I have to define a composite primary key for my entity...ie.How do I ask my entity to use ...

0
голосов
1ответов
280 просмотров

Caching instances in a Java EE web app

Consider the scenario of a typical webapp with JSFs on the front and EJB 3, with Hibernate as JPA provider, talking to backend database such as mysql, etc. The main user actions are login and mostly CRUD operations (minus any D(elete) operations). And the App Server is GlassFish of course. Given...

0
голосов
1ответов
1813 просмотров

Accessing Stateful session bean from servlet/jsp throws ClassCast exception in jboss 4.2.2

Whenever I try to access EJB 3 Stateful session bean deployed on JBoss 4.2.2 application server using a web client(within JBoss server) such as servlet/jsp , I get following exception java.lang.ClassCastException: $Proxy123 If I use application client , same code works without any exception. Or i...

1
голосов
2ответов
7178 просмотров

JBoss Class cast exception while accessing EJB3

I am having a weird problem here with EJB3. Deployed and EJB3 and am trying to access the business method from the deployed instance. I get the following error when the lookup is executed: UserAuthenticationRemote is the remote i/face UserAuthenticationBean is the Bean Code (which fails): Us...

0
голосов
1ответов
652 просмотров

When using facade session beans, why should we still use business session beans as well?

When using the facade design pattern to structure an application's business EJB layer, why should we still use session beans for the actual business logic? Is there a specific reason for not just using plain Java classes (if container managed injection isn't required)? How is the performance of a...

2
голосов
2ответов
408 просмотров

Stateless EJBs: Finding the balance between performance and security

I have a JSF web client and a Java client that both use the same stateless EJB layer for their application logic. I'm unsure of how to balance the need for performance (limiting the amount of data that is transported between the presentation and application layers) with security (in the sense of ...

0
голосов
2ответов
914 просмотров

jboss + metro + ejb3= java.lang.NoClassDefFoundError: Ljavax/servlet/http/HttpServletRequest

I am using jboss 4.2.3 with metro. I deploy an EJB 3.0 web service without error but when I try to call its wsdl it throws me: java.lang.NoClassDefFoundError: Ljavax/servlet/http/HttpServletRequest What is happening? I have servlet-api in the lib.

1
голосов
4ответов
2106 просмотров

Auto-Generating EJB3 Entity Beans

I would like to know if there are any tools to automatically generate EJB3 Entity Beans(for JPA) from a database schema. Thanks.

0
голосов
1ответов
3029 просмотров

JBoss EJB 3 issue DeploymentException

I am deploying a EJB3 Jar with several beans in it. The jar works fine on other instances and is deployed correctly. However if I try that on my machine, I get the DeploymentException. I am on JBoss 5.1.0 Please help!! Here is the stack trace: *** DEPLOYMENTS IN ERROR: Name -> Error vfszi...

1
голосов
2ответов
403 просмотров

Best view layer with simple URLs for an EJB3 application

I would like to get your input on what would be the most fitting view layer for EJB 3.0 [1] Java application for me. JSF is no good because it is a mess when it comes to web URIs. I would like a view framework which would help with automating html form submission and validation while using clean...

4
голосов
3ответов
2874 просмотров

What is the preferred design pattern for combining JPA,EJB and JSF managed beans?

This is a design pattern question. Here is the scenario: I am using EJB3.0 with JPA. For example lets say I have a user who can belong to groups. So in my User entity I have a method getGroups() which fetches the groups lazily. And I have a UserDao which is a stateless session bean which has a me...