ejb

Storing a http session attribute in database

不问归期 提交于 2019-12-25 05:52:10
问题 How can I pass an injected http session attribute (see below), along with other values (informe by the user) and save them using JPA? The session attribute is correctly displayed and injected, but I need to pass it using the selected to be stored in the database (actually, it passess null). The JSF: <p:outputLabel value="UserID (the sessionAttribute):" for="userID" /> <p:inputText id="userID" value="#{userBean.myUser.xChave}" title="userID" /> <p:outputLabel value="Type the Reason:" for=

Storing a http session attribute in database

南笙酒味 提交于 2019-12-25 05:52:03
问题 How can I pass an injected http session attribute (see below), along with other values (informe by the user) and save them using JPA? The session attribute is correctly displayed and injected, but I need to pass it using the selected to be stored in the database (actually, it passess null). The JSF: <p:outputLabel value="UserID (the sessionAttribute):" for="userID" /> <p:inputText id="userID" value="#{userBean.myUser.xChave}" title="userID" /> <p:outputLabel value="Type the Reason:" for=

EJB Endpoint Interface - Is client 'in VM'?

一曲冷凌霜 提交于 2019-12-25 05:27:31
问题 As a beginner of SLSB EJB, I understand that accessing them locally (through Local Business Interface) is more efficient than remotely. When an EJB is accessed through an Endpoint, is it being accessed remotely or locally? This is in the context of accessing the EJB through JAX-RS. 回答1: A webservice endpoint is neither local nor remote. It is its own client view. That said, the overhead from remote is primarily due to marshalling/demarshalling arguments for pass-by-value semantics of

UserTransaction failed when call utx.begin() throws “java.lang.IllegalStateException: Operation not allowed”

天大地大妈咪最大 提交于 2019-12-25 05:04:16
问题 i want to use ejb and jpa controller, in netbeans the controller is generated automatically... I try to call the jpa controller from class (UniversidadServiceEJB) that is a session bean stateless, I debugged the project and the UserTransaction and EntityManagerFactory is created successfully but when call the method utx.begin in the jpa controller (UniversityJpaController) throws this exception: java.lang.IllegalStateException: Operation not allowed. at com.sun.enterprise.transaction

EJB Injection failure on deploy

爱⌒轻易说出口 提交于 2019-12-25 04:53:15
问题 I've got a problem exxh EJB's. First of all, my setup: I am using GlassFish & JEE6. I got a REST-Service packaged as a WAR and a bean packaged as an EJB-Jar. They are not inside an EAR. The EJB should be used from the REST-WAR via @EJB, but when I try to deploy the WAR, GlassFish shows this error: Error occurred during deployment: Exception while deploying the app [exx-upload-1.0] : Cannot resolve reference Local ejb-ref name=com.ex.exx.model.FileUpload/ocr,Local 3.x interface =com.ex.exx.api

Unable to achieve load testing on EJB subject using threading

陌路散爱 提交于 2019-12-25 04:17:24
问题 I posted this question asking why 100000 run () calls is faster compred to 100000 start () as i found out that despite multi threading, 100000 start would actually take longer than 10000 run calls because of the thread management. Actually, i was trying to spawn 100000 threads to simulate a load on an EJB method i wish to test, and it seems not possible this way. Is there a way which i could achieve this? Or is it that i would need to have multiple machines in order to achieve that load. Is

Java MDB EJB Project maven depends on Web Project

你。 提交于 2019-12-25 04:17:15
问题 I got an existing web project. Now I got a requirement to add a MDB EJB project and did the same. The EJB project maven depends on the web project So all is well until now. The moment I start to use some of the classes in the web project in my MDB it compiles fine and everything look great But bombs in the runtime with NoClassDefFoundError I went to my web pom.xml and added this in the configuration secstion <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin<

How to call EJB in PhaseListener

假如想象 提交于 2019-12-25 02:32:51
问题 I use JSF 2 and EJB 3.1, all of them are deployed on Glassfish 3.1. When i setup a class named MyInterceptor which is implemented PhaseListener, i can not revoke remote EJB interface inside it. It notice "NullPointerException ..." public class MyInterceptor implements PhaseListener { @EJB(name="AuthorizationEJB", beanInterface=AuthorizationService.class, mappedName="corbaname:iiop:localhost:3700#ejb/AuthorizationEJB") public AuthorizationService authorizationService; .... } When I call

Ejb consumption in JDK1.4

时光毁灭记忆、已成空白 提交于 2019-12-25 02:23:01
问题 As a postlude to Consuming an EJB question. I have created an ejb on JBOSS AS 6.0 and am consuming it in a java client using the following code. private ServiceLocator(String host, String principal, String creadentials) throws NamingException { Properties env = new Properties(); env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); env.put(Context.PROVIDER_URL, "jnp://" + host); System.out

JBoss Embedded jUnit testing for EJB : NameNotFoundException

佐手、 提交于 2019-12-25 01:48:59
问题 I'm newbie in EJB and jUnit, and I'm trying to do Embedded testing for the simple EJB-project that running by jBoss AS 7.1.1.Final. I've written this test: package com.staff.test.logic; import java.io.File; import javax.ejb.embeddable.EJBContainer; import javax.naming.Context; import javax.naming.NamingException; import org.jboss.as.embedded.EmbeddedServerFactory; import org.jboss.as.embedded.StandaloneServer; import org.junit.Before; import org.junit.Test; import com.staff.main.logic