ejb

javax.persistence.NoResultException: getSingleResult() did not retrieve any entities

Hello, i have created a namedquery with ejb to check if the username is used. When the singleResult is null, then i get the following Exception : javax.persistence.NoResultException: getSingleResult() did not retrieve any entities But this exception is the result that i want when the username is free. Here is the code: public Us...

Foreign Key constraint violation when persisting a many-to-one class

I'm getting an error when trying to persist a many to one entity: Internal Exception: org.postgresql.util.PSQLException: ERROR: insert or update on table "concept" violates foreign key constraint "concept_concept_class_fk" Detail: Key (concept_class_id)=(Concept) is not present in table "concept_class". Error Code: 0 Call: IN...

How does EJB home object reference knows the server details to which it should connect ?

Hi , After I do a JNDI look up , what I get is a reference to the Home of EJB Object. But when I do an API call on Home/Remote , how does it find the URL/port of the server ? Thanks J ...

NameNotFoundException when calling a EJB in Weblogic 10.3

First of all, I'd like to underline that I've already read other posts in StackOverflow (example) with similar questions, but unfortunately I didn't manage to solve this problem with the answers I saw on those posts. I have no intention to repost a question that has already been answered, so if that's the case, I apologize and I'd be tha...

Java EE6 App + EJB in Glassfish 3.0/Netbeans 6.8?

Has anyone got this configuration working? Latest Netbeans, latest Glassfish, I created an EJB project, also an EE Application. The EJB in itself builds & deploys to Glassfish OK. Now when I want to reference the EJB, I have to add the EJB jar to the EE Application path, if I don't do this the code does not compile. But, the EJB jar gets...

How to setup RMI in Glassfish (2.x), so the Remote EJBs would be injected

Hi, currently when I deploy enterprise modules manually, their remote EJBs are null (not injected). When I deploy via NetBeans ide, RMI is someway setup and EJBs are injected. My question is what needs to be configured in Glassfish (2.x) so I could deploy modules manually, not via ide. ...

How do i set the Transaction Isolation in EJB?

Hello, I am not able to find a way to set TransactionIsolation in ejb. Can anybody tell me how do i set it? I am using persistence. I have looked the following classes : EntityManager , EntityManagerFactory, UserTransaction. None of them seems to have any method like setTransactionIsolation or such. Do we need to change persistence.xm...

create manifest without classpath entries in ejb-client jar, but have classpath entries in main ejb jar using maven-ejb-plugin

Hi, I am using maven-ejb-plugin to generate the ejb jar and the client jar. Also I am using archive to generate the manifest file. But the problem is I need the classpath entries in the ejb jar but not in the client jar. Is there any configuration available to addClasspath only in the main jar and in the client jar do not set the class ...

Is there a way to access HttpSession from EJB module?

I'm currently in a need of getting session ID thus I need to get the HttpSession but I don't have any servlets in my EJB module. So perhaps some DI annotation like in webservices api? ...

Is JPA + EJB to much slow (or heavy) for over Internet transactions?

Hi, I am developing a stand-alone java client application that connects to a Glassfish v3 application for JPA/EJB facade style transactions. In other words, my client application do not connect directly to the database to CRUD, but it transfers JPA objets using EJB stateless sessions. I have scenarios where this client application will...

errors deploying an EAR with EJBs 2.1 into JBoss AS5

Hi, I'm porting an application with EJBs 2.1 from Weblogic9 to JBoss AS5. I have made some of the changes like adding jboss.xml descriptors to EJBs and fixing application.xml of the EAR, but there are still problems when deploying the EAR. Here is a summary of the the latest error I'm getting when the first EJB is being deployed by JBos...

How to prevent "Local transaction already has 1 non-XA Resource" exception?

Hi, I'm using 2 PU in stateless EJB and each of them is invoked on one method: @PersistenceContext(unitName="PU") private EntityManager em; @PersistenceContext(unitName="PU2") private EntityManager em2; @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW ) public void getCandidates(final Integer eventId) throws ControllerExcept...

Is this valid EJB-QL?

I have the following construct in EJB-QL several EJB 2.1 finder methods: SELECT distinct OBJECT(rd) FROM RequestDetail rd, DetailResponse dr WHERE dr.updateReqResponseParentID is not null and dr.updateReqResponseParentID = ?1 and rd.requestDetailID = dr.requestDetailID and rd.deleted is null and dr.deleted is ...

How to change web service URL in JBoss 5.1

Environment: Windows 2003 JBoss 5.1 Code: @WebService @Stateless @SOAPBinding(style = Style.RPC) public class MyWebService { public String sayHello() { return "Hello"; } } wsdl is deployed in: http://localhost:8080/ear-project-ejb-project/MyWebService?wsdl I would like to define another path for this webservice, something like: htt...

Ejb 2.0 deployment issues on Jboss 5.1

I am deploying an ear application on Jboss 5.1.0. and i facing some issues. I had two ears one i had copied to deploy folder and the other in deploy-hasingleton. The ear which is in deploy-hasingleton is throwing some errors.when i serached in google i came to know that there is some issue with EJB 2.x on jboss 5.1.i was not able to fi...

EJB Local/Remote interface within separate applications in a single application server instance

Assume a single application server instance that has two EARs deployed. The first EAR invokes EJBs from the second EAR using remote EJB interfaces. It is rumored that even if the invokation is implemented using remote interfaces, the application server knows that everything is within the same JVM and internally uses the remote interface...

Stateful EJB not retaining information.

Hello, I have created a simple shopping cart. It stores an item ok and I can return the the page and the item remains there but as soon as I add another item to the cart however, it resets and just stores that one item. Any ideas? Thanks @Stateful(name="CartSessionBean") @Remote(CartSession.class) public class CartSessionBean implemen...

By using ejb3 and jsf do I still have to do jndi lookup?

I am not sure jndi lookup is necessary or not in terms of ejb3 technology advantages. Any help would be appreciated, thanks. ...

How do I fix this JBoss EJB client authentication issue?

I have an EJB deployed under JBoss (we're moving a project to it from Weblogic), I can get an EJBHome reference to the EJB via a JNDI lookup. The login-config.xml application-policy contains several login modules (I don't know if these are ANDs or ORs?) - org.jboss.security.spi.BaseCertLoginModule, LdapLoginModule, RoleMappingLoginModul...

log4j problem in java enterprise application

Hello, I created a java enterprise application in Netbeans 6.8. It has ejb module and web application. I want to log all errors in catch block in my file. In web application, we would create log4.properties in /WEB-INF/classes. But, in ejb module, we don't have anything like /WEB-INF folder. So where should i paste this file? so that i d...