ejb-3.1

Add scala capabilities into an existing EJB eclipse project

主宰稳场 提交于 2019-12-06 14:08:43
I have an existing EJB project set up in Eclipse Helios, and would like to slowly introduce Scala into the project. The Scala IDE has been installed successfully, and I'm able to create standalone scala project. The issue however comes when trying to use my existing project with scala additions. I've went as far as manually editing the .project, .classpath, and related files under .settings of the project's home directory for eclipse. However I still have the issue where the Java compiler tries to compiles .scala classes, which results in errors and ultimately not being able to build the

How to manually set/propagate security context information e.g. Principal for JBoss 7 (over JBoss remoting 2)

∥☆過路亽.° 提交于 2019-12-06 08:19:30
问题 I'm using jboss remoting 2.5.4.SP3 to provide remote access to EJBs in a JBoss 7.1 server from both a web app and other JBoss instances. I'm doing it manually because of issues with remote EJB access in JBoss 7.1, specifically (but not only) the inability to access the same (interface) bean on multiple servers simultaneously. I'm using remoting2 because remoting3 has no documentation. I have remoting working using TransporterHandle/TransporterClient using the socket transport, but in methods

How to I make this Timer Service Class handle the “change in scheduled time”?

做~自己de王妃 提交于 2019-12-06 07:44:59
问题 Sample Code: @Singleton @Startup public class EBlastScheduler { @Resource TimerService timerService; EBlastScheduler what = new EBlastScheduler(); @PostConstruct public void initialize(){ if (timerService.getTimers() != null) { for (Timer timer : timerService.getTimers()) { if (timer.getInfo().equals("EBlastScheduler")){ timer.cancel(); } } } ScheduleExpression expression = new ScheduleExpression(); expression.second("*/1").minute("*").hour("*"); timerService.createCalendarTimer(expression);

EJB 3.1 asynchronous method and thread pool

旧巷老猫 提交于 2019-12-06 06:20:08
问题 I need to process about 250.000 documents per day with an EJB 3.1 asynchronous method in order to face an overall long time task. I do this to use more threads and process more documents concurrently. Here's an example in pseudo code: // this returns about 250.000 documents per day List<Document> documentList = Persistence.listDocumentsToProcess(); for(Document currentDocument: documentList){ //this is the asynchronous call ejbInstance.processAsynchronously(currentDocument); } Suppose I have

Dependency injection into ResourceFilter not working?

自闭症网瘾萝莉.ら 提交于 2019-12-06 05:56:31
问题 I have a bunch of JAX-RS resources that provide an API for a new WebService. In order to understand what's happening, I'd like to store information about each request in a data warehouse. In my mind, this is a perfect example for a cross-cutting concern, which could be implemented by a ResourceFilter , right? So I built a DataWarehouseService which is supposed to store stuff in the DB: @Stateless @LocalBean public class DataWarehouseService { public void logApiCall(ContainerRequest cr) { //

When CDI injection into POJO should work? (GlassFish v3)

余生长醉 提交于 2019-12-06 05:14:51
问题 When I inject EJB 3.1 beans into POJO created by @Inject then injection works. When I construct POJO on my own then it doesn't (Glassfish v3). Is it correct behavior? My classes (in EJB module): @Singleton @LocalBean @Startup @Named public class NewSingletonBean { @PostConstruct public void init(){ System.out.println("NewSingletonBean INIT"); } } _ public class MyPOJO { @Inject NewSingletonBean newSingletonBean; public void sth(){ System.out.println("EJB injected into POJO: " +

Maven 2 & Packaging ejb vs jar

梦想与她 提交于 2019-12-06 03:57:06
If i'm working with ejb 3.1, what's the différence between <packaging>jar</packaging> and <packaging>ejb</packaging> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <version>2.3</version> <configuration> <ejbVersion>3.1</ejbVersion> </configuration> </plugin> As mentioned at http://maven.apache.org/plugins/maven-ejb-plugin/usage.html , "The plugin doesn't do any EJB specific processing during the generation of the jar except for validating the existence of an EJB deployment descriptor if the EJB version is 2.0+ " Since you have ejb 3.1 the ejb

@Startup @Singleton instantiated twice in WebLogic (EJB 3.1)

泄露秘密 提交于 2019-12-06 03:51:48
I have a class marked @Startup and @Singleton and the constructor is being called twice. Why is it being called twice? WebLogic 12.1.1 Running Locally (not cluster) @PostConstruct is also called twice when it is there Nothing relevant in XML configuration (weblogic-ejb-jar.xml et al) Here is the class: import java.util.concurrent.atomic.AtomicInteger; import javax.ejb.Singleton; import javax.ejb.Startup; @Startup @Singleton public class CacheStartupListener { static AtomicInteger count= new AtomicInteger(0); public CacheStartupListener() { System.err.println("Singleton invoked " + count

Arquillian vs EJB embeddable container

一个人想着一个人 提交于 2019-12-05 23:30:01
I am trying to understand the differences between the EJBContainer class provided by Java EE 6 for embeddable unit testing of EJB modules and Arquillian. Is there a good resource or can someone help me in understanding this? Is it worth to write Arquillian tests when I could test EJBs using an embeddable container? Full disclosure: I'm contributor of Arquillian Arquillian is a component model for integration testing . By using the EJBContainer , you bring the runtime(the container in this case) in your tests . By bringing the runtime in your tests, you add configuration complexity to them.

Issue with EJB 3.1 injected with CDI bean while running JUnit

╄→尐↘猪︶ㄣ 提交于 2019-12-05 23:09:36
I created a EJB3.1 and injected CDI bean using the @inject but facing some issues while unit testing however when tested from the servlet its working fine. I have the beans.xml in the WEB-INF folder. Below is my EJB code: @Stateless public class CdiUsingEjb { @Inject private HelloServletCDIPojo helloServletCDIPojo; public String greet() { assert helloServletCDIPojo != null; return helloServletCDIPojo.from(); } } Below is my CDI bean: public class HelloServletCDIPojo { public String from() { return "from HelloServletStateless CDI"; } } I created a JUnit class: public class CdiUsingEjbTest {