ejb-3.0

Error casting context.lookup(…) returned object to ejb3 remote object interface

会有一股神秘感。 提交于 2019-12-25 04:31:47
问题 I have an EJB stateless running under a JBoss server and a client under another JBoss server. In the client side, I am using the following code: final Properties initialContextProperties = new Properties(); initialContextProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); initialContextProperties.put(Context.PROVIDER_URL, "remote://127.0.0.1:8083"); initialContextProperties.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp

Wrong dependencies with EJB in JBoss Wildfly

随声附和 提交于 2019-12-25 04:29:11
问题 i wrote a TimerHelper class which can receive Callables from other classes and tries to execute them. If an exception occurs, it waits some time and tries again. So other classes can export tasks that have to be done, but not exactly at the moment. @Startup @Singleton public class TimerHelper{ private static final Logger LOGGER = Logger.getLogger(TimerHelper.class.getName()); private Callable<Void> task; private int failureCounter = 0; public TimerHelper(){ } @Resource private

set contextpath for EJB3 webservice on Weblogic 11g

喜你入骨 提交于 2019-12-25 02:42:44
问题 I build a web service with ejb3 and maven (EAR File),code First, JAXWS, Without WSDL and without WAR, only ejb , with Eclipse, the service works in JBOSS but now i need put the service in Weblogic 11g . With JBOSS i have the annotation @WebContext(contextRoot="/wsManCa7", urlPattern="/manCA7WS") But on Weblogic not, I found this link http://erikwramner.wordpress.com/2012/03/26/ejb3-web-service-context-path-in-weblogic-11g/ to create weblogic-webservices.xml and webservices.xml I put the files

EJB3: How to inject DataSource in EJB3 during Junit testing as raw POJO

╄→гoц情女王★ 提交于 2019-12-24 21:26:05
问题 Hi quick question about injecting an alternative data-source during integration testing of an (EJB 3.0) EJB through its raw POJO API using junit. I have been converting raw POJO services to EJB3 session beans. To do so has really just meant annotating the POJOs directly. The services are also accompanied by existing junit integration tests (that check the result of methods that query a real test database). Several of these services require a direct java.sql.Connection and so I intend to

Stateful session beans unexpected behaviour when packaged in a war and packaged in an ear->jar

怎甘沉沦 提交于 2019-12-24 15:18:45
问题 I am new to ejbs. I wrote a stateful session bean scoped @SessionScoped. Then I injected the ejb into my servlet. @Local @SessionScoped @Statueful public class CartServiceImpl implements CartService { private int i = 0; public int getI() { return i++; } } In my servlet @Inject private CartService cartService; . . . out.print(cartService.getI()); Then I opened two browsers (IE, FF) and have hit the servlet. In IE I see output starting from 0 to n. In firefox also I see the output starting from

How to dependecy inject an EJB3 constructor?

回眸只為那壹抹淺笑 提交于 2019-12-24 12:02:19
问题 According to EJB3 DI documentation it is possible to inject fields and setters. But how to inject a bean constructor ? 回答1: The EJB specification does not support constructor injection. The EJB programming model only uses the no-arg constructor, and can then perform field or setter method injection after the instance has been constructed. That said, EJB 3.1 is part of EE 6, which includes CDI. If your EJB module is a CDI BDA (bean deployment archive) because it includes beans.xml, then you

Using Dependency Injection in POJO's to inject EJB's

家住魔仙堡 提交于 2019-12-24 11:35:54
问题 Is it possible to inject ejb's into pojo's using the @EJB annotation? If it is, do I have to set up anything special on a JBoss server to make it work? Please let us not discuss the rationale behind doing this - I am just trying to hack some old code to make it work :-) 回答1: Yes, if you can make JBoss create the Pojo for you. Your problem is that you probably call new to create the Pojo and the framework can't intercept this which is why @EJB is ignored. The solution is to use a factory to

How can I improve this design that calls third party methods from JSF based front end

故事扮演 提交于 2019-12-24 10:02:45
问题 I want opinions and expert advice on design . I am developing an application using JSF2 and EJB3 and I am not using CDI. I have been given an API (jar) from an other team and there are three main methods in it. One searches the database and returns a list of cars and one returns a list of pushbikes and one returns list of boats. So basically we have three different lists of different vehicles. At the ui side user has a search form with three radio buttons one for each type of vehicle that

Does ejb stateless class has to be public?

拜拜、爱过 提交于 2019-12-24 05:30:04
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb

Does ejb stateless class has to be public?

半城伤御伤魂 提交于 2019-12-24 05:29:06
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb